Run the Vault MCP server with Docker
We recommend running the MCP server in Docker for most users because it provides the most reliable and consistent way to run the Vault MCP server across different environments.
Option 1: Run MCP globally
Verify Visual Studio Code is installed.
Verify the GitHub Copilot extension is installed and chats are configured to
Agentmode.Verify MCP support enabled, refer to the VS Code MCP documentation for more information.
Open your user settings JSON file.
Add the
mcpconfiguration details:{ "mcp": { "servers": { "vault-mcp-server": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "VAULT_ADDR", "-e", "VAULT_NAMESPACE", "-e", "VAULT_TOKEN", "hashicorp/vault-mcp-server" ], "env": { "VAULT_ADDR": "${input:vault_address}", "VAULT_NAMESPACE": "${input:vault_namespace}", "VAULT_TOKEN": "${input:vault_token}" }, "type": "stdio" } }, "inputs": [ { "type": "promptString", "id": "vault_address", "description": "Vault address", "password": false }, { "type": "promptString", "id": "vault_namespace", "description": "Vault Namespace (optional)", "password": false }, { "type": "promptString", "id": "vault_token", "description": "Vault Token", "password": true } ] } }Verify the integration by opening the chat interface and selecting Agent from the mode settings.
Click the tools icon to verify that Vault MCP server tools appear in the available tools list.
Option 2: Run MCP in a specific workspace
Verify Visual Studio Code is installed.
Verify the GitHub Copilot extension is installed and chats are configured to
Agentmode.Verify MCP support enabled, refer to the VS Code MCP documentation for more information.
Create a new
mcp.jsonfile in the.vscodedirectory for your workspace.Add the following
mcpconfiguration details:{ "inputs": [ { "type": "promptString", "id": "vault_address", "description": "Vault address", "password": false }, { "type": "promptString", "id": "vault-namespace", "description": "Vault Namespace (optional)", "password": false }, { "type": "promptString", "id": "vault-token", "description": "Vault Token", "password": true } ], "servers": { "vault-mcp-server": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "VAULT_ADDR", "-e", "VAULT_NAMESPACE", "-e", "VAULT_TOKEN", "hashicorp/vault-mcp-server" ], "env": { "VAULT_ADDR": "${input:vault_address}", "VAULT_NAMESPACE": "${input:vault_namespace}", "VAULT_TOKEN": "${input:vault_token}" }, "type": "stdio" } } }Verify the integration by opening the chat interface and selecting Agent from the mode settings.
Click the tools icon to verify that Vault MCP server tools appear in the available tools list.
Next steps
- Try the Write secrets to kv example prompt to begin prompting your AI model about Vault operations.
- Ask your AI agent for help with specific Vault operations and workflows.
- Explore advanced configuration options for your specific deployment needs.