Vault
Vault MCP server reference
This page contains reference information about the Vault MCP server, including configuration options and tools.
Available tools
The Vault MCP server provides specialized tools that AI models can use to access and perform certain Vault operations. These tools work automatically when you ask relevant questions—you don't need to invoke them manually.
Key-Value (kv) tools
Tool | Purpose | What it returns |
---|---|---|
list_secrets | List all secrets stored in Vault | A list of secret paths |
create_secret | Create a new secret in Vault | Confirmation of the secret creation |
read_secret | Retrieve the value of a specific secret | The secret value |
delete_secret | Delete a specific secret from Vault | Confirmation of the secret deletion |
Example prompt: "How can I securely store and access an API key for my application?"
Public Key Infrastructure (pki) tools
Tool | Purpose | What it returns |
---|---|---|
create_pki_issuer | Create a new PKI issuer in Vault | Confirmation of the PKI issuer creation |
create_pki_role | Create a new PKI role in Vault | Confirmation of the PKI role creation |
delete_pki_role | Delete a specific PKI role from Vault | Confirmation of the PKI role deletion |
enable_pki | Enable the PKI secrets engine in Vault | Confirmation of the PKI engine enablement |
issue_pki_certificate | Issue a new certificate from a PKI role | The issued certificate details |
list_pki_issuers | List all PKI issuers in Vault | A list of PKI issuers |
list_pki_roles | List all PKI roles in Vault | A list of PKI roles |
read_pki_issuer | Retrieve details of a specific PKI issuer | Details of the PKI issuer |
read_pki_role | Retrieve details of a specific PKI role | Details of the PKI role |
Example prompt: "Show me how to issue pki certificate using the app-dev
role."
System (sys) tools
Tool | Purpose | What it returns |
---|---|---|
list_mounts | List all mounts in Vault | A list of mount paths and their configurations |
create_mount | Create a new KV mount (v1 or v2) in Vault | Confirmation of the mount creation |
delete_mount | Delete a specific mount from Vault | Confirmation of the mount deletion |
Example prompt: "Create a KV mount named "secrets" to store arbitrary secrets"
Transport protocols
You can set one of the following transport protocols when starting the MCP server so that it operates correctly for your environment.
Transport | Best for | How it works | Usage |
---|---|---|---|
stdio | Local development and direct integration with MCP clients | Uses standard input/output for JSON-RPC message communication | Automatically used when no specific transport mode is configured |
streamable-http | Distributed setups, internal environments | HTTP-based transport with support for both direct HTTP requests | Enable by setting TRANSPORT_MODE=streamable-http |
HTTP mode configuration
At this stage, the MCP server is intended for local use only. If using the StreamableHTTP transport in production, always configure the MCP_ALLOWED_ORIGINS environment variable to restrict access to trusted origins only. This helps prevent DNS rebinding attacks and other cross-origin vulnerabilities.
In HTTP mode, Vault configuration can be provided through multiple methods (in order of precedence):
- HTTP Query:
VAULT_ADDR
- HTTP Headers:
VAULT_ADDR
,X-Vault-Token
, andX-Vault-Namespace
- Environment Variables: Standard
VAULT_ADDR
,VAULT_TOKEN
, andVAULT_NAMESPACE env vars
Environment variables
You can set the following environment variables to configure the server behavior.
Variable | Purpose | Default value | Example | Options |
---|---|---|---|---|
VAULT_ADDR | Vault server address | http://127.0.0.1:8200 | http://vault.example.com:8200 | Any valid Vault server address |
VAULT_TOKEN | Vault authentication token (required) | — | hvs.xxxxxxxx | Any valid Vault token |
VAULT_NAMESPACE | Vault namespace (optional) | — | admin | Any valid Vault namespace |
TRANSPORT_MODE | Set to http to enable HTTP mode | — | http | http |
TRANSPORT_HOST | Host to bind to for HTTP mode | 127.0.0.1 | 0.0.0.0 | Any valid IP address |
TRANSPORT_PORT | Port for HTTP mode | 8080 | 3000 | Any valid port number |
MCP_ENDPOINT | HTTP server endpoint path | /mcp | /api/mcp | Any valid endpoint path |
MCP_ALLOWED_ORIGINS | Comma-separated list of allowed origins for CORS | "" (none) | http://mcp.client.com:5000 . | Comma-separated list of origins or "" |
MCP_CORS_MODE | CORS mode: strict , development , or disabled | strict | development | strict , development , disabled |
MCP_TLS_CERT_FILE | Location of the TLS certificate file | "" | /path/to/cert.pem | Any valid file path |
MCP_TLS_KEY_FILE | Location of the TLS key file | "" | /path/to/key.pem | Any valid file path |
MCP_RATE_LIMIT_GLOBAL | Global rate limit (format: rps:burst) | 10:20 | 100:200 | Any valid rps:burst value |
MCP_RATE_LIMIT_SESSION | Per-session rate limit (format: rps:burst) | 5:10 | 20:40 | Any valid rps:burst value |