Connect Claude Code to Postal
Add Postal to Claude Code with one command and use the terminal to diagnose deliveries and send test emails.
- How you sign in
- Account or key
- Transport
- HTTP
- Recommended access
- Read and send
Before you start
Check these points before opening the Claude Code setup. They prevent most connection failures.
- A team with the "MCP server" plan feature (
mcp_access); without it the server responds 403plan_limit_reached. - To send emails, the team needs at least one verified domain.
- If you will use an API key: create the key in the dashboard, under API keys. It starts with
ps_; a send-only key is enough if you will only send. - Each connection acts on a single team. To use another team, connect again and pick the other one.
- Connections are listed under Settings › AI connections in the dashboard, where they can be revoked at any time.
What Claude Code requires
A recent Claude Code (v2.1.265 or later falls back automatically from HTTP to SSE; Postal does not offer SSE, so the fallback is not used). A local browser for the OAuth login. Tool output: default limit of 25 thousand tokens (MAX_MCP_OUTPUT_TOKENS raises it); ask for lists with a low limit.
Connect
Follow the steps in order. The server address is always https://api.postal.so/mcp. Recommended path: sign in with your account (OAuth). The API key is the alternative. Wherever ps_... appears, use your own API key: the value shown is only an example.
- 1
Run the command below (--scope user applies to all projects; without the option, it applies only to the current project).
- 2
Inside Claude Code, type
/mcp, choose "postal" and follow the login in the browser. In a terminal without a browser, use:claude mcp login postal. - 3
On the Postal screen, choose the team and click Allow. Claude Code stores and renews the tokens.
- 4
For an API key, use the second command (the key stays in your local configuration file; do not put it in a versioned
.mcp.json, use ${POSTAL_API_KEY}). - 5
To limit access to read and send, pin the scopes in
.mcp.json(third snippet).
OAuth (recommended)
claude mcp add --transport http --scope user postal https://api.postal.so/mcpAPI key
claude mcp add --transport http --scope user postal https://api.postal.so/mcp --header "Authorization: Bearer ps_..."Pin scopes (read and send)
{
"mcpServers": {
"postal": {
"type": "http",
"url": "https://api.postal.so/mcp",
"oauth": {
"scopes": "mcp:read mcp:send"
}
}
}
}Access the tool needs
Postal splits access into three levels, explained in the scopes table. For Claude Code:
mcp:readView emails, domains, contacts, segments, topics, templates, broadcasts, automations, forms, inbox conversations, metrics and usage.
mcp:sendSend and schedule emails from verified domains and record events for automations.
mcp:fullEverything above, plus creating, changing and deleting contacts and templates, creating and sending broadcasts (send_broadcast requires confirm: true), canceling scheduled emails and working in inboxes (organize, reply, create drafts).
For day-to-day development (viewing domains, email statuses, templates and sending test emails), mcp:read and mcp:send are enough. Use mcp:full for the agent to create templates or broadcasts. By default Claude Code requests the three announced scopes; pin oauth.scopes to request fewer.
How to confirm it worked
The simplest proof is to ask for something read-only inside Claude Code itself. The connection also shows up under Settings › AI connections in the Postal dashboard, with the app, the team and the last use.
Illustrative example
For those who want the technical proof
npx @modelcontextprotocol/inspector --cli https://api.postal.so/mcp \
--transport http \
--header "Authorization: Bearer ps_..." \
--method tools/listThe Inspector proves that the Postal server responds. It does not test Claude Code itself. The full walkthrough is in Validate the connection.
If something goes wrong
Go through the list in order. Then read what we know (and what we don't know) about Claude Code.
Check
- The address is exactly
https://api.postal.so/mcp, with/mcpat the end. - The connection type is HTTP (Streamable HTTP). Postal does not offer SSE: if the tool gives you the choice, use HTTP.
- The team has the "MCP server" feature on its plan. Without it, the server responds 403
plan_limit_reached. - To send emails, the team has at least one verified domain.
- Each connection acts on a single team. To use another one, connect again and pick the other.
- 429 response (
rate_limit_exceeded): the plan's requests-per-second limit was reached. Wait a moment and try again. - If the tool complains about the response size, ask for smaller lists (at most 100 items per call; the default is 20).
- To start over from scratch, revoke the connection under Settings › AI connections and connect again.
What was tested and what was not
We ran Postal's automated tests with the real documents and callback addresses the app publishes, and with the official MCP SDK client. It is not a test inside the real application. Below is the full note on what was and was not verified.
Test details
This was a gap and was fixed on 2026-10-28: Claude Code identifies itself with the document https://claude.ai/oauth/claude-code-client-metadata, which declares http://localhost/callback, and sends a random port (for example http://localhost:3118/callback). Postal only ignored the port for 127.0.0.1 and [::1], so authorization was rejected. Now localhost gets the same treatment (Anthropic's documentation asks for this); host, path and query are still compared for equality, with tests showing that everything else stays blocked. Verified by a test with the real document and with the official SDK client; not tested with the Claude Code binary. API key in a header verified with the SDK and with the Inspector.
Frequently asked questions
Do I need an API key to connect Claude Code?
Not required. Claude Code can sign in with your Postal account (OAuth) or with an API key. Recommended path: sign in with your account (OAuth). The API key is the alternative. The send-only key (sending_access) exposes only send_email and track_event.
Can I limit what Claude Code does on my account?
For day-to-day development (viewing domains, email statuses, templates and sending test emails), mcp:read and mcp:send are enough. Use mcp:full for the agent to create templates or broadcasts. By default Claude Code requests the three announced scopes; pin oauth.scopes to request fewer. You can revoke the connection at any time under Settings › AI connections.
Keep going
Other tools
Each tool has its own walkthrough. See also the full list under AI.
Codex
Set up Postal in Codex (CLI, IDE extension and app) with a few lines in config.toml.
See how to connectGitHub Copilot
Use Postal in GitHub Copilot: in VS Code via OAuth, in the Copilot CLI and in the Copilot cloud agent with an API key.
See how to connectGemini
Connect Postal to the Gemini CLI (and to Antigravity, which replaces it for those without a paid plan) to look up and send emails from the terminal.
See how to connectReady to use Postal in Claude Code?
Create your account and connect. If you need help, talk to us through the contact form.