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.

Remote endpoint
https://mcp.apivault.tech/mcp

Clients 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.

Add the MCP serverShell
npx -y add-mcp https://mcp.apivault.tech/mcp -g

For manual instructions, see Client setup.

How approval works

  1. Connect from AI assistant

    Add the ApiVault MCP server endpoint in your AI editor or client settings.

  2. 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, or keys:reveal).

  3. 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:write or keys:reveal scopes 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:

Step-by-step setup for each one is on Client setup.

Workflow patterns

Find a key for an integration task

  1. List keys for the target environment

    Call list_keys with an environment filter (e.g. "Production").

  2. Confirm the correct key ID

    Call get_key to verify metadata before using the secret.

  3. Reveal only when the raw secret is required

    Call reveal_key only 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.

Add to project workspaceShell
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.

Please install the ApiVault skill for this workspace by cloning https://github.com/ApiVault-tech/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.

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.