Claude Code .mcp.json project scope: keep your Sume API key out of git
Project scope writes .mcp.json for your team via version control. Never put a Sume key in its header; use OAuth, or a local-scope server, for the credential.

Do not put a Sume API key in a project-scope .mcp.json. Claude Code's docs say project-scope servers are stored in .mcp.json in the project root and shared with the team through version control. A key typed into a header there is a key in your repository history. Share the server definition, and keep the credential somewhere that does not travel.
The three scopes
| Scope | Loads in | Shared with team | Stored in | Sume key here? |
|---|---|---|---|---|
| Local (default) | Current project only | No | ~/.claude.json | Acceptable; the key sits in a config file on disk |
| Project | Current project only | Yes, via version control | .mcp.json in the project root | No |
| User | All your projects | No | ~/.claude.json | Acceptable; the key sits in a config file on disk |
Share the server, not the secret
Commit the definition with no credential:
A quick audit helps: search your repository and its history for the header name you used, and look at pull request diffs that touch .mcp.json. Teams often add a server in project scope for convenience and only later notice that a header line carried a live token. Add a pre-commit check that blocks Authorization strings in that file.
claude mcp add --transport http --scope project sume https://mcp.sume.com/mcpWhy OAuth helps here
Sume's hosted endpoint supports OAuth, so each teammate runs /mcp and signs in on Sume's consent page. Read is locked on, and Write is off until the person turns it on. Claude Code's docs say authentication tokens are stored securely and refreshed automatically, and that Clear authentication in the /mcp menu revokes access. Sume's access token lasts one hour and is not refreshed by Sume, so expect a fresh sign-in about hourly during long sessions.
This also means no teammate ever needs the account's API key just to read tools, check balance or inspect jobs.
When you do need a key
Automation that cannot open a browser, such as CI, needs an API key. Sume accepts Authorization: Bearer or x-api-key, but never both. The docs show the --header option for a bearer token, so the key lands in a config file. Put that server in local or user scope on the machine that runs the job, never in the committed file, and scope the key narrowly: API-key sessions see the full tool set, and paid calls need an idempotency_key, with max_spend_usd available as a per-call ceiling.
If a key ever lands in git, rotate it in the Sume dashboard first and clean history second. Rotation is the step that actually ends the exposure.
Because local scope is the default, a plain claude mcp add without --scope keeps the server private to you, which is the safer habit when a credential is involved.
Sources
More in Developers
- Claude Code tool.check ceiling and agentId: gate paid Sume tool calls
Claude Code 2.1.290 adds ceiling and agentId to tool.check, so a hook can tell subagents apart. Pair it with Sume's dry_run and max_spend_usd on paid tools.
- CloudEvents envelope for a Sume run webhook: field mapping
Map Sume's agent.run.terminal webhook to CloudEvents 1.0: request_id to id, event to type, created_at to time, with a runnable Python wrapper.
- Cloudflare Quick Tunnel --allowed-mail: do Sume webhooks get through?
Cloudflare's --allowed-mail gate asks visitors for an email PIN, which a Sume webhook POST cannot answer. Test with an open tunnel plus a signature check.
- AGENTS.md rules for a coding agent that calls Sume over hosted MCP
Six AGENTS.md lines that stop a coding agent double-billing Sume video jobs: idempotency_key, jobs_wait slices, dry_run, plus a CI lint script.
Written by Sume