ApiVault MCP Server
Connect your AI coding tools to ApiVault using the Model Context Protocol (MCP), an open standard that lets AI assistants securely browse, manage, and decrypt vault secrets with OAuth 2.1 scoped authorization.
Quick Setup
Use the add-mcp CLI to automatically configure ApiVault MCP across all detected AI tools:
npx -y add-mcp https://mcp.apivault.tech/mcp -g
The add-mcp utility detects installed editors (Cursor, Claude Desktop, Windsurf, VS Code) and automatically registers the remote endpoint.
Official AI Agent Skill
For AI assistants like Cursor, Claude Code, Windsurf, or Google Antigravity, you can install the official ApiVault Agent Skill. It gives your AI agents native runbooks and workflows to browse, inject, and manage encrypted credentials safely without risking secret leakage in chat logs.
git clone https://github.com/TLB-STATION/apivault-skill.git .agents/skills/apivault
Alternatively, paste this prompt into any AI agent to let it install and configure the skill automatically:
Please install the ApiVault skill for this workspace by cloning https://github.com/TLB-STATION/apivault-skill.git into .agents/skills/apivault. Read .agents/skills/apivault/SKILL.md to learn how to manage ApiVault keys and connect to the MCP server.
What is ApiVault MCP?
ApiVault MCP is the official remote Model Context Protocol server for ApiVault. It provides AI agents with fine-grained, auditable access to your encrypted credentials without ever placing raw secrets in prompt histories or checking .env files into version control.
https://mcp.apivault.tech/mcpIt implements the official Streamable HTTP transport and OAuth 2.1 authorization specifications with Dynamic Client Registration (RFC 7591) and PKCE S256 (RFC 7636).
Project-Scoped Connections & RBAC
In ApiVault's multi-project environment, MCP connections are strictly isolated. When you authorize an AI agent in your browser, you will be prompted to select a Target Project.
The resulting authorization token is permanently bound to that specific project. This means any tool execution (like fetching or revealing keys) by that agent will automatically route to the chosen workspace, requiring zero manual configuration or project IDs in your client setup!
Role-Based Access Control (RBAC): The operations your AI agent can perform are limited by your role in the selected project:
- Owner/Admin: Agents can perform any operation granted by the requested scopes.
- Editor: Agents can manage and reveal keys (if
keys:writeorkeys:revealscopes are granted). - Viewer: Agents can only read metadata (e.g.,
list_keys). Attempts to use write tools will be rejected regardless of granted scopes.
Available tools
The server exposes six dedicated tools for browsing masked metadata, managing vault credentials, and decrypting secrets on-demand:
| Tool | Required Scope | Description |
|---|---|---|
list_keys | keys:read | List API keys with masked previews (sk_live_••••1234). Supports filtering by environment or service. |
get_key | keys:read | Retrieve metadata and masked preview for a single key by ID. |
reveal_key | keys:reveal | Decrypt and return the raw secret value. Accepts optional vault_key for custom encryption accounts. |
add_key | keys:write | Store a newly generated API key in the encrypted vault. |
update_key | keys:write | Update metadata or re-encrypt secret values for an existing key. |
delete_key | keys:write | Permanently remove a key from the vault by ID. |
Supported clients
ApiVault MCP supports any client implementing the Model Context Protocol Streamable HTTP or SSE specification, including:
Setup by client
Connect your preferred AI tool and authorize access via browser approval:
Cursor
Add the server entry to your project .cursor/mcp.json or global Cursor Settings (Cmd/Ctrl + Shift + J → MCP):
{
"mcpServers": {
"apivault": {
"url": "https://mcp.apivault.tech/mcp"
}
}
}When Cursor connects, it will prompt you with a Needs login status. Click the button to open your browser on ApiVault and approve permissions.
Claude.ai and Claude for Desktop
You can connect Claude using either the built-in Connectors UI or via your configuration file:
Method 1: Connectors UI (Recommended)
Open Connectors settings
In Claude Desktop or Claude.ai, open Settings → Connectors (or click the + in chat → Connectors).
Add custom connector
Click Add Custom Connector.
Enter server details
Enter Name:
ApiVaultand Remote URL:https://mcp.apivault.tech/mcp.Connect and authorize
Click Connect to authenticate via your browser.
Method 2: Config File
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"apivault": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.apivault.tech/mcp"]
}
}
}Claude Code
Add ApiVault MCP directly from your terminal:
# Add the ApiVault remote MCP server claude mcp add --transport http apivault https://mcp.apivault.tech/mcp # Launch Claude Code claude # Trigger authentication /mcp
Windsurf
Add the server snippet to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"apivault": {
"serverUrl": "https://mcp.apivault.tech/mcp"
}
}
}VS Code with Copilot / Cline
In VS Code with Copilot or extensions like Cline / Roo Code:
Open Command Palette
Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(macOS).Run MCP: Add Server
Select HTTP, set Name to
apivault, and enter URL:https://mcp.apivault.tech/mcp.Authorize in Browser
Start the server and complete the authorization prompt in your browser.
ChatGPT (Developer Mode)
Custom connectors using MCP are available on ChatGPT for Pro and Plus accounts:
Enable Developer mode
Go to Settings → Connectors → Advanced settings → Developer mode.
Create connector
Click Create under Connectors.
Configure server endpoint
Set Name:
ApiVault, URL:https://mcp.apivault.tech/mcp, and Authentication:OAuth.Complete authorization
Click Create to finish setup and complete authorization in your browser.
Codex CLI
# Install Codex npm i -g @openai/codex # Add ApiVault MCP codex mcp add apivault --url https://mcp.apivault.tech/mcp # Start Codex codex
Devin
Open MCP Marketplace
Navigate to Settings → MCP Marketplace.
Find ApiVault
Search for ApiVault or select Custom Server.
Install server
Set URL to
https://mcp.apivault.tech/mcpand click Install.
Raycast
Run Install Server
Run the Install Server command in Raycast.
Configure connection
Set Name:
ApiVault, Transport:HTTP, and URL:https://mcp.apivault.tech/mcp.Approve access
Click Install and approve permissions in your browser.
Goose
Add the extension configuration in Goose:
goose extension add --name apivault --url https://mcp.apivault.tech/mcp --type streamable_http
Gemini Code Assist
Add the configuration to your ~/.gemini/settings.json:
{
"mcpServers": {
"apivault": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.apivault.tech/mcp"]
}
}
}Gemini CLI
Shares the same configuration as Gemini Code Assist. After updating ~/.gemini/settings.json, run gemini /mcp list and approve when prompted.
OAuth scopes
During OAuth consent you select which permissions to grant:
Claude Desktop. That is why the name carries an Unverified badge. The consent screen also shows a Redirects to row with the origin the authorization code will be sent to. Approve only when that origin matches the tool you started the connection from, and treat a destination that is not using HTTPS as suspect.The client icon is picked from the first source that loads: the logo_uri sent at registration, the favicon of its client_uri or of its HTTPS redirect URIs, a LobeHub icon matching the client name, a built-in icon for well-known clients, and finally a generic MCP icon. Only HTTPS logo_uri and client_uri values are stored.
| Scope | Permission | Tools |
|---|---|---|
keys:read | View API keys (masked) | list_keys, get_key |
keys:write | Add, update, and delete API keys | add_key, update_key, delete_key |
keys:reveal | Reveal decrypted secret values | reveal_key |
Manage or revoke connected agents anytime in Settings → MCP Connections.
Workflow patterns
Find a key for an integration task
List keys for the target environment
Call
list_keyswith anenvironmentfilter (e.g."Production").Confirm the correct key ID
Call
get_keyto verify metadata before using the secret.Reveal only when the raw secret is required
Call
reveal_keyonly when running local builds or tests — avoid printing plaintext values into conversation windows.
Error codes
| Code | Meaning | Action |
|---|---|---|
UNAUTHORIZED | Token missing or expired | Trigger re-authentication in your client |
INSUFFICIENT_SCOPE | Token lacks required scope | Re-authenticate with write or reveal scope granted |
NOT_FOUND | Key ID invalid | Re-list keys with list_keys |
VAULT_KEY_REQUIRED | Custom encryption; vault key needed | Pass vault_key in tool arguments |
INVALID_VAULT_KEY | Wrong custom vault key | Supply the correct vault key — repeated wrong guesses are throttled |
VAULT_KEY_RATE_LIMITED | Too many incorrect vault keys | Wait for the delay in the error message before retrying |
DUPLICATE_KEY | Key with same name & environment exists | Use update_key or choose another name |
Vault key attempt limits
A custom vault key is verified against a stored hash, so incorrect keys passed to reveal_key, add_key or update_key are rate limited: 10 failures per 15 minutes, counted per user and per source address. Exceeding the limit returns VAULT_KEY_RATE_LIMITED (HTTP 429 with a Retry-After header), and the tool error states how long to wait.
A correct vault key clears the counter, so an agent that reveals several keys in a row is never throttled. Agents should not retry a rejected vault_keyautomatically — ask the user for the correct one instead.
Rejected attempts are visible, not silent: a failed tool call is written to the project's audit log with its HTTP status, the error code above, the acting user and the client name the agent reports, filed under the action that was attempted — so a denied reveal_key appears as a KEY_REVEALED entry with a 4xx status. Calls rejected before a project can be resolved are not logged, because entries are stored per project.
Security best practices
- Least Privilege: Request only the scopes your agent needs for the current task.
- Masked Previews: Always rely on masked previews (
list_keys) before requesting raw secrets. - No Plaintext in Chat: Never instruct an AI agent to print revealed secrets in conversation transcripts or unencrypted commit files.
- Confused Deputy Protection: ApiVault MCP requires explicit browser authorization for every unique client ID.
- Revocation: Disconnect inactive agents anytime in Settings → MCP Connections.