Menu AI agents (MCP)

Guides

AI agents (MCP)

Connect the fake-email.pro MCP server to Claude Code, Cursor, VS Code or an agent in CI, so it can create a mailbox, sign up with it and read the verification email on its own. What it is and why: MCP server.

Server

URLhttps://api.fake-email.pro/mcp
TransportStreamable HTTP
Sign-inAuthorization: Bearer fep_… – the same key as REST, from Settings → API keys
QuotaEach mailbox the agent creates counts towards your monthly API quota, as it does over REST (Limits).

Connect your client

claude mcp add --transport http fake-email https://api.fake-email.pro/mcp \
  --header "Authorization: Bearer $FAKE_EMAIL_API_KEY"

Claude Code expands $FAKE_EMAIL_API_KEY once, when you add the server, and keeps the key itself. A Cursor started from the Dock does not see your shell's variables, so its file holds the key. In VS Code the file can go into the repository: the key is asked for once and kept in VS Code's secret storage, not in the file.

In CI

Commit .mcp.json to the repository and store the key as a CI secret named FAKE_EMAIL_API_KEY: the client fills in ${FAKE_EMAIL_API_KEY} from the environment. Claude Code reads the file from the project root, or pass it with --mcp-config.

Claude Code
{
  "mcpServers": {
    "fake-email": {
      "type": "http",
      "url": "https://api.fake-email.pro/mcp",
      "headers": {
        "Authorization": "Bearer ${FAKE_EMAIL_API_KEY}"
      }
    }
  }
}

Tools

create_mailboxCreates a disposable mailbox that receives email for 24 hours.
list_mailboxesLists your active mailboxes.
get_mailboxOne mailbox: when it expires and how many messages it has.
delete_mailboxDeletes a mailbox and its messages right away.
wait_for_messageWaits up to 50 seconds for an email and returns it with the verification code and confirmation link already extracted.
list_messagesThe messages of a mailbox, newest first.
get_messageOne message: its text, codes, links and the list of attachments.
delete_messageDeletes one message with its attachments.
list_domainsThe domains a new mailbox can use.
get_limitsYour API quota and rate limits.

Troubleshooting

  • 401 Unauthorized with missing or invalid API key in the body – the key is missing, mistyped or revoked. If an agent cannot connect in CI, check the secret first.
  • 400 from a client you wrote yourself – send Accept: application/json, text/event-stream with every request: the server answers as an event stream and rejects a request without this header.

Untrusted content

Emails are written by outside senders, so the server hands them to the model as untrusted data: the extracted code and link first, then the email text wrapped in markers that tell the model not to follow instructions in it. Still, review what your agent does with mail from senders you don't know.

Something missing, confusing or wrong on this page? Tell us