Keep your vault key out of the chat with an MCP connection header
The MCP server now reads a custom vault key from an X-Secret-Key header on the connection. Set it once in your client's server entry, and reveal_key, add_key and update_key use it on every call.
Until now, an agent had to pass the vault key as the vault_key tool argument. That meant you typed it into the chat, and it stayed in the conversation history. A key sent as a connection header goes from your client to the server without passing through the model.
Read the key from an environment variable or a prompt so it stays out of the config file:
- Cursor (
.cursor/mcp.json):"headers": { "X-Secret-Key": "${env:APIVAULT_KEY}" } - Claude Code (
.mcp.json):"headers": { "X-Secret-Key": "${APIVAULT_KEY}" } - VS Code (
.vscode/mcp.json): apromptStringinput with"password": true, referenced as${input:...} - Claude.ai and Claude for Desktop: add a request header named
x-secret-keywhen you add the custom connector (request headers are in beta for some organizations)
When the header is set, any vault_key argument is ignored. If a project needs a vault key and none is configured, the tools now tell the agent to ask you to add the header instead of asking for the key in the chat. A wrong header key returns INVALID_VAULT_KEY and still counts toward the vault key attempt limit.
Clients that can't add headers to a remote server, such as ChatGPT, can still pass vault_key as before.
Learn more in the MCP client setup guide.