---
title: "How to connect Claude Code to your email with Teddy's MCP server"
description: "Create a Teddy access token and add one claude mcp add command so Claude Code can search, draft, send and fetch sign-in codes from Gmail, Outlook or IMAP."
url: https://sapps.co/explore/teddy-ai-email-client/articles/connect-claude-code-to-email-mcp
app: "Teddy"
app_url: https://sapps.co/explore/teddy-ai-email-client
published: 2026-12-01T17:38:25.803Z
updated: 2026-12-01T17:38:25.803Z
tags: ["MCP","Claude Code","how-to","AI agents"]
lang: "en"
---

# How to connect Claude Code to your email with Teddy's MCP server

To let Claude Code read and send your email, create an access token in Teddy, then register Teddy's MCP endpoint with one `claude mcp add` command. Claude Code can then search your inbox, read threads, save drafts, send replies and pick up sign-in codes from the Gmail, Outlook or IMAP mailboxes you have already connected to Teddy.

You need Teddy with at least one mailbox connected, and the [Claude Code CLI](https://code.claude.com/docs/en/mcp) installed. Setup takes about five minutes.

## What Claude Code can do with your mail

Teddy's MCP server (named `teddy-mail`) exposes 24 tools; the full list is under **Settings > AI tools (MCP) > Available tools**. They fall into four groups:

- **Reading:** `list_accounts`, `list_folders`, `list_messages`, `search_messages`, `read_message`, `list_attachments` and `get_attachment` (which returns a temporary download link).
- **Sending:** `send_email`, `reply_email` (keeps the thread) and `forward_email`. All three accept a `from` address, so Claude Code can send from a send-as alias you set up in Teddy.
- **Drafts and organizing:** `create_draft`, `update_draft`, `send_draft`, `delete_draft`, `mark_read`, `mark_unread`, `star_message`, `archive_message` and `delete_message`.
- **Helpers:** `get_verification_code`, `list_senders`, `list_drafts`, `list_templates` and `list_scheduled`.

Every mailbox tool takes an optional `account`. With two mailboxes connected, you can say "search my work account" and Claude Code passes the right one.

## Before you start: what a token allows

A Teddy access token gives the client every one of these tools. The MCP endpoint doesn't ask you to approve individual actions. That is different from Teddy's built-in assistant, where sending and organizing need a grant in the conversation. If Claude Code calls `send_email` or `delete_message`, the call runs.

Two habits keep this safe:

- If you let Claude Code run tools without confirming them, leave the sending and deleting tools out of that list, so you see each one before it runs.
- Create one token per client, and revoke it when you stop using that client (see the last section).

A token works with every mailbox connected to Teddy in your workspace. Treat it like a password: don't commit it to a repository or paste it into a shared config file.

## Create an access token

1. In Teddy, open **Settings** and scroll to **AI tools (MCP)**.
2. In **Token label**, type a name you will recognize later, such as "Claude Code on my laptop".
3. Click **Create access token**.
4. Click **Copy token** and save the token in your password manager. Teddy shows it only once and keeps only a hash of it.

![New Teddy access token shown once, with Copy token and Dismiss token buttons](https://api.sapps.co/api/assets/store/d5a38a857a4446e0/article/eb6da88b-d563-4978-95f5-bfe3399d290f.png)

5. Click **Dismiss token** once you have saved it. Teddy asks you to confirm, because you can't view the token again.

## Add Teddy to Claude Code

Below the token, the **Connect a client** guide has a **Claude Code** tab. While the new token is still on screen, the tab fills your token and endpoint into the command.

![Claude Code tab of the Connect a client guide, with the claude mcp add command filled in](https://api.sapps.co/api/assets/store/d5a38a857a4446e0/article/9efd3403-0e13-4477-a873-7b30aad71f29.png)

1. Click **Copy** next to **Terminal**. The command has this shape, with your own token and endpoint:

   ```bash
   claude mcp add --transport http \
     --header "Authorization: Bearer <YOUR_TOKEN>" \
     teddy-mail <YOUR_TEDDY_ENDPOINT>
   ```

2. Optional: add `--scope user` to use Teddy in all your projects. Without a scope flag, Claude Code keeps the server for the current project only. Avoid `--scope project` here: it writes the server, token included, to the project's `.mcp.json`, which is usually committed.
3. Run the command in your terminal.
4. Run `claude mcp list`. `teddy-mail` should show as connected.

Claude Code saves the server without checking the token. A mistyped token only shows up later: Teddy answers "Invalid or revoked MCP token" and Claude Code reports a failed connection.

## Try it

Start Claude Code and ask in plain language. Each of these prompts maps to one or two tools:

- "List my mail accounts in Teddy." (`list_accounts`)
- "Find the latest email from Maya about the roadmap and summarize it." (`search_messages`, then `read_message`)
- "Draft a reply to that email saying I'll confirm owners by Thursday. Don't send it." (`create_draft`)

Drafts made this way appear under **Saved drafts** in Teddy's **Compose** screen, so you can read them and send them yourself.

### Sign-in codes for scripts and agents

`get_verification_code` scans recent mail for a one-time code. It returns the code with the subject, sender and time the email arrived. By default it looks back 30 minutes (you can ask for up to 240) and it accepts a search query to narrow the messages.

This helps when Claude Code tests a sign-up flow on a staging site that emails a code: ask it to "get the verification code from the email that just arrived from staging.example.com". The code is picked by pattern matching. Numbers near words like "code", "verification" or "sign in" score high; numbers near "order", "invoice" or "phone" score low. If several codes arrived close together, check that the returned subject is the one you expect.

## Other clients and plain HTTP

The **Connect a client** guide also has tabs for ChatGPT, Claude Desktop, Cursor, VS Code (Copilot) and any HTTP client, each with a config to copy. For ChatGPT, the guide warns that custom connectors may only offer OAuth or no authentication on some plans; in that case ChatGPT can't send Teddy's token.

For your own scripts, POST JSON-RPC 2.0 to the endpoint with `Authorization: Bearer <token>` on every request. It is a stateless Streamable HTTP endpoint without SSE streaming, so a GET request returns 405.

## Revoke a token

Every token is listed under **AI tools (MCP)** with its label, its first characters, when it was created and when it was last used.

![Token card for Claude Code on my laptop, marked Active, with the last-used time and a Revoke token button](https://api.sapps.co/api/assets/store/d5a38a857a4446e0/article/157a239d-d687-4191-9635-a2f11803748a.png)

To cut a client off, click **Revoke token** and confirm. The card changes to **Revoked**, and the next request with that token gets "Invalid or revoked MCP token". Then remove the server from Claude Code with `claude mcp remove teddy-mail`.

A token whose **Last used** time you don't recognize is worth revoking straight away.

Try Teddy on [the Store page](https://sapps.co/explore/teddy-ai-email-client).
