MCP server
Connect AI tools to one ApiVault project using the Model Context Protocol (MCP). You choose which permissions to grant each connection.
What is ApiVault MCP?
The remote MCP server gives agents scoped, audited access to your keys. Listing or getting a key returns a masked preview. With keys:reveal, an agent can call reveal_key to get the raw value, which may end up in its conversation history.
https://mcp.apivault.tech/mcpClients connect over Streamable HTTP and authorize with OAuth 2.1, Dynamic Client Registration (RFC 7591), and PKCE S256 (RFC 7636).
Quick setup
Use add-mcp to register ApiVault with detected tools such as Cursor, Claude Desktop, Windsurf, and VS Code.
npx -y add-mcp https://mcp.apivault.tech/mcp -g
For manual instructions, see Client setup.
How approval works
Connect from AI assistant
Add the ApiVault MCP server endpoint in your AI editor or client settings.
Review requested scopes
Your client opens ApiVault's authorization screen in your browser. Check the client, choose a project, and select the scopes it needs (
keys:read,keys:write, orkeys:reveal).Approve and issue OAuth token
Click Approve Connection to generate an OAuth 2.1 access token. Manage or revoke connections anytime in Settings → MCP Connections.
Project-scoped connections and roles
Each connection uses the Target Project you choose in the browser. ApiVault routes every tool call to that project, so you can leave the project ID out of your client configuration. To change projects, revoke and reconnect the client.
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 list keys and, with
keys:reveal, reveal them. Write tools are rejected regardless of granted scopes.
Tools, scopes & errors
The six tools the server exposes, the OAuth scopes each one needs, and the error codes they return are on Tools & scopes.
Supported clients
ApiVault MCP works with any client that supports remote MCP servers over Streamable HTTP, including:
- Cursor
- Claude.ai and Claude for Desktop
- Claude Code (CLI)
- Windsurf
- VS Code (with Copilot / Cline / Roo Code)
- ChatGPT (Developer Mode Connector)
- Codex CLI
- Devin
- Raycast
- Goose
- Gemini Code Assist
- Gemini CLI
Step-by-step setup for each one is on Client setup.
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.
Agent skill
The ApiVault Agent Skill shows an agent how to find, inject, and manage keys while keeping secret values out of chat logs.
git clone https://github.com/ApiVault-tech/apivault-skill.git .agents/skills/apivault
Open this prompt in Claude, ChatGPT, or Cursor from the options menu, or copy it into another AI agent.
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. Each client appears there separately.
- Check the redirect destination before approving. The client supplies its own name and icon.
- Isolated token boundaries: MCP OAuth tokens work only on the MCP server and cannot be used with the REST API.
- Short-lived access tokens: MCP access tokens expire after 1 hour; refresh tokens last 30 days.
keys:reveal scope lets an agent read raw secret values. Only grant it when the agent truly needs plaintext keys, and revoke the connection when the task is done.