Direct mail API for developers and growth teams. Read the docs →

Claude Code MCP: add a remote server, sign in, and set permissions, with a direct mail API as the example

Claude Code MCP servers give a Claude Code session tools it doesn’t have on its own: your database, your issue tracker, or, in the example here, a direct mail API that prints and mails postcards. A remote server takes one command, claude mcp add --transport http <name> <url>; /mcp signs you in, and permission rules decide which of its tools run without asking. Below: adding a server, choosing its scope, signing in, setting permissions, and what Mailr’s server does once it’s connected.

On this page
  1. Add a remote MCP server to Claude Code
  2. Claude Code MCP scopes: local, project or user
  3. Sign in to a remote MCP server with /mcp
  4. Choose which MCP tools Claude Code runs without asking
  5. Example: a direct mail API as a Claude Code MCP server
  6. Claude Code MCP limits worth knowing
  7. Claude Code MCP questions

Add a remote MCP server to Claude Code

terminal, then a Claude Code session$ claude mcp add --transport http mailr https://mailr.dev/mcp# then, inside Claude Code:> /mcp# choose mailr and sign in with Mailr in the browser# its 13 tools appear as mcp__mailr__prepare_mail, mcp__mailr__send_prepared, …
One command, one sign-in. 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 mailr

Claude 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
Pick the scope with --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 mailr runs the same sign-in.
  • In claude -p runs there’s no /mcp panel, so sign in once from an interactive session first.
  • To sign out, choose Clear authentication in /mcp, or run claude 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_mail checks 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_prepared asks 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_TIMEOUT sets how long Claude Code waits for a server to start, in milliseconds, for example MCP_TIMEOUT=10000 claude.
  • A per-server timeout in .mcp.json caps how long one tool call may run.
  • MAX_MCP_OUTPUT_TOKENS raises 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.

START SENDING

Put your first postcard in the mail

Create a key, send a test to yourself, and check the proof before anything prints.

Start sending
  • Postcards, flats and folded mailers
  • A proof before anything prints
  • Free test mode: nothing prints, nothing charges
  • A status for every piece

Free price sheet

Get the price sheet by email

Every postcard, letter, mailer and print product on every plan, with postage included.

We’ll email you the price sheet. By continuing you agree to the Terms and Privacy Policy.

Download the template kit?

mailr-kit.zip · about 310 KB · 59 text files

Only HTML, JSON and Markdown files. No programs, scripts or macros, nothing that installs or runs.