HV

hashicorp/vault-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

66 stars 26 forks 质量 84 趋势 28MPL-2.0

HASHICORP/Vault-MCP-server 是从 https://github.com/hashicorp/vault-mcp-server. 导入的 MCP 服务器候选

概览

HASHICORP/Vault-MCP-server 是从 https://github.com/hashicorp/vault-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

Vault MCP 服务器是一种模型上下文协议(MCP) 提供与HashiCorp集成的服务器实现 Vault 用于管理秘密和挂载。该服务器同时使用 stdio 和 StreamableHTTP 用于MCP通信的传输,使其与Claude桌面兼容 以及其他MCP客户端。

安全注意: 此阶段,MCP服务器仅用于本地使用。MCP服务器应仅部署在拥有受信任客户端的受信任网络中。使用StreamableHTTP传输时,务必配置MCP_ALLOWED_ORIGINS环境变量,仅限制访问受信任的浏览器来源。这有助于防止DNS重绑攻击及其他跨源浏览器攻击。MCP_ALLOWED_ORIGINS是CORS保护,而非网络连接允许列表。

安全提示: 根据查询的不同,MCP服务器可能会向MCP客户端和LLM暴露某些Vault数据,包括Vault秘密。不要将MCP服务器与不受信任的MCP客户端或LLM一起使用。

法律说明: 您使用第三方MCP客户端/LLM仅受该MCP/LLM使用条款约束,IBM不对该第三方工具的性能负责。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Vault MCP Server

The Vault MCP Server is a Model Context Protocol (MCP) server implementation that provides integration with HashiCorp Vault for managing secrets and mounts. This server uses both stdio and StreamableHTTP transports for MCP communication, making it compatible with Claude for Desktop and other MCP clients.

Security Note: At this stage, the MCP server is intended for local use only. The MCP server should only be deployed in trusted networks with trusted clients. If using the StreamableHTTP transport, always configure the MCP_ALLOWED_ORIGINS environment variable to restrict access to trusted browser origins only. This helps prevent DNS rebinding attacks and other cross-origin browser attacks. MCP_ALLOWED_ORIGINS is a CORS protection and not a network connection allowlist.

Security Note: Depending on the query, the MCP server may expose certain Vault data, including Vault secrets, to the MCP client and LLM. Do not use the MCP server with untrusted MCP clients or LLMs.

Legal Note: Your use of a third party MCP Client/LLM is subject solely to the terms of use for such MCP/LLM, and IBM is not responsible for the performance of such third party tools. IBM expressly disclaims any and all warranties and liability for third party MCP Clients/LLMs, and may not be able to provide support to resolve issues which are caused by the third party tools.

Caution: The outputs and recommendations provided by the MCP server are generated dynamically and may vary based on the query, model, and the connected MCP client. Users should thoroughly review all outputs/recommendations to ensure they align with their organization’s security best practices, cost-efficiency goals, and compliance requirements before implementation.

Features

  • Create new mounts in Vault (KV v1, KV v2)
  • List all available mounts
  • Delete a mount
  • Write secrets to KV mounts
  • Read secrets from KV mounts
  • List all secrets under a path
  • Delete a complete secret or a key of a secret
  • Comprehensive HTTP middleware stack (CORS, logging, Vault context)
  • Session-based Vault client management
  • Structured logging with configurable output

Prerequisites

  • Go 1.24 or later (if building from source)
  • Docker
  • HashiCorp Vault server running locally or remotely
  • A valid Vault token with appropriate permissions

Setup

  1. Clone the repository:

    git clone https://github.com/hashicorp/vault-mcp-server.git
    cd vault-mcp-server
    
  2. Build the binary:

    make build
    
  3. Run the server:

    Stdio mode (default):

    ./vault-mcp-server
    # or explicitly
    ./vault-mcp-server stdio
    

    HTTP mode:

    ./vault-mcp-server http --transport-port 8080
    # or using make
    make run-http
    
在 GitHub 查看完整 README

安装

docker run -i --rm -e VAULT_ADDR=${input:vault_addr} -e VAULT_TOKEN=${input:vault_token} -e VAULT_NAMESPACE=${input:vault_namespace} hashicorp/vault-mcp-server
新手?先看 mcpskill.org 教程 →