Skip to main content
Glama
Bitwarden MCP Server

Bitwarden MCP Server

Official
by bitwarden

Bitwarden MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with secure access to Bitwarden password manager functionality through two complementary interfaces:

  • Vault Management and CLI tools via Bitwarden CLI

  • Organization Administration via Bitwarden Public API

npm version

WARNING

This MCP server is designed exclusively for local use and must never be hosted publicly or exposed over a network.

When you grant an AI assistant access to this server, you are providing the ability to:

  • Read vault items including passwords, secure notes, and sensitive data

  • Create, modify, and delete vault items

  • Access organization secrets and administrative functions

  • Expose credentials and vault contents through AI responses

You are responsible for:

  • Ensuring this server runs only on your local machine or self-hosted environment

  • Understanding what data you're exposing to your AI assistant

  • Being aware that AI responses may inadvertently reveal sensitive information

  • Using appropriate AI providers (consider self-hosted or local LLMs for sensitive data)

  • Never sharing configuration files containing session tokens or API credentials

  • Monitoring logs for unexpected activity

Never:

  • Deploy this server to cloud hosting, containers, or public servers

  • Share your MCP configuration files with others

  • Use this server over untrusted networks

  • Grant access to untrusted AI clients or services

Use this tool responsibly and at your own risk.

What is MCP?

The Model Context Protocol is an open standard that enables AI assistants to securely interact with local tools and services. This server exposes Bitwarden's vault management and organization administration capabilities to MCP-compatible AI clients like Claude Desktop.

Related MCP server: Fireblocks MCP Server

Features

Vault Management and CLI tools (CLI)

  • Session Management: Unlock vault via native OS password dialog, lock vault, sync with server, check status

  • Item Operations: List, retrieve, create, edit, delete, restore vault items

    • Supports logins, secure notes, cards, and identities

    • Advanced filtering by URL, folder, collection, or trash status

  • Folder Management: Organize items with folders

  • Attachments: Upload, download, and manage file attachments

  • Password Tools: Generate secure passwords and retrieve TOTP codes

  • Bitwarden Send: Create and manage secure ephemeral shares (text/file)

  • Organization Items: Move items to organizations, manage collections

  • Device Approval: Approve or deny new device login requests

  • Member Management: Confirm organization member registrations

Organization Administration (API)

  • Collections: Create, update, delete, and manage collection permissions

  • Members: Invite, update roles, remove members, manage group assignments

  • Groups: Create role-based access groups and assign members

  • Policies: Configure and enforce organization security policies

  • Audit Logs: Retrieve organization event history

  • Subscriptions: View and update organization billing information

  • Bulk Import: Import users and groups from external systems

Quick Start

Prerequisites

For Vault Management and CLI tools:

  • Bitwarden CLI installed (ex. npm install -g @bitwarden/cli)

  • Node.js 22+

  • Bitwarden account

For Organization Administration:

  • Node.js 22+

  • Bitwarden Teams or Enterprise organization

  • Organization owner or admin permissions

Configuration

WARNING

The configuration files below will contain sensitive credentials that grant access to your Bitwarden vault. Keep these files secure, never commit them to version control, and never share them with others. Ensure your MCP client (e.g., Claude Desktop) is configured to run the server locally only.

Add to your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "bitwarden": {
      "command": "npx",
      "args": ["-y", "@bitwarden/mcp-server"],
      "env": {
        "BW_SESSION": "your-session-token-here"
      }
    }
  }
}

Get your session token:

bw login
bw unlock --raw

To enable organization administration features, add API credentials:

{
  "mcpServers": {
    "bitwarden": {
      "command": "npx",
      "args": ["-y", "@bitwarden/mcp-server"],
      "env": {
        "BW_SESSION": "your-session-token-here",
        "BW_CLIENT_ID": "organization.your-client-id",
        "BW_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Get organization API credentials:

  1. Go to your Bitwarden Web Vault

  2. Navigate to your organization → Settings → My Organization

  3. Scroll to "API Key" section

  4. Click "View API Key" and authenticate

Option 2: Locally Built and Referenced

Requires that this repository be checked out locally. Once that's done:

npm install
npm run build

Then reference the built dist/index.js file from Claude desktop:

{
  "mcpServers": {
    "bitwarden": {
      "command": "node",
      "args": ["local/path/to/mcp-server/dist/index.js"],
      "env": {
        "BW_SESSION": "your-session-token-here"
      }
    }
  }
}

Option 3: Other MCP Clients

Any MCP-compatible client can connect to this server via stdio transport. Refer to your client's documentation for configuration details.

Environment Variables

Variable

Required For

Description

Default

BW_SESSION

CLI operations

Session token from bw unlock --raw

-

BW_CLIENT_ID

API operations

Organization API client ID

-

BW_CLIENT_SECRET

API operations

Organization API client secret

-

BW_API_BASE_URL

API operations

Bitwarden API base URL

https://api.bitwarden.com

BW_IDENTITY_URL

API operations

OAuth2 identity server URL

https://identity.bitwarden.com

BW_ALLOWED_DIRECTORIES

File operations

Comma-separated list of allowed file directories. Required for file-based tools (e.g. create_file_send, create_attachment, get with object: "attachment"); when unset, all file operations are rejected.

-

BW_CLI_PATH

CLI operations

Absolute path to the bw executable or its JS entry point. Only needed when the CLI cannot be auto-located on PATH (e.g. it is not on PATH, or a non-standard global install layout).

auto-resolved from PATH

Note: For self-hosted Bitwarden instances, set BW_API_BASE_URL and BW_IDENTITY_URL to your server URLs.

Note: BW_CLIENT_ID and BW_CLIENT_SECRET are the environment variable names read by the MCP server. If you are using bw login --apikey in a startup script, the Bitwarden CLI reads BW_CLIENTID and BW_CLIENTSECRET (no underscores between words) for the same credentials. See the Bitwarden CLI documentation.

Usage Examples

Once configured, you can interact with Bitwarden through your AI assistant:

Vault:

  • "List all my login items"

  • "Get my credentials for github"

  • "Create a new secure note for my home WiFi information"

  • "Generate a 32-character password and save it for apple.com"

  • "Create a Send link for this file"

Organization Administration:

  • "List all members in my organization"

  • "Invite user@example.com as an organization admin"

  • "Create a 'Development Team' collection"

  • "Show me the last 100 audit log events"

  • "What security policies are enabled?"

Available Tools

Vault Management and CLI Tools

  • Session: lock, unlock, sync, status

  • Retrieval: list, get

  • Items: create_item, edit_item, delete, restore

  • Folders: create_folder, edit_folder

  • Attachments: create_attachment

  • Organizations: create_org_collection, edit_org_collection, edit_item_collections, move, confirm

  • Device Approval: device_approval_list, device_approval_approve, device_approval_approve_all, device_approval_deny, device_approval_deny_all

  • Send: create_text_send, create_file_send, list_send, get_send, edit_send, delete_send, remove_send_password

  • Utilities: generate

Organization Administration

  • Collections: list_org_collections, get_org_collection, update_org_collection, delete_org_collection

  • Members: list_org_members, get_org_member, invite_org_member, update_org_member, remove_org_member, reinvite_org_member, get_org_member_groups, update_org_member_groups

  • Groups: list_org_groups, get_org_group, create_org_group, update_org_group, delete_org_group, get_org_group_members, update_org_group_members

  • Policies: list_org_policies, get_org_policy, update_org_policy

  • Events: get_org_events

  • Subscriptions: get_org_subscription, update_org_subscription

  • Import: import_org_users_and_groups

Development

Setup

git clone https://github.com/bitwarden/mcp-server.git
cd mcp-server
npm install

Commands

npm run build        # Compile TypeScript
npm test             # Run test suite
npm run lint         # Check code style
npm run lint:fix     # Auto-fix linting issues
npm run inspect      # Test with MCP Inspector

Testing with MCP Inspector

The MCP Inspector provides an interactive testing environment:

npm run build
npm run inspect

This opens a web interface where you can:

  • Browse available tools

  • Test tool execution with custom inputs

  • View request/response payloads

  • Debug tool behavior

Best Practices

  • Store credentials securely (use system keychains or environment managers)

  • Rotate session tokens regularly

  • Review audit logs periodically for suspicious activity

  • Never commit credentials to version control

Testing

The project includes Jest unit tests covering validation, CLI commands, and core functionality.

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm test -- --coverage

# Run specific test file
npm test validation.spec.ts

# Run tests matching a pattern
npm test -- --testNamePattern="validation"

Debugging

Enable debug logging by setting environment variables:

export DEBUG=bitwarden:*
export NODE_ENV=development

Security Considerations

  • Never commit sensitive credentials (BW_SESSION, BW_CLIENT_ID, BW_CLIENT_SECRET)

  • Use environment variables for all sensitive configuration

  • Validate all inputs using Zod schemas (already implemented)

  • Test with non-production data when possible

  • Monitor API usage through your organization's audit logs

  • Understand the security and privacy impacts of exposing sensitive vault data to LLM and AI tools. Using a self-hosted or local LLM may be appropriate, for example.

Troubleshooting

CLI Issues

  • Vault is locked

    • Ask your AI assistant to run the unlock tool — the MCP server will open a native OS password dialog for you to enter your master password. The password is never sent through the MCP protocol or seen by the LLM.

    • On headless machines (no DISPLAY on Linux, no GUI session), the unlock tool will refuse to run. Use the manual fallback:

      bw unlock --raw
      # Copy the token and update BW_SESSION in your MCP config
  • Session key is invalid

    • Session tokens expire after inactivity

    • Ask your AI assistant to run the unlock tool to refresh the session in-place, or run bw unlock --raw manually and update your MCP configuration with the new token

Unlocking the vault interactively

The unlock tool lets your AI assistant prompt you for your master password without that password ever crossing the MCP channel.

  • The tool takes no input parameters. It cannot be invoked with a password argument.

  • When called, the server launches a native OS password dialog:

    • macOS: osascript secure input dialog

    • Linux: zenity --password (falls back to kdialog --password)

    • Windows: PowerShell WinForms password dialog (masked input)

  • The password is passed to bw unlock --raw via the --passwordenv flag with a randomized one-shot environment variable. It never appears in process arguments, in the MCP protocol, or in the LLM's context.

  • The LLM only ever sees "Vault unlocked successfully." or a sanitized failure message (e.g. "Invalid master password.", "Unlock cancelled.").

  • If you are in a non-interactive environment, the tool will refuse to run and return a fixed message directing you to the bw unlock --raw manual flow.

API Issues

  • Invalid client credentials

    • Verify BW_CLIENT_ID starts with organization.

    • Ensure BW_CLIENT_SECRET is correct

    • Check that API keys haven't been rotated in the Admin Console

  • 403 Forbidden

    • Verify you have organization owner or admin permissions

    • Some operations require specific roles (e.g., managing members)

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Available Tools

59 tools
confirmA

Confirm an invited organization member who has accepted their invitation

Inputs: memberId (required), organizationId (required).

create_attachmentB

Attach a file to an existing vault item

Inputs: itemId (required), filePath (required).

create_file_sendB

Create a new Bitwarden Send for securely sharing a file

Inputs: name (required), filePath (required), notes, password, +3 more.

create_folderB

Create a new folder in your vault

Inputs: name (required).

create_itemB

Create a new item (login, secure note, card, or identity) in your vault

Inputs: name (required), type (required), card, login, +4 more.

create_org_collectionC

Create a new organization collection

Inputs: name (required), organizationId (required), groups, externalId.

create_org_groupC

Create a group

Inputs: name (required), externalId, collections.

create_text_sendB

Create a new Bitwarden Send for securely sharing text

Inputs: name (required), text (required), notes, hidden, +4 more.

deleteC

Delete an item from your vault

Inputs: id (required), object (required), permanent.

delete_org_collectionC

Delete a collection

Inputs: collectionId (required).

delete_org_groupC

Delete a group

Inputs: groupId (required).

delete_sendC

Delete a Bitwarden Send

Inputs: id (required).

device_approval_approveB

Approve a pending device authorization request

Inputs: requestId (required), organizationId (required).

device_approval_approve_allB

Approve all current pending device authorization requests

Inputs: organizationId (required).

device_approval_denyB

Deny a pending device authorization request

Inputs: requestId (required), organizationId (required).

device_approval_deny_allB

Deny all pending device authorization requests

Inputs: organizationId (required).

device_approval_listA

List all pending device approval requests for an organization

Inputs: organizationId (required).

edit_folderC

Edit an existing folder in your vault

Inputs: id (required), name (required).

edit_itemC

Edit an existing item (login, secure note, card, or identity) in your vault

Inputs: id (required), card, name, login, +4 more.

edit_item_collectionsC

Edit which collections an item belongs to

Inputs: itemId (required), collectionIds (required), organizationId (required).

edit_org_collectionC

Edit an existing organization collection

Inputs: collectionId (required), organizationId (required), name, groups, +1 more.

edit_sendB

Edit an existing Bitwarden Send

Inputs: id (required), name, notes, disabled, +4 more.

generateB

Generate a secure password or passphrase

Inputs: words, length, number, special, +5 more.

getC

Get a specific item from your vault or organization

Inputs: id (required), object (required), itemid, output, +1 more.

get_org_collectionC

Retrieve a collection

Inputs: collectionId (required).

get_org_eventsC

List all events

Inputs: end (required), start (required), itemId, groupId, +4 more.

get_org_groupC

Retrieve a group

Inputs: groupId (required).

get_org_group_membersC

Retrieve a group's member ids

Inputs: groupId (required).

get_org_memberC

Retrieve a member

Inputs: memberId (required).

get_org_member_groupsB

Retrieve a member's group ids

Inputs: memberId (required).

get_org_policyC

Retrieve a policy

Inputs: policyType (required).

get_org_subscriptionA

Retrieve the subscription details for the current organization

Inputs: no named parameters.

get_sendB

Get details of a specific Bitwarden Send

Inputs: id (required).

import_org_users_and_groupsB

Import members and groups from an external system

Inputs: overwriteExisting (required), groups, members, largeImport.

invite_org_memberC

Create a member

Inputs: type (required), email (required), groups, externalId, +2 more.

listC

List items from your vault or organization

Inputs: type (required), url, trash, search, +3 more.

list_org_collectionsB

List all collections

Inputs: no named parameters.

list_org_groupsA

List all groups

Inputs: no named parameters.

list_org_membersB

List all members

Inputs: no named parameters.

list_org_policiesC

List all policies

Inputs: no named parameters.

list_sendB

List all Bitwarden Sends

Inputs: no named parameters.

lockC

Lock the vault

Inputs: no named parameters.

moveC

Move (share) a vault item to an organization (formerly the share command)

Inputs: itemId (required), collectionIds (required), organizationId (required).

reinvite_org_memberC

Re-invite a member

Inputs: memberId (required).

remove_org_memberC

Remove a member

Inputs: memberId (required).

remove_send_passwordB

Remove the access password from a Bitwarden Send

Inputs: id (required).

restoreC

Restore an item from trash

Inputs: id (required), object (required).

restore_org_memberB

Restore a previously revoked member

Inputs: memberId (required).

revoke_org_memberC

Revoke a member's access to an organization

Inputs: memberId (required).

statusB

Check the status of the Bitwarden CLI

Inputs: no named parameters.

syncB

Sync vault data from the Bitwarden server

Inputs: no named parameters.

unlockA

Unlock the Bitwarden vault. Takes no parameters. Prompts the user for their master password through a native OS dialog; the password is never exposed to the MCP protocol or the LLM. Not supported in headless or non-interactive environments — run "bw unlock --raw" manually and set BW_SESSION in that case.

Inputs: no named parameters.

update_org_collectionC

Update a collection

Inputs: collectionId (required), groups, externalId.

update_org_groupC

Update a group

Inputs: name (required), groupId (required), externalId, collections.

update_org_group_membersC

Update a group's members

Inputs: groupId (required), memberIds (required).

update_org_memberC

Update a member

Inputs: type (required), memberId (required), groups, externalId, +2 more.

update_org_member_groupsC

Update a member's groups

Inputs: groupIds (required), memberId (required).

update_org_policyC

Update a policy

Inputs: enabled (required), policyType (required), data.

update_org_subscriptionB

Update the organization's current subscription for Password Manager and/or Secrets Manager

Inputs: secretsManager, passwordManager.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 59 tools

    Disambiguation4/5

    Most tools have distinct purposes, but 'edit_org_collection' and 'update_org_collection' appear redundant, creating ambiguity. Otherwise, tools are well-separated by domain (items, folders, sends, org management).

    Naming Consistency4/5

    Tools generally follow a verb_noun snake_case pattern, but there are slight inconsistencies such as 'device_approval_approve' (redundant) and 'import_org_users_and_groups' (non-standard verb). Overall pattern holds.

    Tool Count4/5

    With 59 tools, the set is on the large side but covers the extensive functionality of Bitwarden (personal vault, sends, organization management, device approvals). The scope justifies the count, though it may be heavy for agents.

    Completeness4/5

    The tool set covers most CRUD operations for items, folders, sends, and organization entities. Notable gap: no 'delete_folder' tool exists. Otherwise, lifecycle support is strong, including status, sync, and import.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables interaction between LLMs and Obsidian vaults through the Model Context Protocol, supporting secure file operations, content management, and advanced search capabilities.
      4,244 npm
      714
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to securely interact with Fireblocks services through the Model Context Protocol, supporting transaction management, vault and exchange account queries, network connections, and workspace user management.
      69 npm
      10
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Bitwarden/Vaultwarden for password and secure note management, including creation, updating, deletion, and search of items and folders.
      1
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to search, create, and update password vault entries, manage folders and sharing permissions, while delivering secrets to a configured server-side handler.
      1
      -