On this page
Add a remote MCP server to Claude Code
claude mcp add registers the server; /mcp inside a session opens its sign-in in your browser. After that its tools show up as mcp__mailr__….The command takes a transport, a name and the server’s URL. The name becomes the prefix of every tool, so mailr gives mcp__mailr__prepare_mail, mcp__mailr__send_prepared and so on. Servers that only offer the older SSE transport are added with the same command. The rest of the commands you’ll use:
# Add a remote (HTTP) MCP server. Local scope is the default.
claude mcp add --transport http mailr https://mailr.dev/mcp
# Share it with everyone who opens this repo (writes .mcp.json):
claude mcp add --transport http mailr --scope project https://mailr.dev/mcp
# Sign in from the shell instead of /mcp, then check it:
claude mcp login mailr
claude mcp list
claude mcp get mailr
# Sign out at the server, then remove it:
claude mcp logout mailr
claude mcp remove mailrClaude Code MCP scopes: local, project or user
--scope local~/.claude.json, under this projectJust you, in this project. The default.--scope project.mcp.json in the repoEveryone who opens the repo, after they approve it--scope user~/.claude.jsonJust you, in every project--scope. Local is the default. A project-scoped server is shared through .mcp.json, and Claude Code asks each person before it uses one.A project-scoped server is written to .mcp.json at the root of the repo, so it can be committed. For safety, Claude Code asks each person before it uses a server from that file; claude mcp reset-project-choices clears those answers. The file is plain JSON:
{
"mcpServers": {
"mailr": {
"type": "http",
"url": "https://mailr.dev/mcp"
}
}
}Sign in to a remote MCP server with /mcp
Run /mcp in a session, pick the server and finish the sign-in in your browser. For Mailr, that’s Sign in with Mailr: you pick the account and choose Allow, and the connection gets its own access, never your API keys. Claude Code stores the tokens securely and refreshes them on its own.
- From the shell:
claude mcp login mailrruns the same sign-in. - In
claude -pruns there’s no/mcppanel, so sign in once from an interactive session first. - To sign out, choose Clear authentication in
/mcp, or runclaude mcp logout mailr. Removing a server deletes its local tokens but doesn’t revoke them at the service, so log out first.
Choose which MCP tools Claude Code runs without asking
Permission rules name MCP tools as mcp__<server>__<tool>, or every tool on a server as mcp__<server>__*. A good split for any server that can spend money: allow the tools that only read or prepare, and leave the ones that act to ask each time.
{
"permissions": {
"allow": [
"mcp__mailr__get_prices",
"mcp__mailr__list_templates",
"mcp__mailr__prepare_mail",
"mcp__mailr__list_mail",
"mcp__mailr__get_mail"
]
}
}Anything not on the list, here sending and checking addresses, still asks every time. Mailr marks its read-only tools as such, and send_prepared and verify_addresses as tools that act, so this list lines up with how the server describes itself.
Example: a direct mail API as a Claude Code MCP server
With Mailr connected, you can ask for mail in plain words from the session you’re already in:
- “Price a 6x9 to these 400 addresses.”
prepare_mailchecks the request and returns the total and a proof link; nothing is sent. - “Send it as a test.” Test mail is free and never prints, so you can see every proof first.
- “Now send it live.”
send_preparedasks before it runs, and Mailr sends only the exact draft and total you approved, paid from your balance.
That’s for sending mail from a session. To have Claude Code build mail into your app instead, so your own code calls the API on an event, use the skill on the Claude Code integration page and a prompt from the Claude Code mail templates. The same server also works as a connector in Claude on the web, covered in Claude connectors, in ChatGPT, covered in ChatGPT MCP, in GitHub Copilot, covered in VS Code MCP, and in Gemini, covered in Gemini MCP.
Claude Code MCP limits worth knowing
MCP_TIMEOUTsets how long Claude Code waits for a server to start, in milliseconds, for exampleMCP_TIMEOUT=10000 claude.- A per-server
timeoutin.mcp.jsoncaps how long one tool call may run. MAX_MCP_OUTPUT_TOKENSraises how much tool output Claude Code accepts, for servers that return large results.
Claude Code MCP questions
How do I add an MCP server to Claude Code?
For a remote server, run claude mcp add --transport http <name> <url>, then run /mcp in a session to sign in if it needs it. Servers that only offer SSE use the same command.
Where does Claude Code store MCP servers?
Local and user-scoped servers live in ~/.claude.json; project-scoped servers live in .mcp.json at the root of the repo, so they can be committed and shared.
How do I sign in to a remote MCP server?
Run /mcp in a Claude Code session, pick the server and finish the sign-in in your browser. From the shell, claude mcp login <name> does the same.
Can Claude Code use MCP servers in claude -p?
Yes, but a non-interactive run can't do the sign-in. Sign in once from an interactive session with /mcp first.
Does the Mailr server cost anything to try?
No. Test mail is free and never prints; live mail is paid from your Mailr balance and only sent after you approve the total.