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).
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:
| 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 | Retry with correct master vault key |
DUPLICATE_KEY | Key with same name & environment exists | Use update_key or choose another name |
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.