n8n MCP custom headers with OAuth token refresh: Sume caution
n8n 2.40 keeps custom headers on MCP registry remotes through OAuth token refreshes. With Sume, do not add an API-key header on top of an OAuth bearer token.

n8n 2.40 (2026-09-15) made MCP registry remotes support custom headers that survive OAuth token refreshes. If you point one at Sume, pick a single credential: OAuth or an API key, not both. Sume's API rejects a request that carries both Authorization: Bearer and x-api-key with 401 unauthorized, so an x-api-key header that persists next to an OAuth bearer token is a setup to avoid.
What did n8n 2.40 change?
The n8n release notes for 2.40, dated 2026-09-15, say MCP registry remotes support custom headers that survive OAuth token refreshes. The same entry lists other changes to the AI Agent and HTTP Request nodes.
Why does a persistent header matter with Sume?
Sume's authentication page says a request carrying both Authorization: Bearer and x-api-key is rejected with 401 unauthorized and the message Send only one API key credential. Neither header wins. The page describes this for API keys on the Developer API; the MCP OAuth page says the two credentials are not interchangeable, so mixing an OAuth token with an API-key header is a setup to avoid.
| Connection type | Credential to send | Custom header? |
|---|---|---|
| OAuth to mcp.sume.com/mcp | The OAuth bearer token n8n manages | No API-key header |
| API-key remote MCP | Bearer or x-api-key, one of them | One key header only |
How do I set up the API-key case?
The OAuth page says API-key remote MCP sends either Authorization: Bearer $SUME_API_KEY or x-api-key: $SUME_API_KEY. Choose one, and do not also configure OAuth on the same server entry. Create keys in the dashboard and rotate them if they show up in logs.
Where does this fit with n8n's other Sume posts?
For the node itself, see n8n MCP client tool with Sume. The endpoint to use is https://mcp.sume.com/mcp, and the authentication docs have the header rule in full.
How do I keep the setup clean?
Decide per server entry. If it is an OAuth connection, let n8n manage the token and add only headers that have nothing to do with authentication. If it is an API-key connection, put the key in exactly one header and leave OAuth off.
The docs also warn that gateways and fetch wrappers that add their own Authorization header on top of a client that already sends x-api-key cause the rejection. A header that survives token refreshes is the same trap in a new place, so check the resulting request rather than the form fields.
What does a failure look like?
The response is a 401 unauthorized with the message Send only one API key credential. If you see that after adding a custom header in n8n, look for an x-api-key or Authorization header that duplicates the credential the connection already sends.
Remove the extra header and retry. The error is a header conflict rather than a bad key, so rotating the key will not help, though the docs do say to rotate keys that have appeared in logs.
Sources
Related posts
More in Developers
- Nano Banana 4K resolution API: the tier strings Sume accepts
Google says Nano Banana 2 spans 512px to 4K. On Sume you pick a tier with resolution: 512, 1K, 2K or 4K. The default, and why 4K can return 202.
- OpenAI Agents API remote MCP server: what to give it for Sume
OpenAI's Agents API takes MCP servers at session setup. Give it Sume's mcp.sume.com/mcp URL and an API key, and gate paid calls with idempotency_key.
- OpenAI Agents API webhooks: when the agent finishes, and Sume's
OpenAI says to stream output or use webhooks to learn when an agent finishes or needs input. Sume sends one agent.run.terminal webhook per run, never on cancel.
- Restrict API key creation: what OpenAI added, and Sume's key rules
OpenAI added admin controls to restrict API key creation on 2026-09-15. Sume keys are workspace-scoped with fixed scopes and rotate by replacement.
Written by Sume