MCP

Onboarding (mcp-init / mcp-token)

Getting a new MCP client connected to a Handoff registry.

How you connect depends on the kind of client. File-based clients (Cursor, Claude Code, Claude Desktop's manual config) read a .mcp.json; connector-based clients (claude.ai) authenticate themselves via the OAuth connector flow and need no local file at all.

1. Point at a registry

mcp-init needs a registry URL, pass --url, or set HANDOFF_CLOUD_URL / have it resolvable from an existing project config.

2. Run handoff-app mcp-init

Terminal
handoff-app mcp-init --url https://your-registry.example.com

This is one-step onboarding:

  • Signs you in if you aren't already, kicks off the device-code flow (opens a browser unless --browser=false).
  • Fetches DESIGN.md from the registry and writes it to the project root.
  • Writes/merges an handoff entry into .mcp.json:
.mcp.json
{
  "mcpServers": {
    "handoff": {
      "type": "http",
      "url": "https://your-registry.example.com/api/mcp",
      "headers": { "Authorization": "Bearer ${HANDOFF_MCP_TOKEN}" }
    }
  }
}
  • Upserts a managed "Design System" block into CLAUDE.md pointing your agent at DESIGN.md and the MCP server.

3. Set the token

By default the config references an env var (HANDOFF_MCP_TOKEN) rather than embedding the literal token, so .mcp.json is safe to commit:

Terminal
export HANDOFF_MCP_TOKEN=$(handoff-app mcp-token)

Prefer a fully self-contained local config? Pass --embed to mcp-init instead, it writes the literal token into .mcp.json and adds that file to .gitignore for you. Don't commit an embedded-token config.

4. Restart your client

Restart Cursor / Claude Code / Claude Desktop so it picks up the new .mcp.json.

Standalone mcp-token: once signed in, handoff-app mcp-token prints just the bearer token to stdout (nothing else), so it composes into scripts or other configs:

Terminal
handoff-app mcp-token

End-to-end (file-based clients)

handoff-app mcp-initexport HANDOFF_MCP_TOKEN=$(handoff-app mcp-token) → restart your client → ask it to look something up (e.g. "what are this design system's primary brand colors?") and confirm it calls handoff_get_tokens rather than guessing.

On this page