VaultBridge
Secret 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.
README
VaultBridge
Secret management for AI coding agents. Your secrets never enter the LLM context window.
The Problem
- 29 million secrets were leaked on GitHub in 2025 (GitGuardian State of Secrets Sprawl), up 25% year-over-year
- AI-assisted commits leak secrets at 2x the baseline rate — autocomplete and agent workflows bypass the muscle memory that keeps developers from pasting keys into code
- 24,000+ secrets found in MCP config files — the new
claude_desktop_config.jsonis the new.envcommitted to git - Every secret in the LLM context window is sent to the AI provider's servers — even if the model never prints it, it was transmitted and processed
VaultBridge is an MCP server that gives AI agents access to your secrets without ever exposing the values. The agent sees metadata (names, services, env var mappings). The actual values flow through a side channel directly to their targets.
How It Works
┌─── Your Machine ────────────────────────────────────────────┐
│ │
│ Claude Code / Cursor / Windsurf / AI Agent │
│ │ │
│ │ MCP Protocol (tool calls) │
│ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ VaultBridge MCP Server │ │
│ │ ● Returns metadata only (names, IDs, mappings) │ │
│ │ ● Secret values NEVER in tool responses │ │
│ └────────┬───────────────────────────┬────────────┘ │
│ │ │ │
│ MCP Tools Hook API (:9847) │
│ (search, inject, (capture, redact, │
│ manifest, status) check-value, redeem) │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Bitwarden CLI (bw / rbw) │ │
│ └────────────────────┬────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Vaultwarden / Bitwarden Cloud (encrypted) │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ Hooks: auto-capture · redact · leak-prevent │
└──────────────────────────────────────────────────────────────┘
Data flow: The agent calls vault_search and gets back names and IDs. When it needs a value, it calls vault_inject which writes directly to a .env file, clipboard, or template — the value never appears in the tool response. Hooks intercept secrets in shell output and file writes before they reach the LLM.
Quick Start
Prerequisites
- Runtime: Bun 1.0+ or Node.js 18+
- Vault CLI: Bitwarden CLI (
bw) or rbw - Vault backend: Vaultwarden (self-hosted) or Bitwarden cloud account
1. Install
Add to your Claude Code MCP config (~/.claude/settings.json):
{
"mcpServers": {
"vaultbridge": {
"command": "bun",
"args": ["run", "/path/to/vaultbridge-mcp-server/src/index.ts"],
"env": {
"BW_SESSION": "<your-bitwarden-session-key>",
"BW_URL": "https://vault.example.com"
}
}
}
}
2. Unlock your vault
# Bitwarden CLI
export BW_SESSION=$(bw unlock --raw)
# Or rbw
rbw unlock
3. Verify
Ask your agent: "Check vault status" — it will call vault_status and confirm the connection.
MCP Tools
| Tool | Description | Returns Values? |
|---|---|---|
vault_search |
Search secrets by name, service, project, environment | Never |
vault_store |
Store a new secret (generated passwords only via tool) | Never |
vault_inject |
Inject a secret into .env, clipboard, or template file | Never |
vault_resolve_env |
Populate .env from .env.example using vault lookups | Never |
vault_manifest |
Read project secret manifest (.vault-manifest.json) | Never |
vault_status |
Check vault connection and lock state | N/A |
Claude Code Hooks
VaultBridge ships with three hooks that form a defense-in-depth layer:
| Hook | Trigger | What It Does |
|---|---|---|
post-bash |
PostToolUse / Bash |
Scans shell output for secrets (pattern + entropy detection), auto-captures to vault, redacts from context |
pre-write |
PreToolUse / Write|Edit |
Blocks file writes containing detected secrets; suggests vault_inject instead |
session-start |
SessionStart |
Loads project manifest, pre-warms vault connection, registers env var mappings |
Hook configuration in .claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "curl -s http://127.0.0.1:9847/api/check-value -d '{\"value\":\"$TOOL_OUTPUT\"}' | jq -r '.should_block'"
}]
}
]
}
}
Configuration
| Environment Variable | Default | Description |
|---|---|---|
VAULTBRIDGE_TRANSPORT |
stdio |
Transport mode: stdio or http |
VAULTBRIDGE_PORT |
9847 |
Port for Hook API (and HTTP transport) |
VAULTBRIDGE_AUTH_TOKEN |
(generated) | Bearer token for HTTP endpoints |
VAULTBRIDGE_BACKEND |
bw |
Vault CLI backend: bw or rbw |
BW_SESSION |
— | Bitwarden session key (required for bw) |
BW_URL |
— | Vaultwarden/Bitwarden server URL |
See docs/configuration.md for the complete reference.
Security Model
What's protected
- Secret values never appear in MCP tool responses — the LLM cannot see them
- The Hook API runs on
127.0.0.1only in stdio mode — no network exposure - One-time redeem tokens expire in 10 seconds and are single-use
- Clipboard injection auto-clears after a configurable TTL (default 30s)
What's visible to the agent
- Secret metadata: names, IDs, service labels, project/environment tags, env var mappings
- Vault connection status (locked/unlocked, server URL, email)
- Injection confirmations (target type, file path — never the value)
Defense layers
- MCP layer — Tools return metadata only;
vault_injectwrites to targets via side channel - Hook layer —
post-bashscans output for secrets before the LLM sees it;pre-writeblocks file writes containing secrets - Vault layer — All secrets encrypted at rest in Vaultwarden/Bitwarden; accessed via CLI with session authentication
- Transport layer — HTTP mode requires Bearer token auth; stdio mode binds to localhost only
Comparison
vs Indie/Open-Source Projects
| Feature | VaultBridge | AgentSecrets | agent-secrets | phantom-secrets | claude-secrets |
|---|---|---|---|---|---|
| Values never reach LLM | Yes | Yes | No (leases expose) | Yes | Partial |
| Auto-capture from output | Yes | No | No | No | Yes |
| Leak prevention (block writes) | Yes | No | No | No | No |
| Uses existing password manager | Yes (Bitwarden) | No (own store) | No (age files) | No (OS keychain) | No (Fernet vault) |
| MCP server | Yes | Yes | No | Yes | No |
| Claude Code hooks | Yes | No | No | No | Partial |
| Team/workspace support | No | Yes | No | No | No |
| Session leases / TTL | No | No | Yes | No | Yes |
vs Enterprise Products
| Feature | VaultBridge | 1Password Unified | GitHub Secret Scanning | Bitwarden MCP |
|---|---|---|---|---|
| Auto-capture from shell output | Yes | No | No | No |
| Pre-LLM redaction (hooks) | Yes | No | No | No |
| Leak prevention on file write | Yes | No | Post-commit only | No |
| Metadata-only responses | Yes | No (returns values) | N/A | No (returns values) |
| Open source | Yes | No | Partial | Yes |
| Self-hostable vault | Yes | No | N/A | Yes |
| MCP native | Yes | No | No | Yes |
VaultBridge's niche: The only tool that combines Bitwarden integration + auto-capture + pre-LLM redaction + leak prevention in one system. AgentSecrets is the closest competitor but uses its own encrypted store and takes a network proxy approach instead of hooks.
Development
# Clone
git clone https://github.com/Code-for-100k/vaultbridge.git
cd vaultbridge
# Install dependencies
bun install
# Type check
bun run typecheck
# Run in stdio mode (local dev)
bun run start
# Run in HTTP mode
bun run start:http
# Build
bun run build
See CONTRIBUTING.md for the full development guide.
Architecture
VaultBridge operates as a 4-layer system:
- Agent Layer — Claude Code / Cursor makes MCP tool calls
- MCP Server Layer — Processes requests, enforces metadata-only responses
- Hook Layer — Intercepts secrets in shell output and file writes
- Vault Layer — Bitwarden CLI talks to encrypted storage
See docs/architecture.md for detailed diagrams and data flow documentation.
License
MIT - Copyright 2026 Code-for-100k Contributors
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。