---
title: "Quickstart: MCP"
description: "Connect Claude Code, Codex, Cursor or another MCP client to YoAgent and run a first email test."
url: "https://docs.yoagent.dev/start/quickstart-mcp"
---

# Quickstart: MCP

YoAgent’s MCP server is at `https://api.yoagent.dev/mcp/mail` (Streamable HTTP). It gives your agent tools to create inboxes, wait for mail, read links and codes, send, reply and label — the [MCP tools reference](https://docs.yoagent.dev/reference/mcp-tools) lists them all. It is in the official MCP Registry as `dev.yoagent/mail` and on [Glama](https://glama.ai/mcp/connectors/dev.yoagent/mail).

A client connects in one of two ways:

- **Sign in in the browser (OAuth).** No key to copy: the first time, the client opens a browser window where you sign in with Google, GitHub or GitLab and click **Allow**. The first sign-in creates your account. The client acts as you, with your role and access.
- **An API key** in the header `Authorization: Bearer <key>`, for clients without OAuth, CI and agents that run unattended. The same key works with the REST API ([API keys, OAuth and permissions](https://docs.yoagent.dev/account/api-keys-oauth-and-permissions)).

## Connect your client

**Claude Code**

Run it in a terminal:

```bash
claude mcp add --transport http yoagent https://api.yoagent.dev/mcp/mail && claude mcp login yoagent
```

With an API key instead (add `--scope user` to use the server in every project):

```bash
claude mcp add --transport http yoagent https://api.yoagent.dev/mcp/mail --header "Authorization: Bearer <api key>"
```

**Codex**

```bash
codex mcp add yoagent --url https://api.yoagent.dev/mcp/mail
```

With an API key instead, in `~/.codex/config.toml`:

```toml
[mcp_servers.yoagent]
url = "https://api.yoagent.dev/mcp/mail"
http_headers = { "Authorization" = "Bearer <api key>" }
```

**Claude**

In Claude Desktop or on claude.ai:

1. Open **Plugins** and click **Add → Add custom connector**.
2. Name it YoAgent, paste `https://api.yoagent.dev/mcp/mail` and click **Continue**.
3. Keep the sign-in options Claude detects and click **Add**.

Claude’s free plan allows one custom connector.

**ChatGPT**

1. In **Settings → Apps → Advanced settings**, turn on **Developer mode** (not on every plan).
2. Click **Create app**, name it YoAgent, paste `https://api.yoagent.dev/mcp/mail` and pick **OAuth**.
3. In a chat, pick **Developer mode** from the **+** menu.

**Cursor**

In `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "yoagent": {
      "url": "https://api.yoagent.dev/mcp/mail"
    }
  }
}
```

With an API key, add `"headers": { "Authorization": "Bearer <api key>" }` next to `url`.

**VS Code**

```bash
code --add-mcp '{"name":"yoagent","type":"http","url":"https://api.yoagent.dev/mcp/mail"}'
```

Then start the server in VS Code (GitHub Copilot’s agent mode). With an API key, put the server in your user profile’s `mcp.json`:

```json
{
  "servers": {
    "yoagent": {
      "type": "http",
      "url": "https://api.yoagent.dev/mcp/mail",
      "headers": { "Authorization": "Bearer <api key>" }
    }
  }
}
```

**Antigravity**

```bash
agy mcp add yoagent https://api.yoagent.dev/mcp/mail
```

Sign in in the browser, then paste the code it shows into Antigravity. With an API key instead:

```bash
agy mcp add -H "Authorization: Bearer <api key>" yoagent https://api.yoagent.dev/mcp/mail
```

**Other clients**

Any client that connects to a remote HTTP MCP server works with an API key: create one in the dashboard (**API keys → Create key**), set the server URL to `https://api.yoagent.dev/mcp/mail` and send the key in the header `Authorization: Bearer <api key>`.

The dashboard shows the same commands, ready to copy, on its **Dashboard** page until the organization has its first API key or connected app, and with the key filled in when you create one.

![The Get started card of the YoAgent dashboard: a command per MCP client and the project’s test address](https://docs.yoagent.dev/_astro/connect-mcp.CnEqAjdu_Z2gXpRY.webp)

## Choose an organization

Signed in by OAuth, you check on the consent page which of your organizations the app may use. With one checked, the app works in it right away. With several, it works in one at a time, and until it picks one every tool that works with mail answers `conflict: no organization selected — call list_organizations, then select_organization`; the documentation tools below work either way. Ask your agent to switch (“Use the Acme organization in YoAgent”): it calls `list_organizations` and `select_organization`.

An API key belongs to one organization, so it needs neither: these two tools refuse it.

## A trial key reads only

The key from [yoagent.dev/try](https://yoagent.dev/try) can wait for mail and read it, but cannot create inboxes, send or change anything: give your agent the trial’s `test@` address instead of asking it to create one. When you sign up and the trial becomes yours, its key stops working: remove the server first (`claude mcp remove yoagent` in Claude Code), then connect again without a key. If you have no room for another organization of your own on Free, the trial stays a trial, yours to take later, and its key keeps working.

## Your first test

Ask your agent:

> Create an inbox and tell me its address. I’ll send it an email. Wait for it and tell me the subject.

The agent calls these tools:

1. **`create_inbox`** — with no arguments, an inbox with a random name in your first project, such as `inbox-3f9a1c2e@k7m2xq4p.yoagent.email`. Or skip it and use your project’s `test@` address, which the dashboard shows.

2. **`wait_for_message`** with `to` set to that address — it answers as soon as a message arrives. One call waits up to 55 seconds; when nothing came, it answers `message: null` and a `cursor` to wait again with. `subject` and `sender` narrow it to the message you expect.

3. **`extract_links`** or **`extract_codes`** — the message’s links, each with a `kind` (`verify`, `reset`, `unsubscribe` or `other`), and the codes found in it, such as a sign-in code.

4. **`delete_inbox`** when the test is done: the inbox and its mail are deleted for good.

How waiting, reading and the message’s fields work: [Receive and read email](https://docs.yoagent.dev/email/receive-and-read-email).

## Ask the docs

The same server answers questions about YoAgent from this knowledge base, so your agent can look things up while it works:

> How do I verify a YoAgent webhook’s signature?

The agent calls **`search_docs`** with its question in words (`query: "verify webhook signature"`): the pages that answer it best, each by its best section in Markdown with a link. **`get_doc`** with a result’s `path` reads that page whole. Both work with an API key and over OAuth, an organization selected or not; every page is also Markdown at its address plus `.md`, and [llms.txt](https://docs.yoagent.dev/llms.txt) lists them.
