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:

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

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

Prompt for AI AgentShell
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.
Skill Repository
Explore configuration templates, automation scripts, and full schemas on GitHub: github.com/TLB-STATION/apivault-skill

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.

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

It 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:

ToolRequired ScopeDescription
list_keyskeys:readList API keys with masked previews (sk_live_••••1234). Supports filtering by environment or service.
get_keykeys:readRetrieve metadata and masked preview for a single key by ID.
reveal_keykeys:revealDecrypt and return the raw secret value. Accepts optional vault_key for custom encryption accounts.
add_keykeys:writeStore a newly generated API key in the encrypted vault.
update_keykeys:writeUpdate metadata or re-encrypt secret values for an existing key.
delete_keykeys:writePermanently 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 + JMCP):

Cursor mcp.jsonJSON
{
  "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)

  1. Open Connectors settings

    In Claude Desktop or Claude.ai, open Settings → Connectors (or click the + in chat → Connectors).

  2. Add custom connector

    Click Add Custom Connector.

  3. Enter server details

    Enter Name: ApiVault and Remote URL: https://mcp.apivault.tech/mcp.

  4. 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
claude_desktop_config.jsonJSON
{
  "mcpServers": {
    "apivault": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.apivault.tech/mcp"]
    }
  }
}

Claude Code

Add ApiVault MCP directly from your terminal:

TerminalShell
# 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:

Windsurf mcp_config.jsonJSON
{
  "mcpServers": {
    "apivault": {
      "serverUrl": "https://mcp.apivault.tech/mcp"
    }
  }
}

VS Code with Copilot / Cline

In VS Code with Copilot or extensions like Cline / Roo Code:

  1. Open Command Palette

    Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS).

  2. Run MCP: Add Server

    Select HTTP, set Name to apivault, and enter URL: https://mcp.apivault.tech/mcp.

  3. 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:

  1. Enable Developer mode

    Go to Settings → Connectors → Advanced settings → Developer mode.

  2. Create connector

    Click Create under Connectors.

  3. Configure server endpoint

    Set Name: ApiVault, URL: https://mcp.apivault.tech/mcp, and Authentication: OAuth.

  4. Complete authorization

    Click Create to finish setup and complete authorization in your browser.

Codex CLI

TerminalShell
# Install Codex
npm i -g @openai/codex

# Add ApiVault MCP
codex mcp add apivault --url https://mcp.apivault.tech/mcp

# Start Codex
codex

Devin

  1. Open MCP Marketplace

    Navigate to Settings → MCP Marketplace.

  2. Find ApiVault

    Search for ApiVault or select Custom Server.

  3. Install server

    Set URL to https://mcp.apivault.tech/mcp and click Install.

Raycast

  1. Run Install Server

    Run the Install Server command in Raycast.

  2. Configure connection

    Set Name: ApiVault, Transport: HTTP, and URL: https://mcp.apivault.tech/mcp.

  3. Approve access

    Click Install and approve permissions in your browser.

Goose

Add the extension configuration in Goose:

Goose settingsShell
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:

~/.gemini/settings.jsonJSON
{
  "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:

ScopePermissionTools
keys:readView API keys (masked)list_keys, get_key
keys:writeAdd, update, and delete API keysadd_key, update_key, delete_key
keys:revealReveal decrypted secret valuesreveal_key

Manage or revoke connected agents anytime in Settings → MCP Connections.

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.

Error codes

CodeMeaningAction
UNAUTHORIZEDToken missing or expiredTrigger re-authentication in your client
INSUFFICIENT_SCOPEToken lacks required scopeRe-authenticate with write or reveal scope granted
NOT_FOUNDKey ID invalidRe-list keys with list_keys
VAULT_KEY_REQUIREDCustom encryption; vault key neededPass vault_key in tool arguments
INVALID_VAULT_KEYWrong custom vault keyRetry with correct master vault key
DUPLICATE_KEYKey with same name & environment existsUse 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.