Manage Secrets
MCPFirewall includes a local vault that encrypts all credentials with AES-256-GCM. Each secret has its own encryption nonce and a key derived from the master key using HKDF. Nothing is stored in plaintext.
Add a secret
Section titled “Add a secret”On the Vault page, select a vault (or use the Default vault) and click Add Secret. Enter a name and the secret value. The value is encrypted immediately and never written to disk in plaintext.
You can also create secrets during the MCP install flow. When a server needs an API key, the install modal prompts for it and saves it to the vault automatically.
Use secrets in server configs
Section titled “Use secrets in server configs”Secrets are referenced using the prefix:
$MCPFW_SECRET:secret_nameThe gateway resolves these references at runtime, injecting the decrypted value into the server’s environment. Your config files never contain raw credentials.
Named vaults
Section titled “Named vaults”Organize secrets into named vaults (like “Work”, “Personal”, “Testing”). All vaults use the same master encryption key. Vaults are purely organizational. Create them from the left panel on the Vault page, and move secrets between vaults as needed.
OAuth tokens
Section titled “OAuth tokens”Some MCP servers use OAuth for authentication. MCPFirewall handles the full flow:
- You click Authorize (during install or from the server card)
- A browser window opens for the provider’s login
- The token is stored encrypted in the vault
- The gateway injects the token into requests automatically
- Token refresh happens in the background when tokens expire
The Vault page shows each OAuth token with an expiry indicator: green (valid), yellow (expiring soon), red (expired). Click Re-authorize on an expired token to start a new flow.
Migrate plaintext credentials
Section titled “Migrate plaintext credentials”If you had MCP servers configured before installing MCPFirewall, their API keys might be sitting as plaintext environment variables in config files. MCPFirewall can detect and migrate these.
On the MCP Hub page, servers with plaintext credentials show a migration prompt. Click Migrate to:
- Store each credential in the vault
- Rewrite the config file to use
$MCPFW_SECRET:references - Back up the original config
Migration is safe to retry. If the vault write fails, the config file is not modified.
Back up your vault key
Section titled “Back up your vault key”The master key lives at ~/.mcpfw/vault.key. If you lose this file, your secrets cannot be decrypted.
Export a backup from Settings (click Export Key) or from the CLI:
mcpfw vault export-key --out ~/vault-key-backup.txtStore this somewhere safe and separate from your machine.
Transfer to another machine
Section titled “Transfer to another machine”To move your vault:
- Export the key:
mcpfw secrets export-key > key.txt - Copy
~/.mcpfw/mcpfw.dbandkey.txtto the new machine - Import the key:
mcpfw secrets import-key $(cat key.txt)
Both the database and the key are needed. The database holds the encrypted secrets, the key decrypts them.