claude -p with --mcp-config: run Sume video tools from a script
Use claude --bare -p with --mcp-config and --allowedTools to call Sume's hosted MCP tools in CI; read mcp_server_errors so an unloaded server fails the job.

To run Sume's video tools from a script, use claude --bare -p with --mcp-config pointing at a JSON file that names https://mcp.sume.com/mcp, and --allowedTools to pre-approve the tools the run may call. Use an API key, because a non-interactive run cannot complete an OAuth browser sign-in, and check the mcp_servers status in the init event so a server that failed to load stops the job.
The flags come from Claude Code's headless page, read 2026-09-29. The key behavior comes from Sume's MCP OAuth and API keys docs.
What do the headless docs say about MCP?
Three facts matter for a script.
| Topic | Behavior |
|---|---|
| --bare | Skips auto-discovery of MCP servers, hooks and CLAUDE.md; load servers with --mcp-config |
| --mcp-config | Takes a file or JSON; -p waits for pending servers up to MCP_TIMEOUT, 30 s by default |
| Skipped entries | A url entry with no type is skipped; the init event lists it in mcp_server_errors |
What does the config file contain?
Give the entry an explicit type, since the docs say an entry with a url and no type is skipped. The key travels as a header; keep the file out of version control or generate it in the job from a secret.
{
"mcpServers": {
"sume": {
"type": "http",
"url": "https://mcp.sume.com/mcp",
"headers": { "x-api-key": "REPLACE_WITH_SUME_API_KEY" }
}
}
}What is the command?
MCP tools are named mcp__<server>__<tool>. Allow only the read-only checks first; add paid tools once dry_run is part of the prompt.
claude --bare -p "Call mcp_health on Sume and report the auth source." \
--mcp-config ./sume-mcp.json \
--allowedTools "mcp__sume__mcp_health,mcp__sume__tools_list" \
--output-format jsonHow do I keep an unattended run from overspending?
Pre-approving a paid tool removes the prompt, so the limits have to be in the request. Tell the run to send dry_run=true first and to pass max_spend_usd and an idempotency_key on every paid call. Claude Code's JSON output also reports total_cost_usd, but that is a client-side estimate of model usage, not the Sume bill.
For a video wait that outlasts one call, the run should repeat jobs_wait on the same job ids after wait_slice_expired and not create a new job.
Sources
Related posts
More in Developers
- Claude Code hooks not firing on an MCP tool: 6 causes
A PreToolUse hook that never fires on an MCP tool usually has a matcher problem: a bare server name, a plugin's scoped name, or a missing .*. Fixes for Sume.
- Claude Code managed-mcp.json exclusive: allow the Sume server
An exclusive managed-mcp.json fixes the MCP servers Claude Code may use. What to put in it for Sume's hosted server, and what Claude Code 2.1.282 added.
- Claude Code MCP progress notifications on a background call: Sume
Claude Code 2.1.283 fixed MCP progress notifications dropped on background calls. Sume's docs describe bounded jobs_wait slices instead of a progress stream.
- Claude Code mcp_tool hook on PreToolUse for a spend check
Claude Code 2.1.282 makes mcp_tool hooks on blocking events wait for their MCP server. With Sume, the check to run there is a dry_run cost preview.
Written by Sume