vaultgate

io.github.adamrowles1996由 GitHub 帳號 adamrowles1996 發布v0.1.0-rc.10更新於 Oct 26, 2026

Self-hosted remote MCP server for Bitwarden and Vaultwarden with OAuth 2.1; agents hold tokens only

已驗證Streamable HTTP可網頁執行資料庫雲端與基礎設施安全與監控

概覽

AI 產生的概覽

自架設的遠端 MCP 伺服器,透過 OAuth 2.1 讓託管型 AI 代理在不看到憑證的情況下使用 Bitwarden 或 Vaultwarden 中的憑證。

可以做什麼
  • 搜尋保險庫項目、讀取中繼資料、每次呼叫只揭露一個密鑰欄位、產生密碼,並可在允許時建立或更新項目
  • 列出已授權的目標並對其執行具型別的操作:HTTP 請求(含 Microsoft Graph)、SQL 查詢與語句、SSH 與 WinRM 指令
  • 透過 Semble 連線在私有 GitHub 儲存庫中搜尋程式碼、尋找相關程式碼並讀取檔案
  • 管理各用戶端的同意、作用域、授權與撤銷,並記錄每次工具呼叫、登入與權杖事件的稽核軌跡
適用情境
當 Claude、Claude Code、Codex 等託管型代理需要用存放在 Bitwarden 或 Vaultwarden 保險庫中的憑證操作外部系統,且希望密鑰值不進入模型上下文與對話紀錄時適用。適合願意自行執行並以 HTTPS 對外提供服務的維運人員。
執行需求
需要一台自己掌控的主機,安裝 Docker Engine 與 Compose 外掛(或在 Debian/Ubuntu 虛擬機上使用 install.sh)、一個指向它的 DNS 名稱,以及可從公網存取的 80 與 443 埠;TLS 必須在其前端終止。需設定 VAULTGATE_DOMAIN、VAULTGATE_PUBLIC_URL 與 VAULTGATE_VERSION,建立密鑰檔案,再以伺服器位址、API 金鑰用戶端 ID 與密鑰、主密碼連接保險庫。代理連線到 /mcp 端點。
安裝前請注意
保險庫連線資訊(Bitwarden API 金鑰與主密碼)以 VAULTGATE_SECRET_KEY 加密保存,該密鑰檔案必須妥善保護。揭露工具會回傳真實密鑰值,每次一個欄位;寫入作用域預設關閉,但開啟後可建立或更新項目。動作層預設關閉、需主動啟用,啟用後代理可在你定義的目標上執行 HTTP 請求、SQL、SSH 與 WinRM 指令,因此目標政策與允許清單相當重要。逐次呼叫的寫入確認已取消,改由代理用戶端負責核准。專案目前為候選發行版本。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 vaultgate,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

vaultgate

[CI] [CodeQL] [OpenSSF Scorecard] [License: Apache-2.0]

A self-hosted, remote MCP server that lets hosted AI agents such as Claude, Claude Cowork, Claude Code and Codex use your credentials without ever seeing them. The credentials stay in your Bitwarden (or Vaultwarden) vault. vaultgate uses them on the agent's behalf against systems you define (an HTTP API, Microsoft Graph, a SQL Server or PostgreSQL database, an SSH or WinRM host, a GitHub repository searched with Semble) under your policy, and hands back only the result. It is its own OAuth 2.1 authorization server, so the agent holds a short-lived, scoped, revocable token and nothing else.

Status: release candidate. Milestones M1 to M7 are merged: configuration, SQLite store, operator identity with TOTP, the OAuth 2.1 authorization server, the MCP tool surface, the managed bw serve backend, the audit trail, packaging and the Azure template. M8 (hardening and compatibility evidence) is in progress. The actions layer, opt-in and off by default, has landed through M14: M9 the engine, the operator pages and the http connector, M10 the Microsoft Graph credential adapter, M11 sql, M12 ssh, M13 winrm, and M14 the policy-form validation messages, the call-history and writes views and grant management from the connected-clients list. M16 adds the code connector: Semble code search over private GitHub repositories, with its sidecar (guide). An http destination may pin its certificate or trust a private certificate authority, and the oauth2 credential mode obtains tokens from any OAuth 2.0 token endpoint (guide). vaultgate's own per-call write confirmation is withdrawn: approval belongs to the agent's client. The opt-in credential relay serves bw serve's read API to programs on tagged Tailscale nodes (guide). browser is M15; see docs/PLAN.md.

Why

A credential an agent can read ends up in the transcript. Once an agent reveals a password in order to use it, the value sits in the model's context, in the chat transcript, in the client's logs and on whatever command line the agent builds, and revoking the agent does not take it back. vaultgate is built so that the agent never needs the value:

  • Use, don't read. With the actions layer enabled (guide, spec 13 and 13a, ADR 0007), an agent names a target you defined and describes an operation: an HTTP request, a SQL query or statement, a command on an SSH or WinRM host, a Semble search of a GitHub repository. vaultgate fetches the credential from the vault, connects to the pinned destination, runs the operation inside your policy, scrubs every injected value from the result and returns what is left. An agent never supplies a host, a URL base, a database name or a credential; its arguments change what runs, never where or as whom.
  • Writes are opt-in twice, and approved where you work. A write needs its own scope at consent and a target policy that allows it. Approving each call is the agent's client's job — Claude Code, for one, asks before it runs a tool its permissions do not allow — and the console lists every call that changed something.
  • One audited door for the rare value that must be read. The vault tools return metadata. A single tool returns a secret value, one field of one item per call, behind its own scope, with every call audited.
  • Nothing runs on the vaultgate host. No tool runs whatever an agent sends wherever it likes: ssh_run and winrm_run run one command on one configured host under your allowlist (a target that accepts any command needs both its own flag and the deployment's consent), and every operation executes at its target.
  • The agent holds a token and nothing else. The master password and API key live only in the vaultgate process on your host, encrypted under your secret key once you connect the vault on the console's Vault page.
  • Standards as written. OAuth 2.1, PKCE, RFC 9728 / 8414 / 8707 / 7591 / 7009 / 9207 and Client ID Metadata Documents, per the MCP authorization specification (2026-07-28).
  • Any Bitwarden. bitwarden.com, bitwarden.eu, self-hosted Bitwarden and Vaultwarden.
  • Boring to operate. One process, one SQLite file, structured logs, health probes, an audit trail. docker compose up is a complete installation.

Compared with other Bitwarden MCP servers

Hosted agents reach MCP servers over HTTPS and cannot run a process next to your vault, and the other Bitwarden MCP servers are built for exactly that local process:

ServerWhere it runsWho holds the master password / API keyClient authorizationConsent and scopesRevocationAudit trailUsing a credential without seeing it
Official bitwarden/mcp-serverLocal, stdio; its README says it must never be hosted publiclyYour machine: the bw CLI session (BW_SESSION) in the client's configuration, or an OS password dialogNone; whoever launches the processNone; every tool is available to the launching clientLock the vault or end the bw sessionNot describedNot described
warden-mcp, remote modeA long-running HTTP service you hostThe client, which sends them as X-BW-Password, X-BW-ClientId and X-BW-ClientSecret headers on every callNone built in ("no built-in authentication layer in v1")None; READONLY and NOREVEAL switches apply to every client alikeRotate the Bitwarden credentialsNot describedNot described
Typical community servers, e.g. vaultwarden-mcp, bitwarden-mcp-serverLocal stdio, or a plain HTTP portThe server process, from environment variables holding the e-mail address and master passwordNoneNoneRotate the Bitwarden credentialsNot describedNot described
vaultgateYour host, reachable over HTTPS by hosted agentsThe vaultgate process only; the agent holds an opaque tokenBuilt-in OAuth 2.1 authorization server: operator login with TOTP, PKCE, RFC 9728 / 8414 / 8707 / 7591 / 7009 / 9207, Client ID Metadata DocumentsPer-client consent page; vault:read, vault:reveal, vault:generate, vault:write (off by default); actions:* scopes for each enabled connectorPer client or per token from the console's Agents page; refresh tokens rotate and a replay revokes the familyEvery tool call, login, consent, token issue, refresh and revocation, exportableTyped actions at targets you define: http (with Microsoft Graph), sql, ssh, winrm, code (Semble)

"Not described" means the project's README does not document one. Dated verification notes with links, and when the official stdio server is the better choice: docs/comparison.md.

Quick start

The current version is 0.1.0-rc.26 (package.json; releases are tagged on GitHub). On a VM with Docker Engine, the Compose plugin, a DNS name pointing at it and ports 80 and 443 reachable from the internet:

bash
git clone https://github.com/adamrowles1996/vaultgate.gitcd vaultgatecp .env.example .env

Set VAULTGATE_DOMAIN, VAULTGATE_PUBLIC_URL and VAULTGATE_VERSION in .env, then:

bash
mkdir -p secretshead -c 32 /dev/urandom | base64 > secrets/vaultgate_secret_keytouch secrets/bw_password secrets/bw_client_secretchmod 0400 secrets/* && sudo chown 10001 secrets/*docker compose up -ddocker compose logs -f vaultgate

First run: the log prints a one-time /setup?token=… URL. Open it and create the operator account with an e-mail address, a password and a code from your authenticator (TOTP). That password is vaultgate's own operator login; it is not, and never becomes, your Bitwarden master password. Sign in, and on the Vault page connect the vault: server, API key client id and secret, and master password. vaultgate stores that connection encrypted under VAULTGATE_SECRET_KEY, so it survives restarts and upgrades. Then add https://<host>/mcp to Claude (or Claude Code, Codex, the MCP Inspector) as a remote MCP server and approve the scopes on the consent page. The bw CLI that vaultgate drives is bundled in the image and installed by install.sh; nothing else is needed on the host. Walkthrough: docs/guides/first-run.md; details and the verification of the image: docs/guides/install-docker-compose.md.

To let agents use credentials rather than read them, set VAULTGATE_ENABLE_ACTIONS=true and the switch for each connector you want, restart, and add connections (targets) on the console's Connections page: docs/guides/actions.md.

How it works

text
Claude / Codex ──HTTPS + Bearer──▶ vaultgate ──loopback──▶ bw serve ──▶ Bitwarden                 ▲                    │    │                 │                    │    └──pinned──▶ your API, database, SSH or WinRM host                 └── OAuth 2.1 ◀──────┘        (credential injected by vaultgate, result scrubbed)                   (consent page, operator login with TOTP)
  1. An agent calls /mcp and is challenged with WWW-Authenticate.
  2. It discovers the authorization server from the protected resource metadata, registers (Client ID Metadata Document, dynamic registration, or a pre-registered id) and sends you to the consent page.
  3. You log in (password + TOTP) and approve the scopes: vault:read, vault:reveal, vault:generate, optionally vault:write, and the actions:* scopes of each connector the deployment enables.
  4. With an actions:* scope, the agent lists the targets granted to it and calls them: http_request, sql_query, sql_execute, ssh_run, winrm_run, and code_search, code_find_related and code_read for Semble connections. vaultgate fetches the credential from the vault, performs the operation at the target and returns the scrubbed result; the credential never reaches the agent.
  5. With the vault scopes, it can search items, read metadata, reveal one secret field at a time, generate passwords and, if allowed, create or update items.

Install

TLS is always terminated in front of vaultgate; every method below ends with a public https:// origin that hosted agents can reach.

MethodGuide
Docker Compose with Caddy (recommended)docs/guides/install-docker-compose.md
Debian or Ubuntu VM, install.shdocs/guides/install-linux.md
Your own reverse proxy (Caddy, nginx)docs/guides/reverse-proxy.md

Releases publish ghcr.io/adamrowles1996/vaultgate:<version> for linux/amd64 and linux/arm64, signed with Sigstore cosign and carrying an SBOM and a provenance attestation, plus vaultgate-<version>.tgz and its .sha256 for the script install.

Documentation

DocumentWhat it is
docs/guides/User guides: first run, connecting Claude, Claude Code, Codex and the Inspector, tools and scopes, self-hosted Bitwarden, backup, upgrading, security model, FAQ
docs/spec/The normative specification, one file per concern
docs/PLAN.mdMilestones, exit criteria, risks
docs/THREAT_MODEL.mdAssets, attackers, mitigations, residual risks
docs/comparison.mdHow vaultgate differs from the other Bitwarden MCP servers, with dated verification notes
docs/adoption.mdListings, channels and app-store definitions, with the submission mechanics for each
server.jsonThe MCP Registry listing; how to publish it: docs/guides/publishing.md
docs/adr/Architecture decision records
CONTRIBUTING.mdDevelopment workflow and quality gates
SECURITY.mdReporting vulnerabilities

Development

Requires Node 26 (see .nvmrc) and mise for the pinned external linters.

bash
mise install         # actionlint, shellcheck, shfmt, hadolint, gitleaks, editorconfig-checkernpm cinpm run dev          # runs src/main.ts directly with Node's type strippingnpm run quality      # format, every linter, types, dead code, file sizes, provenance, tests at 100%

Every check that runs in CI runs locally with npm run quality. See CONTRIBUTING.md for the rules the repository enforces and why.

Licence

Apache-2.0. See LICENSE and NOTICE.

來源:README.md,提交 69356d9

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

2
  1. v0.1.0-rc.10最新Sep 24, 2026
  2. v0.1.0-rc.5Sep 23, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式必需10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分