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
- Add a video tool to Claude Sonnet 5.5 in the Messages API
Define a generate_video tool with input_schema, run it against Sume's /v1/videos when Claude Sonnet 5.5 returns tool_use, and return the job id as tool_result.
- C# HttpClient default timeout: 100 seconds, and how to set it
HttpClient.Timeout defaults to 100 seconds per request and throws TaskCanceledException. How to set it, and why slow API jobs need polling instead.
- How to delete my data from an AI tool, and what stays
Delete your data from an AI tool in two steps: delete the account, then send a deletion request for stored files. How it works on Sume, and its limits.
- Do AI companies sell your data? What to read in the policy
Some may; the privacy policy is where to check. How to read its sale and sharing sections, and what Sume's policy says it collects and shares.
Written by Sume