Skip to content

MCPGate

API key lifecycle management built for AI. Issue, verify, and revoke keys for MCP servers and AI agents with a single lightweight service.

Modern AI applications need machine-to-machine authentication. OAuth is designed for humans — MCPGate is designed for agents.

SolutionProblem
Roll your ownBcrypt limits, key parsing bugs, no audit trail
API Gateway (Kong, etc.)Heavy, expensive, complex config for a simple use case
OAuth tokensDesigned for human login flows, not machine clients
Static secretsNo rotation, no scopes, no revocation, no audit

MCPGate fills the gap — a purpose-built API key service with Stripe-style keys, bcrypt storage, O(1) verification, and a ~50MB container.

Stripe-style keys

Human-readable format: mcp_sk_<id>_<secret>. The public ID is embedded in the key for O(1) database lookups — no full table scans.

Cryptographically secure

Keys are SHA-256 pre-hashed then bcrypt-stored. The plain-text key is shown once at creation and never stored.

Sub-millisecond verify

The /verify endpoint extracts the public ID from the key, does a single indexed DB lookup, then runs bcrypt — fast enough for every MCP request.

Scopes & expiry

Attach arbitrary JSON scopes to any key. Set optional expiry dates. Soft and hard revocation both supported.

Kubernetes-ready

Helm chart with HPA, PDB, health checks, non-root user, read-only filesystem, topology spread constraints.

Drop-in sidecar

Runs alongside any existing auth provider (Auth0, Clerk, Firebase). Handles machine auth so your OAuth handles human auth.

1. Deploy

Terminal window
curl -O https://raw.githubusercontent.com/gatesuite/mcpgate/main/docker-compose.yml
export ADMIN_API_KEY=$(python3 -c "import secrets; print(secrets.token_hex(32))")
docker compose up -d

2. Create a key

Terminal window
curl -X POST http://localhost:8000/api/v1/keys \
-H "Authorization: Bearer $ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user_id": "user_123", "name": "Claude Desktop"}'

3. Verify on every request

Terminal window
curl -X POST http://localhost:8000/api/v1/verify \
-H "Content-Type: application/json" \
-d '{"key": "mcp_sk_..."}'
# → {"valid": true, "user_id": "user_123", "scopes": null}

A common path is to roll your own key service. Here’s what you get with MCPGate instead:

MCPGateDIY
Key formatmcp_sk_<id>_<secret> — scannable, unambiguousWhatever you build
StorageSHA-256 pre-hash + bcrypt — correct by defaultEasy to get wrong (truncation bugs, plain-text leaks)
Lookup speedO(1) — public ID indexed in DBOften O(n) — full table scan
ScopesJSON blob on every keyRequires extra schema work
ExpiryBuilt-in, checked on every verifyOften forgotten
RevocationHard delete via APIVaries
Audit traillast_used_at updated on every verifyRequires extra work
DeploymentSingle container, Helm chart includedYou build it