bws-secret-delivery-mcp
Enables interaction with Bitwarden Secrets Manager, providing tools to list projects and secrets metadata, and deliver secret values to approved local files, including raw env file generation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bws-secret-delivery-mcpWrite the API_TOKEN secret to /srv/my-app/.secrets/token"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
bws-secret-delivery-mcp
A deliberately narrow Model Context Protocol server for Bitwarden Secrets Manager. It uses Bitwarden's official bws CLI to resolve secrets and deliver them directly to approved local files without returning secret values to the MCP client or model.
This community project is not affiliated with or endorsed by Bitwarden, Inc.
Why this exists
General-purpose Bitwarden/BWS MCP servers are useful when an agent genuinely needs to see or manage secrets. Infrastructure automation often needs a different boundary: the agent should be able to say which secret goes to which approved consumer file without receiving the secret itself.
bws-secret-delivery-mcp intentionally does less:
metadata-only project and secret discovery;
direct secret-to-file delivery;
complete raw env-file generation from selected secrets;
no plaintext secret retrieval;
no arbitrary command execution;
no creation, editing or deletion of Bitwarden secrets or projects.
Related MCP server: VaultBridge
Tool surface
Tool | Behavior |
| Verify local configuration and authenticated BSM access. |
| List project metadata. |
| List secret metadata; values and notes are omitted. |
| Atomically write one secret value to an approved file. |
| Atomically write a complete raw |
There is intentionally no get_secret, run, create, edit, or delete tool.
Requirements
Python 3.12+
Bitwarden Secrets Manager CLI (
bws)A dedicated Bitwarden Machine Account with access only to the projects the MCP server needs
An MCP client that supports stdio servers
Install bws using Bitwarden's official installation instructions.
Configuration
The server is configured with environment variables supplied by the MCP host:
Variable | Required | Default | Meaning |
| yes | - | Private file containing one Machine Account access token. Must have no group/other permissions. |
| yes | - |
|
| no |
| Path or command name for the official |
| no | Bitwarden default | Optional Bitwarden server URL passed to |
| no |
| CLI timeout, maximum 120 seconds. |
| no |
| Mode for new output files. Execute/world permissions are rejected. Existing file mode and ownership are preserved. |
Example MCP registration:
{
"mcpServers": {
"bws-secret-delivery": {
"command": "uv",
"args": [
"run",
"--frozen",
"--directory",
"/opt/bws-secret-delivery-mcp",
"bws-secret-delivery-mcp"
],
"env": {
"BWS_ACCESS_TOKEN_FILE": "/run/secrets/bws-machine-token",
"BWS_ALLOWED_OUTPUT_DIRS": "/srv/app-a/.secrets:/srv/app-b/.secrets"
}
}
}
}Keep allowed output roots narrow. A dedicated consumer secret directory is safer than allowing an entire application or stack tree.
Raw env files
bws_secret_write_raw_env_file writes one complete file in deterministic key order. Values are emitted exactly after KEY=. Values containing NUL, LF or CR are rejected because the format is intentionally line-oriented.
For Docker Compose 2.30+ use the file with format: raw so Compose does not interpret $, quotes or other characters in secret values:
env_file:
- path: ./.secrets/runtime.env
format: rawExample tool input:
{
"target_path": "/srv/my-app/.secrets/runtime.env",
"secrets": {
"DATABASE_PASSWORD": "database-password",
"API_TOKEN": "2e71f52b-0000-0000-0000-000000000000"
}
}Each mapping value is either an exact Bitwarden secret key or a secret UUID. If a key is ambiguous, supply project_id or use a UUID.
File-safety behavior
target_pathmust be absolute.Its resolved parent must remain inside a configured output root.
Existing symlinks and non-regular target files are rejected.
Existing targets with permissions for
otherare rejected.Writes use a temporary file in the same directory,
fsync, atomicos.replace(), then a parent-directoryfsync.Existing mode and ownership are preserved when possible.
MCP responses contain target metadata and secret identifiers, never secret values or value lengths.
Development
python -m venv .venv
. .venv/bin/activate
pip install -e '.[test]'
pytestScope
This server is for interactive/operator-driven secret delivery. It is not intended to replace declarative secret renderers, deployment orchestration, Kubernetes secret operators, or a full Bitwarden administration client.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceEnables secure management of agent-scoped secrets in HashiCorp Vault through MCP protocol. Provides per-agent namespacing, multiple authentication methods (API key, JWT, mTLS), and optional encryption/decryption capabilities with built-in rate limiting.3
- Alicense-qualityDmaintenanceSecret management MCP server for AI coding agents that prevents secrets from entering the LLM context window by returning metadata only and using side-channel injection. Integrates with Bitwarden and offers hooks for auto-capture and leak prevention.1MIT
- AlicenseBqualityCmaintenanceEnables AI agents to manage secrets and credentials from a secure vault via MCP tools over stdio.7MIT
- AlicenseAqualityBmaintenanceAn MCP server for using Bitwarden Secrets Manager as durable credential storage for agent workflows, enabling secure secret storage, retrieval, and injection into trusted executables.7MIT
Related MCP Connectors
Encrypted secret store and rotation for autonomous agent credentials
Issue, rotate and revoke scoped API-key passes for 25+ providers — the agent never sees a real key
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/X1pheR/bws-secret-delivery-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server