Connect Huitzo to Claude Code, Cursor and other MCP clients

Connect Huitzo to Claude Code, Cursor and other MCP clients

Huitzo runs a Remote MCP server at https://huitzo.ai/mcp/. An MCP client that can send an Authorization header (Claude Code, Cursor, VS Code) connects, lists your tenant's pack commands as native tools, and invokes them inline. Authentication is a single Huitzo API key in the Authorization: Bearer header. For the five-minute path with Claude Code, see the MCP quickstart.

This guide is for using Huitzo from an external client. If you're building a pack that calls external MCP servers from inside a command, see MCP Pack Integration instead — that's the opposite direction.


At a glance

Endpoint https://huitzo.ai/mcp (the trailing-slash form /mcp/ is served identically)
Transport Streamable HTTP (the modern MCP transport)
Auth Authorization: Bearer sk-huitzo-...
Required scope commands:execute
Tools exposed Every pack command your tenant can see (public + your private + organization-shared)

Step 1 — Generate an API key

API keys are long-lived, scoped, and revocable — exactly what a connector config needs (JWTs expire and rotating them in a connector UI is painful).

Dashboard:

  1. Open the Huitzo dashboard and turn on Developer Mode (Settings → Developer). The API Keys card appears only then; see Accounts & Developer Mode.
  2. Settings → Developer → API Keys → Create API key.
  3. Name it something memorable (e.g. claude-code).
  4. Scope: tick commands:execute (the only scope an MCP client needs).
  5. Copy the key immediately — you won't see it again. It looks like sk-huitzo- followed by 64 hex characters.

Create MCP API Key on the same page does steps 2 to 4 in one click. With the Huitzo CLI, after huitzo login, huitzo mcp setup docs --write mints the key and writes it into Claude Code's config for you (see the CLI reference).

You can revoke any key at any time from the same Settings page; revocation is instant.


Step 2 — Connect a client

Claude Code, Cursor and VS Code

These clients send the key as a header. Claude Code and Cursor take this server entry under mcpServers in their JSON config:

{
  "huitzo": {
    "type": "http",
    "url": "https://huitzo.ai/mcp/",
    "headers": {
      "Authorization": "Bearer sk-huitzo-..."
    }
  }
}
Client Where the entry goes
Claude Code claude mcp add --transport http huitzo https://huitzo.ai/mcp/ --header "Authorization: Bearer sk-huitzo-..." (add --scope user for every project), or huitzo mcp setup docs --write, which names the entry huitzo-docs. Both store it in ~/.claude.json. To share it with a team, commit a .mcp.json at the repository root with "Bearer ${HUITZO_API_KEY}": Claude Code reads the key from each person's environment, so the file holds no key. Claude Code does not read MCP servers from .claude/settings.json.
Cursor Settings → MCP servers → Edit mcp.json
VS Code Its MCP server configuration, with the same URL and Authorization header

Restart the client after editing.

Verify the connection

In Claude Code, claude mcp list should show the entry you added (huitzo, or huitzo-docs if the CLI or the Hub's snippet made it) as connected, and /mcp inside a session lists its tools. In any client, the tool list holds one tool per pack command your tenant can see, plus huitzo_task_poll. If only huitzo_task_poll is listed, your tenant sees no commands yet (see Troubleshooting).

Claude.ai and Claude Desktop

Both add remote MCP servers through Settings → Connectors → Add custom connector, and Claude Desktop's claude_desktop_config.json takes only local servers. Anthropic's custom connector guide documents OAuth sign-in for these connectors, not a pasted API key. This endpoint has no OAuth sign-in; it authenticates with an API key header only. Connect from Claude Code, Cursor or VS Code.


Step 3 — Use it

Open a conversation in your client and prompt naturally:

"Use the huitzo claims-v1__analyze tool to score this incoming claim."

The client picks the right tool from the list, fills in the arguments using the JSON-Schema you declared in your pack, calls the Huitzo MCP endpoint, and gets the result back inline.

Long-running commands

Most pack commands run synchronously on the fast queue — tools/call returns the result inline. A small number of commands declared with queue: medium or queue: long in the pack manifest dispatch to a background worker. For those, the MCP server returns a pending envelope instead of a result:

{
  "pending": true,
  "task_id": "celery-abc-...",
  "queue": "medium",
  "message": "Command queued on the medium pool. Call the 'huitzo_task_poll' tool with task_id='celery-abc-...' for the result."
}

The model in front of the MCP client sees the message and can either tell the user to come back, or — for clients that support follow-up tool calls — call the huitzo_task_poll tool with that task_id. An MCP client has no way to make a raw HTTP request, so huitzo_task_poll (not GET /api/v1/tasks/{task_id}) is how polling actually works from inside a conversation.

Tool naming

Huitzo command namespaces look like @scope/pack/command, but MCP tool names are restricted to [a-zA-Z0-9_-]+. The MCP server maps deterministically:

@huitzo/demo/echo        ↔  huitzo__demo__echo
@claims-v1/scorecard/run ↔  claims-v1__scorecard__run

Round-trip: split on __, prepend @. No information is lost.

One tool name is reserved outside this mapping: huitzo_task_poll, always listed alongside your tenant's commands. Takes a single task_id argument and returns the task's status object — status, result, error, and UTC timestamps — not the bare inline shape a synchronous command returns. See Result shape for the exact contract.


Scope of access

A connected client sees and can invoke:

  • Every public pack command on Huitzo.
  • Every command in your tenant's private packs.
  • Every command in packs your tenant has been granted access to via an organization share.

It cannot:

  • See or call commands in other tenants' private packs.
  • Bypass the pack's declared HTTP allowlists, secret scopes, or DB allowlists.
  • Run with elevated privileges — API-key-authenticated requests run as member/free regardless of the issuing user's role, exactly like every other API-key-authenticated call.

Tenant isolation is enforced by PostgreSQL RLS on the same path the dashboard and CLI use, so the threat model is identical.


Troubleshooting

Symptom Cause Fix
401 Authentication required No Authorization header Add the Bearer header in your client config
401 ... requires API-key authentication Sent a JWT or cookie instead of an API key Generate an API key and use it as the Bearer token
401 Invalid or revoked API key Key was revoked or never existed Generate a new key in Settings → Developer → API Keys
403 ... missing 'commands:execute' scope Key authenticated but lacks the required scope Generate a new key with the commands:execute scope
Only huitzo_task_poll is listed Tenant has no visible commands Publish a pack first (huitzo pack publish) or join an org with shared packs
Tool result has "type": "insufficient_credits" The account has too few credits for the call; the result names required and available Add credits, then retry. See Insufficient Credits Error
Tool result has "type": "inline_capacity_exceeded" Too many of your commands (or of this server's) are running at once; nothing ran and nothing was counted Retry after the retry_after seconds in the result. See Inline command capacity
Command not available in this deployment The pack is not visible to you, or it provides no such command Check the pack is installed for your tenant and the command name is right. Just after a publish you may instead get the retryable pack_build_not_ready (or, on a busy server, isolation_capacity_exceeded): retry after 5 seconds. If pack_build_not_ready keeps coming back for more than a few minutes, tell your operator: the build never reached this server
Tool result has "type": "pack_build_unavailable" The pack version is published and on the server, but it cannot start there (retryable is false) Do not retry in a loop: tell your operator. See Execute Command
Input validation error Args don't match the pack's inputSchema Inspect the schema on the tool definition; fix the call
Response says "pending": true with a task_id Command runs on the medium/long queue and dispatches asynchronously Call the huitzo_task_poll tool with that task_id to retrieve the result
Tool result JSON has "type": "QuotaExceeded" / "code": "tenant_quota_exceeded" Tenant hit its monthly_command_cap — MCP calls count against the same cap as REST (a 409 on the REST API for the identical condition; MCP has no HTTP status to carry it, so it's in the tool result body instead) Wait for the trailing-30-day window to roll off usage, or raise the quota in the admin console

Self-hosting

If you run Huitzo on your own infrastructure, the MCP endpoint lives at the same path: https://<your-host>/mcp/. Point the client there. Auth, RLS, and tool surface are identical to the hosted offering.


See also