Headless / API key
OAuth needs a browser. Where there isn't one — CI jobs, SSH sessions, containers, Codex CLI, or any client that can only paste a static header — send a workspace API key as the Bearer token instead. Same scopes, same gates, same tools.
What are the connection details?
| Server URL | https://mcp.unitpost.com/mcp |
|---|---|
| Transport | Streamable HTTP |
| Auth (recommended) | OAuth 2.1 — add the URL, approve in the browser(scopes match API capabilities; tokens refresh automatically) |
| Auth (legacy) | Authorization: Bearer pk_live_YOUR_KEY(workspace API key from Settings → API keys; for clients that can only paste a key) |
| Tools | one per API operation (email_send, email_campaigns_send, …) |
How do I connect Headless / API key?
Create an API key
Open https://www.unitpost.com → Settings → API keys → create a scoped key. Copy the full
pk_live_…value (shown once). In every snippet below, replacepk_live_YOUR_KEYwith that value.Shown once. Keep the
Bearerprefix in every snippet. Grant only the scopes the agent needs (e.g.emails:sendforemail_send). Prefer a revocable key dedicated to the agent.Cursor (static key)
Edit `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (this project only) — or Cursor Settings → MCP → Add new MCP server. Put the
unitpostentry under top-levelmcpServers.JSON{ "mcpServers": { "unitpost": { "url": "https://mcp.unitpost.com/mcp", "headers": { "Authorization": "Bearer pk_live_YOUR_KEY" } } } }Claude Code (static header)
Flags stay before the name/URL.
Shellclaude mcp add --transport http --header "Authorization: Bearer pk_live_YOUR_KEY" unitpost https://mcp.unitpost.com/mcpClaude Desktop (mcp-remote bridge)
For plans without custom connectors. In Claude Desktop: Settings → Desktop app → Developer → Edit Config, then merge the block below —
mcpServersmust be a top-level key (sibling ofpreferences), not nested inside it.JSON{ "mcpServers": { "unitpost": { "command": "npx", "args": [ "-y", "mcp-remote", "https://mcp.unitpost.com/mcp", "--header", "Authorization:${AUTH_HEADER}" ], "env": { "AUTH_HEADER": "Bearer pk_live_YOUR_KEY" } } } }Deliberately no space after
Authorization:inargs— Claude Desktop mangles spaces there; the value lives inenvinstead. Requires Node.js 18+. Ifnpxis not found, set"command"to your absolute npx path (e.g./opt/homebrew/opt/node@22/bin/npx). Save, then ⌘Q (Quit) Claude Desktop — closing the window is not enough.Codex CLI (TOML)
The CLI reads static config only. Edit `~/.codex/config.toml` (create it if needed).
TOML[mcp_servers.unitpost] url = "https://mcp.unitpost.com/mcp" [mcp_servers.unitpost.http_headers] Authorization = "Bearer pk_live_YOUR_KEY"VS Code (runtime-prompted key)
Create or edit `.vscode/mcp.json`. When VS Code prompts later, paste only the
pk_live_…value — notBearer(the config already adds it).JSON{ "inputs": [ { "id": "unitpost-key", "type": "promptString", "description": "Unitpost API key (pk_live_…)", "password": true } ], "servers": { "unitpost": { "type": "http", "url": "https://mcp.unitpost.com/mcp", "headers": { "Authorization": "Bearer ${input:unitpost-key}" } } } }Gemini CLI (static header)
Edit `~/.gemini/settings.json` (user-level) or `.gemini/settings.json` (project).
JSON{ "mcpServers": { "unitpost": { "httpUrl": "https://mcp.unitpost.com/mcp", "headers": { "Authorization": "Bearer pk_live_YOUR_KEY" } } } }Windsurf (static header)
Edit `~/.codeium/windsurf/mcp_config.json`. Windsurf uses
serverUrl(noturl) for remote HTTP.JSON{ "mcpServers": { "unitpost": { "serverUrl": "https://mcp.unitpost.com/mcp", "headers": { "Authorization": "Bearer pk_live_YOUR_KEY" } } } }OpenCode (static header)
Set
oauth: falseand pass the Bearer key.JSON{ "mcp": { "unitpost": { "type": "remote", "url": "https://mcp.unitpost.com/mcp", "oauth": false, "headers": { "Authorization": "Bearer pk_live_YOUR_KEY" } } } }Any other client (generic)
Configure a streamable-HTTP MCP server with the URL below, and send the header on every MCP request.
JSON{ "url": "https://mcp.unitpost.com/mcp", "headers": { "Authorization": "Bearer pk_live_YOUR_KEY" } }Verify with the key
Call a read tool (e.g. list domains). A 401 Invalid API key usually means a missing
Bearerprefix or a mistyped key — recreate the key and retry. Then send a test email from a verified domain and confirm it in Unitpost Activity.Don't see it? Fully quit and reopen the client — closing the window is often not enough — then check again.