MCP server
The US Global Mail MCP server lets an AI assistant or coding agent work in a mailbox on the customer’s behalf: read and organize scanned mail, manage folders, request scans, keep shipping and deposit addresses and bank accounts current, follow shipment requests, and read the account profile and virtual mailing address.
It is a thin, stateless proxy in front of the public API. Every tool call becomes a REST call that carries your API key, so the gateway enforces authentication, plan access, rate limits, and the audit log exactly as it does for direct REST calls. There is nothing new to trust.
Setting this up for a customer who is not a developer? The support article Connect US Global Mail to AI apps using MCP walks through the same steps screen by screen.
At a glance
Before you connect
Have a plan with API access
Plans that include it list API & webhooks on their plan card. On other plans the API Keys page shows an upgrade banner and the Add API Key button is locked.
Create a key for the agent
In the dashboard go to Settings → Developer → API Keys, click Add API Key, name it after
the client you are connecting (for example Claude), and copy the key: it is shown once. It starts
with usgmk_live_.
Optional: get a sandbox key
On the same page, Activate Sandbox gives you a usgmk_test_… key for an isolated test
mailbox. See Sandbox for how to seed it with sample mail.
Treat the key like a password: anything the agent can do, the key can do, with the same access as you. Use a dedicated key per agent so you can revoke one without touching the others, and rotate a key the moment it may have leaked.
Connect your client
In every example, replace YOUR_API_KEY with the key you copied.
Claude on the web and Claude Desktop
Claude uses a custom connector, added once to your Claude account and available on the web and in Claude Desktop. Custom connectors exist on every Claude plan; the Free plan allows one.
Add the connector
In Claude, open Customize → Connectors, click Add, and choose Add custom connector.
Enter US Global Mail as the name and https://mcp.usglobalmail.com/mcp as the remote MCP
server URL, then click Continue.
Keep No sign-in
Claude probes the server and preselects No sign-in, marked Detected. Leave it selected.
Claude Code, Cursor, VS Code, Codex CLI
Config file locations: .mcp.json at the project root for Claude Code, .cursor/mcp.json for
Cursor, .vscode/mcp.json for VS Code, and ~/.codex/config.toml for Codex CLI. VS Code prompts
for the key the first time the server starts and stores it, so it never sits in the file. In Claude Code, /mcp lists usgm as connected once the command has run.
Claude Desktop without a connector
If you prefer to keep the key on the machine instead of in your Claude account, Claude Desktop can
run the open-source mcp-remote bridge, which needs
Node.js. Open Settings → Developer → Edit Config and add the server to mcpServers:
The header value lives in an environment variable with no space after the colon on purpose: Claude
Desktop on Windows mangles spaces inside args. The first start can take a while because the bridge
probes for an OAuth challenge before it connects.
Other clients
Any client that supports remote MCP servers over Streamable HTTP works with the URL above, transport
streamableHttp, and an Authorization: Bearer YOUR_API_KEY header. Gemini CLI (httpUrl plus
headers), Cline (url, type, headers), and Windsurf (serverUrl plus headers) all accept that
shape. ChatGPT’s connectors offer only OAuth or no authentication, so they cannot send the key and
cannot connect yet.
Try it with curl
The server speaks plain JSON-RPC over HTTP, so you can exercise it without a client. initialize and
tools/list need no key; tools/call forwards the key to the gateway.
A successful call returns the tool’s text content. A failed call is not an HTTP error: it is a
normal JSON-RPC result with isError: true, so the agent can read and act on it:
Sandbox
The sandbox is a separate test mailbox with its own key. Activate it on the API Keys page, then use
the usgmk_test_… key with the same MCP endpoint: the server recognizes the prefix and forwards
the call to the sandbox gateway. A live key never sees sandbox data and a sandbox key never sees real
mail. The sandbox starts empty; one call to the
seed endpoint fills it with sample mail, and the
sandbox-only REST endpoints let you complete scans and simulate the operator; there are no MCP tools
for them.
Tools
Every list tool except folders_list takes limit (max 100) and cursor and returns
{ data, next_cursor, total_count }; pass next_cursor back as cursor to page, as described in
Pagination. folders_list returns { data } with every folder.
Ids are the same strings the REST API uses, so a mail id from mails_list works with scans_create,
and a folder id with mails_move_to_folder.
Tools carry MCP annotations that well-behaved clients act on: read-only tools never change anything, idempotent tools can be safely retried, destructive tools are hard to reverse, and billable tools say so in their description. The server’s instructions also tell the model to confirm with the user before calling a destructive or billable tool.
Scans
Folders
Addresses and bank accounts
Shipments and account
Creating shipments is not available through MCP yet; use the REST API.
Errors
A tool error wraps the gateway’s problem+json response as
Gateway error <status>: <text>. The text is the REST problem’s detail, or its title when it has
no detail, followed by each entry of errors as field: message. A response that is not problem+json
(a load-balancer error page) reads gateway responded <status>. The common cases:
Other statuses (400, 403, 409, 502, 504) pass through from the service that owns the resource;
the text is that service’s detail when it provides one, else the problem title.
Rate limits are the REST limits, keyed by API key, so an agent shares its budget with any other client using the same key. One key per agent keeps the budgets separate.
Safety and good practice
- Keep tool approval on. Where your client can ask before each tool runs, leave that on for this server, at least until you trust the agent with the mailbox.
- The risky tools say so. Shredding, deleting, and paid scans carry the destructive or billable annotation, and the server’s instructions tell the model to confirm with you first; honour both when you build your own client.
- One key per agent, rotate on suspicion. Revoke or rotate under Settings → Developer → API Keys; a revoked or rotated key stops working immediately.
- Everything is audited. Settings → Developer → Audit Logs records every change made through the API, with the key that made it, so you can see exactly what an agent did.
- Know what the agent sees. Scan summaries, scan files, and mail metadata go to the AI client you connected and are handled under its privacy terms. Bank account numbers are never exposed beyond the last four digits.
- Keys are all-or-nothing. A key has the same access as the account owner; there are no scoped keys and no OAuth consent flow. The sandbox is the place to let an agent loose.
How it works
- Stateless proxy. Each request builds a fresh MCP server bound to the caller’s
Authorizationheader, forwards tool calls to the gateway over a pooled HTTP client, and discards everything when the response ends. No sessions, no caching, no stored keys. - One endpoint, two gateways. The production server holds a client for the live gateway and one
for the sandbox gateway, and picks by key prefix per request:
usgmk_test_goes to the sandbox, everything else to production. The gateways themselves are unchanged and still reject a key that does not belong to them. - Versioning.
initializereportsusgm-public-api-mcpand its version; tool additions are announced throughtools/list, andlistChangedis advertised.
Troubleshooting
Limitations
- API-key passthrough only; there is no OAuth flow yet, so clients that cannot send a custom header (ChatGPT’s connectors, for example) are not supported.
- Shipments are read-only through MCP.
- Tool results are text; binary scan files are fetched through the signed URL from
scans_get_file.