Sponsored by Deepsite.site

HashiCorp Vault MCP Server

Created By
ashgw8 months ago
Model Context Protocol (MCP) Server for HashiCorp Vault secret management
Content

HashiCorp Vault MCP Server

A Model Context Protocol (MCP) server implementation that provides a secure interface to HashiCorp Vault which enables LLMs and other MCP clients to interact with Vault's secret and policy management features.

Overview

This allows you to prompt an LLM to:

  • Secure secret management through structured API
  • Policy creation and management
  • Resource discovery and listing
  • Automated policy generation

Installation

There are multiple ways to use this server depending on your setup.

Add this to your Cursor MCP configuration:

{
  "mcpServers": {
    "Vault MCP": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "VAULT_ADDR=https://your-vault-server:8200",
        "-e",
        "VAULT_TOKEN=hvs.your-vault-token",
        "ashgw/vault-mcp:latest"
      ]
    }
  }
}

If you prefer pinning to a specific docker image build (e.g. 20250413-165732), use that tag instead of latest. Browse available versions on Docker Hub.

Once added, you can use prompts like:

"Read the secret at path apps/myapp/config from Vault"

Cursor will route that request through the MCP server automatically.

Check if it works, it should be green

image


Docker (manual)

You can run Vault MCP manually via Docker:

docker run -d \
  --name vault-mcp \
  -e VAULT_ADDR=https://your-vault-server:8200 \
  -e VAULT_TOKEN=hvs.your-vault-token \
  -p 3000:3000 \
  ashgw/vault-mcp

This uses the pre-built image published at ashgw/vault-mcp.


Repo

Clone the repository and cd into it, then build with

docker build -t vault-mcp .

Then run with

docker run --rm -e VAULT_ADDR=localhost:8200 -e VAULT_TOKEN=hsv.yourtoken vault-mcp

Environment Variables

These are required to run the MCP Vault server:

  • VAULT_ADDR: Your HashiCorp Vault server address
  • VAULT_TOKEN: A valid Vault token with read/write permissions
  • MCP_PORT: Optional. Defaults to 3000. Not required for Cursor.

Features in Detail

Secret Management Tools

secret_create

Creates or updates a secret at specified path.

await tool("secret_create", {
  path: "apps/myapp/config",
  data: {
    apiKey: "secret-key-123",
    environment: "production",
  },
});

secret_read

Retrieves a secret from specified path.

await tool("secret_read", {
  path: "apps/myapp/config",
});

secret_delete

Soft-deletes a secret (versioned delete in KV v2).

await tool("secret_delete", {
  path: "apps/myapp/config",
});

Policy Management

policy_create

Creates a new Vault policy with specified permissions.

await tool("policy_create", {
  name: "app-readonly",
  policy: `
    path "secret/data/apps/myapp/*" {
      capabilities = ["read", "list"]
    }
  `,
});

Resources

vault://secrets

Lists all available secret paths in the KV store.

{
  "keys": ["apps/", "databases/", "certificates/"]
}

vault://policies

Lists all available Vault policies.

{
  "policies": ["default", "app-readonly", "admin"]
}

Prompts

generate_policy

Generates a Vault policy from path and capabilities.

await prompt("generate_policy", {
  path: "secret/data/apps/*",
  capabilities: "read,list",
});

Returns:

{
  "path": {
    "secret/data/apps/*": {
      "capabilities": ["read", "list"]
    }
  }
}

License

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
CursorThe AI Code Editor
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Playwright McpPlaywright MCP server
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Serper MCP ServerA Serper MCP Server