Run the Vault MCP server from source code
We recommend building and running the MCP server from source code when you want access to the latest features and the ability to customize the server.
Step 1: Get the source code
Use
goto install from Github. Use thelatesttag to pull the latest stable release. To install the latest development release, use themaintag:$ go install github.com/hashicorp/vault-mcp-server/cmd/vault-mcp-server@<tag>Confirm the path to the downloaded
vault-mcp-serverbinary. The binary location depends on your Go installation andGOPATHconfiguration.$ which vault-mcp-serverAdd the following MCP configuration to your AI client. Replace
/path/to/vault-mcp-serverwith the actual path to the downloaded binary:{ "mcp": { "servers": { "vault": { "command": "/path/to/vault-mcp-server", "args": ["stdio"], "env": { "VAULT_ADDR": "<<vault_address_here>>", "VAULT_NAMESPACE": "<<vault_namespace_here>>", "VAULT_TOKEN": "<<vault_token_here>>" } } } } }
Step 2: Start the server
You can use the vault-mcp-server CLI and specify the transport protocol you
want to use to start the server.
Option 1: Start the server in stdio mode
Run the following command on the local instance to start the server in
stdio mode:
$ vault-mcp-server stdio [--log-file /path/to/log]
Option 1: Start the server in streamable-http mode
Run the following command on the local instance to start the server in
streamable-http mode:
$ vault-mcp-server streamable-http \
[--transport-port 8080] \
[--transport-host 127.0.0.1] \
[--mcp-endpoint /mcp] \
[--log-file /path/to/log]
Next steps
- Begin prompting your AI model about Vault operations. Refer to Prompt an AI model for guidance on effective prompting techniques.
- Ask for help with specific Vault operations and workflows.
- Explore advanced configuration options for your specific deployment needs.