Docs · MCP integration

Give your AI agent your vault.

API Locker exposes a full Model Context Protocol (MCP) server. Any MCP-compatible client — Claude (web), Claude Code, Claude Desktop, Cursor, Zed, Continue, Cline — can list your credentials, reveal values, run health checks, and proxy API calls, all with one connection.

Two ways to connect

Pick the one that fits your AI client:

Remote MCP — for Claude web + Claude Code

API Locker is a compliant OAuth 2.1 remote MCP server. When Claude's Connectors Directory supports API Locker, users can add it in three clicks:

  1. Open Claude settings → Connectors → Add connector
  2. Search for API Locker and click Add
  3. Sign in with your API Locker account (GitHub or Google) and click Approve on the consent screen

After approval, Claude has full access to your vault through the same 25 tools listed below. Claude shows a safety label on every tool call (read vs. write vs. external request) before executing. You can revoke the connection at any time from your dashboard.

Is API Locker in the directory yet? Submission is in progress with Anthropic. Until it's listed, you can still add API Locker manually by pasting this URL into Claude's Add custom connector flow: https://api.apilocker.app/v1/mcp — Claude will handle the OAuth handshake and consent screen automatically.

Install in 3 steps — for local MCP clients

1. Install the CLI

npm install -g apilocker

Requires Node 18+. Works on macOS, Linux, Windows.

2. Register your device

apilocker register

Opens your browser, you click Authorize once, done. The CLI stores a per-device master token in ~/.apilocker/config.json (mode 0600). The MCP bridge picks it up automatically — you never paste a token into your AI client's config.

3. Connect your AI client

Pick your tool. Every flow uses the same apilocker mcp stdio bridge; only the config shape differs.

Claude Code — one command

This is the fastest path. Claude Code ships with a built-in MCP add command:

claude mcp add apilocker -- apilocker mcp

That's the entire install. Verify with claude mcp list — you should see apilocker: apilocker mcp - ✓ Connected. The server is available in your next Claude Code session automatically.

Claude Desktop

Paste this into your config file and restart the app.

Config location:

{
  "mcpServers": {
    "apilocker": {
      "command": "apilocker",
      "args": ["mcp"]
    }
  }
}

Cursor

Open Cursor Settings → Features → Model Context Protocol, click Add Server, and paste the same config as Claude Desktop. Restart Cursor after saving.

Zed

Open your Zed settings.json and add a context_servers entry:

{
  "context_servers": {
    "apilocker": {
      "command": {
        "path": "apilocker",
        "args": ["mcp"],
        "env": {}
      }
    }
  }
}

Continue (VS Code)

Edit ~/.continue/config.json and add an mcpServers entry (same shape as Claude Desktop).

The 25 tools your agent gets

Every vault operation is exposed as an MCP tool. Your agent can do anything the CLI can do:

list_keys
get_key_metadata
reveal_key
list_providers
get_activity
run_doctor
proxy_get
proxy_post
proxy_put
proxy_patch
proxy_delete
store_key
store_oauth_credential
rotate_key
rename_key
pause_key
resume_key
delete_key
list_tokens
create_token
pause_token
resume_token
revoke_token
list_devices
revoke_device

Proxy tools and supported providers

The proxy tools call a provider's API with a credential from your vault. API Locker injects the secret server-side, so the agent never sees the raw key, and every call is audit-logged. There's one tool per HTTP method: proxy_get is read-only, while proxy_post, proxy_put, proxy_patch, and proxy_delete are writes that Claude confirms with you before running.

Each request goes to the credential's base URL plus the path you pass. These are the providers with built-in templates, the base URL each one uses, and its API reference:

ProviderBase URLAPI referenceWrites through MCP
OpenAIhttps://api.openai.comOpenAI APIYes, except image, audio, and video generation
Anthropichttps://api.anthropic.comClaude APIYes
Google AI (Gemini)https://generativelanguage.googleapis.comGemini APIYes, except image, audio, and video generation
Groqhttps://api.groq.com/openai/v1Groq APIYes, except text-to-speech
Mistralhttps://api.mistral.aiMistral APIYes, except image generation
Stripehttps://api.stripe.comStripe APINo (read-only)
Lemon Squeezyhttps://api.lemonsqueezy.com/v1Lemon Squeezy APINo (read-only)
Twiliohttps://api.twilio.comTwilio REST APIYes, except buying phone numbers
SendGridhttps://api.sendgrid.comSendGrid APIYes
Resendhttps://api.resend.comResend APIYes
Cloudflarehttps://api.cloudflare.comCloudflare APIYes, except domain purchases and AI image or audio models
Vercelhttps://api.vercel.comVercel REST APIYes, except domain purchases
Upstashhttps://api.upstash.com/v2Upstash Developer APIYes
GitHubhttps://api.github.comGitHub REST APIYes, except Sponsors payments
Clerkhttps://api.clerk.com/v1Clerk Backend APIYes
Sentryhttps://sentry.io/api/0Sentry APIYes
PostHoghttps://app.posthog.comPostHog APIYes
Cloudinaryhttps://api.cloudinary.com/v1_1Cloudinary Upload APIYes, except generative AI transformations
Muxhttps://api.mux.comMux APIYes
ElevenLabshttps://api.elevenlabs.io/v1ElevenLabs APINo (read-only)

OAuth credentials (Google, GitHub, Slack, Microsoft, Notion, Spotify, X, LinkedIn, Discord, Zoom, Dropbox, Salesforce, HubSpot) are proxied to the API base URL you set on the credential, and writes work for each of those providers' main API hosts.

What the proxy tools won't do. To meet Anthropic's directory policy, write requests from AI agents are refused when they would move money or generate AI media:

These limits apply only to AI agents using the MCP tools. Your own apps calling the API Locker proxy with a scoped token can still make any of these requests.

Usage examples

Once API Locker is connected, your AI agent can handle credential-related tasks in plain English. Here are three concrete flows, each showing the kinds of prompts that work well and which MCP tools get called under the hood:

Example 1 — Audit my vault health

What you ask Claude:

"Take a look at my API Locker vault. Which keys haven't been rotated in over 90 days, and are any of my scoped tokens close to expiring?"

What Claude does:

All three tools are read-only — no state changes, nothing consumed, nothing charged. This is the safest entry point for a new connection.

Example 2 — Rotate a leaked credential

What you ask Claude:

"I just got an alert that my Stripe live key might be compromised. Generate a new one, store it in the vault, and tell me what to paste into the Stripe dashboard."

What Claude does:

The rotate_key tool carries destructiveHint: true, so Claude will show a confirmation UI before executing. Your existing Stripe API client code continues to work against the proxied endpoint immediately.

Example 3 — Call a real API without exposing the key

What you ask Claude:

"Use my OpenAI key in API Locker to call gpt-4.1-mini with the prompt 'Write a haiku about vault security.' Don't show me the raw key."

What Claude does:

At no point did Claude see your OpenAI API key. proxy_post carries openWorldHint: true and destructiveHint: true because it makes an outbound call that can affect billing or state on the target service, so Claude asks before running it. Read-only lookups go through proxy_get instead. Every call is audit-logged with the source IP, latency, and response status.

Privacy & data handling

API Locker's MCP server handles sensitive data. Here's exactly what we do and don't store:

See our full Privacy Policy for the formal version.

Security

The MCP bridge reads your master token from ~/.apilocker/config.json. This gives the connected MCP client full vault access — the same permissions you have at the CLI. Only connect MCP clients you own and trust completely (Claude Desktop on your own laptop, your own Cursor instance, etc.).

For more restricted scenarios, use the scoped-token auth path: pass a scoped token in the Authorization header when calling the MCP server directly over HTTP. Scoped tokens can only call read tools and the proxy tools (list_keys, reveal_key, proxy_get, etc.) and only for credentials in their pre-approved allowed_keys list. Write tools (store_key, rotate_key, delete_key, device/token management) are rejected for scoped tokens.

For remote MCP connections (OAuth 2.1), scopes are enforced at the token level: vault:read is required for any MCP call, vault:write is additionally required for tools that modify vault state, and vault:proxy is required for the proxy tools. Refresh tokens rotate on use and reuse is treated as token theft (the entire grant family is revoked immediately).

Support

Questions, bug reports, feedback, and security disclosures all have a home:

Want visual confirmation? The dashboard's MCP panel shows the server status, a test-connection button, and a live feed of recent MCP activity. Check there after connecting a client to verify everything's working.

How the bridge works

apilocker mcp runs as a subprocess of your MCP client, speaking the MCP stdio transport: line-delimited JSON-RPC over stdin/stdout. Every message from the client gets forwarded to the HTTPS backend at https://api.apilocker.app/v1/mcp with your master token as the Authorization header. The backend's response is written back to the client's stdout as a single line.

Startup banners are written to stderr (never stdout) so the protocol stream stays clean. If you want to see what the bridge is doing, run apilocker mcp directly in a terminal — you'll see the startup message, and any messages you paste on stdin will be forwarded.

Troubleshooting

Open dashboard MCP panel