claude mcp add --header Bearer: a Sume API key for CI runs

For unattended Claude Code runs, pass a Sume API key as a Bearer header. That session sees every tool, so cap spend and send idempotency keys.

4 min readSume
All posts

Claude Code adds a remote server with a token using claude mcp add --transport http <name> <url> --header "Authorization: Bearer ...". Sume accepts Authorization: Bearer <SUME_API_KEY> or an x-api-key header on https://mcp.sume.com/mcp. The catch is that an API-key session sees the full hosted tool set, write and paid tools included, so a CI job needs its own guardrails.

The command

Let the shell expand the key from your secret store so the literal never appears in the script:

claude mcp add --transport http sume https://mcp.sume.com/mcp \
  --header "Authorization: Bearer $SUME_API_KEY"
claude mcp list

What an API-key session can do

OAuth sessions are read-only unless the person grants mcp:write. API-key sessions skip that consent step. Writes and paid calls must still carry an idempotency_key, which is a dedup key and not an approval.

The spend limits are weaker than people expect. max_spend_usd on an MCP call is enforced only if you send it, and dry_run or generation_admission_preview only preview cost. Nothing on hosted MCP forces a cap.

When to use a different surface

If the CI job is really "run this task and give me the output", an Agent Completion has a required generation_spend_cap_usd with no default, so the call fails without a cap. It is asynchronous: you get a 202 receipt and poll it. Use MCP when an interactive agent needs to choose among tools, and Agent Completions when a backend just wants a result.

MCP API key versus Agent Completion for CI, read 2026-10-07
QuestionHosted MCP with API keyAgent Completion
Spend capOptional max_spend_usdRequired generation_spend_cap_usd
Retry safetyidempotency_key on writesIdempotency-Key header
ResultTool results in the sessionPoll the run receipt
StreamingPer MCP clientNot available

Sources

Related posts

More in Developers

All Developers posts

Written by Sume