Give an MCP server a token
The example agent reviewer has an MCP server, context7, that takes an API key in its input Authorization. Keep your key in the OS keychain and give it to that server only. The key stays out of your configuration file and your shell history. The agent must be in your store, so if you have not run it yet, fetch it with pandra pull github.com/pandra-io/pandra/examples/reviewer.
Store the key
Register a logical secret, a name for where the key lives, and type the key when Pandra asks; the input is hidden:
pandra config secret set context7-api-key --keychainOn Linux, the keychain needs GNOME Keyring or KWallet. To read the key from 1Password, a file, or a command instead, register it with another source flag of pandra config secret set, such as --1password or --file; secret stores lists them.
Give it to the server
Assign the secret to the server's input. The command also allows the server to receive it:
pandra config mcp set context7 \
--agent github.com/pandra-io/pandra/examples/reviewer \
--server context7 --secret Authorization=context7-api-keyAllowed MCP server "context7" of github.com/pandra-io/pandra/examples/reviewer to receive its inputs
Server: io.github.upstash/context7 4.7.0 (MCP Registry, registry.modelcontextprotocol.io)
URL: https://mcp.context7.com/mcp
Inputs: Authorization <- secret context7-api-key (keychain pandra/context7-api-key)A server that wants the whole header, such as GitHub's Bearer <token>, also takes --format Authorization='Bearer {}'. Your configuration file now says where the key is, never the key:
# ~/.config/pandra/config.toml (excerpt)
[secrets.context7-api-key]
keychain = { service = "pandra", account = "context7-api-key" }
[mcp.context7]
inputs.Authorization = { secret = "context7-api-key" }
[agents."github.com/pandra-io/pandra/examples/reviewer"]
mcp.context7 = "context7"The next run of the agent sends the key to context7, and pandra config show --agent github.com/pandra-io/pandra/examples/reviewer shows where each input of its servers comes from.