---
title: "Claude Code"
description: "Connect Claude Code to Unitpost with OAuth — add the URL, authenticate from /mcp, approve in the browser."
url: https://www.unitpost.com/guides/mcp/claude-code
section: MCP
updated: 2026-08-28
---
# Claude Code

## Connection settings

- **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, …)

## Claude Code

> Connect Claude Code to Unitpost with OAuth — add the URL, authenticate from /mcp, approve in the browser.

Add the server URL, then authenticate from the in-session MCP panel. The browser opens at the Authenticate step, not at add time. API keys still work as a fallback.

### 1. Add the server

Run once. This only saves the URL — no browser opens yet.

```bash
claude mcp add --transport http unitpost https://mcp.unitpost.com/mcp
```

> Use `-s user` to install for every project. `claude mcp list` now shows unitpost as `! Needs authentication` — that is expected.

### 2. Authenticate with OAuth (recommended)

Start a Claude Code session, run `/mcp`, select unitpost, and choose Authenticate. Your browser opens to Unitpost — pick a workspace, approve the scopes, and you're connected. No key to copy. Your client opens Unitpost in the browser — pick a workspace, approve the scopes, and you're connected. Tokens refresh automatically.

> If the browser doesn't open automatically, copy the URL shown in the terminal and open it manually. Tokens refresh automatically; if auth ever lapses, repeat this step.

### 3. Verify

Run `claude mcp list` (or `/mcp` in a session). unitpost should show connected with its tools listed — no `! Needs authentication` flag.

> Don't see it? Fully quit and reopen the client — closing the window is often not enough — then check again.

### 4. Send a test

Ask Claude to send an email from a verified domain and confirm it in Unitpost Activity.

## Related

- [Claude Desktop](https://www.unitpost.com/guides/mcp/claude-desktop): Connect with OAuth via Add custom connector — approve in the browser. API-key bridge as fallback.
- [Codex](https://www.unitpost.com/guides/mcp/codex): Connect ChatGPT/Codex with OAuth in the browser. Codex CLI takes a static key instead.
- [GitHub Copilot](https://www.unitpost.com/guides/mcp/copilot): Connect VS Code agent mode to Unitpost with OAuth — approve in the browser. API key as fallback.
