Bitwarden — Claude Code MCP server: features and setup
This MCP server for Claude Code connects an agent to a separate Bitwarden vault. It handles login records, 2FA codes, and passkeys.
MIT ★ 5 updated 2026-10-29
claude mcp add --env BITWARDEN_CLIENT_ID_FILE=<BITWARDEN_CLIENT_ID_FILE> --env BITWARDEN_CLIENT_SECRET_FILE=<BITWARDEN_CLIENT_SECRET_FILE> --env BITWARDEN_MASTER_PASSWORD_FILE=<BITWARDEN_MASTER_PASSWORD_FILE> --env BITWARDEN_SERVER=<BITWARDEN_SERVER> --transport stdio bitwarden -- npx -y @foreverworks/mcp-bitwardenWhat Bitwarden does
The server lets an agent find saved logins, create entries, change their details, and generate passwords. It can retrieve 2FA codes, keep secrets in secure notes, and move items between an organization’s collections.
The agent can check passwords against known breaches, register passkeys, and sign in through WebAuthn. Setup requires a dedicated Bitwarden account, its API key, and the account’s master password; put the key and password in files. Node 22.19 or newer is required. Each request runs Bitwarden’s CLI, so calls take seconds rather than milliseconds. The server does not change vault settings or delete items, apart from removing a passkey.
What it helps with
- find a saved login for a website
- create a password and update sign-in details
- retrieve a current 2FA code
- save a key as a secure note
- register a passkey or complete WebAuthn sign-in
Example prompts for the agent
- Find the saved logins for
example.com. - Save the key from
example-key.jsonas a secure note.
How to install Bitwarden
Platform CLI
claude mcp add --env BITWARDEN_CLIENT_ID_FILE=<BITWARDEN_CLIENT_ID_FILE> --env BITWARDEN_CLIENT_SECRET_FILE=<BITWARDEN_CLIENT_SECRET_FILE> --env BITWARDEN_MASTER_PASSWORD_FILE=<BITWARDEN_MASTER_PASSWORD_FILE> --env BITWARDEN_SERVER=<BITWARDEN_SERVER> --transport stdio bitwarden -- npx -y @foreverworks/mcp-bitwardenReplace <…> with your own values
Platform CLI
codex mcp add bitwarden --env BITWARDEN_CLIENT_ID_FILE=<BITWARDEN_CLIENT_ID_FILE> --env BITWARDEN_CLIENT_SECRET_FILE=<BITWARDEN_CLIENT_SECRET_FILE> --env BITWARDEN_MASTER_PASSWORD_FILE=<BITWARDEN_MASTER_PASSWORD_FILE> --env BITWARDEN_SERVER=<BITWARDEN_SERVER> -- npx -y @foreverworks/mcp-bitwardenReplace <…> with your own values
Config file
{
"mcpServers": {
"bitwarden": {
"command": "npx",
"args": [
"-y",
"@foreverworks/mcp-bitwarden"
],
"env": {
"BITWARDEN_CLIENT_ID_FILE": "<BITWARDEN_CLIENT_ID_FILE>",
"BITWARDEN_CLIENT_SECRET_FILE": "<BITWARDEN_CLIENT_SECRET_FILE>",
"BITWARDEN_MASTER_PASSWORD_FILE": "<BITWARDEN_MASTER_PASSWORD_FILE>",
"BITWARDEN_SERVER": "<BITWARDEN_SERVER>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"bitwarden": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@foreverworks/mcp-bitwarden"
],
"env": {
"BITWARDEN_CLIENT_ID_FILE": "<BITWARDEN_CLIENT_ID_FILE>",
"BITWARDEN_CLIENT_SECRET_FILE": "<BITWARDEN_CLIENT_SECRET_FILE>",
"BITWARDEN_MASTER_PASSWORD_FILE": "<BITWARDEN_MASTER_PASSWORD_FILE>",
"BITWARDEN_SERVER": "<BITWARDEN_SERVER>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e BITWARDEN_CLIENT_ID_FILE=<BITWARDEN_CLIENT_ID_FILE> -e BITWARDEN_CLIENT_SECRET_FILE=<BITWARDEN_CLIENT_SECRET_FILE> -e BITWARDEN_MASTER_PASSWORD_FILE=<BITWARDEN_MASTER_PASSWORD_FILE> -e BITWARDEN_SERVER=<BITWARDEN_SERVER> bitwarden npx -y @foreverworks/mcp-bitwardenReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Bitwarden
How do I install Bitwarden in Claude Code?
Run `claude mcp add bitwarden -e BITWARDEN_CLIENT_ID_FILE=<BITWARDEN_CLIENT_ID_FILE> -e BITWARDEN_CLIENT_SECRET_FILE=<BITWARDEN_CLIENT_SECRET_FILE> -e BITWARDEN_MASTER_PASSWORD_FILE=<BITWARDEN_MASTER_PASSWORD_FILE> -- npx -y @foreverworks/mcp-bitwarden`. Replace the placeholders with paths to the API key and master password files.
What does Bitwarden do?
It gives an agent access to a separate vault for login records, passwords, 2FA codes, secure notes, and passkeys used for WebAuthn sign-in.
What does Bitwarden require?
Use a dedicated Bitwarden account, its API key, and its master password, with the credentials stored in files. Node 22.19 or newer is also required; a paid plan is not.