# AuthPlane

> Open-source, self-hosted OAuth 2.1 authorization server purpose-built for the Model Context Protocol (MCP). One Go binary, deployed alongside your MCP server, so tokens never leave your perimeter.

- License: AGPL-3.0 (server), Apache-2.0 (SDKs)
- Spec: MCP Authorization 2025-11-25 · OAuth 2.1 with mandatory PKCE-S256
- Ports: `:9000` (OAuth) · `:9001` (Admin UI)
- Status: v0.1.x — validated end-to-end against Claude Desktop, Cursor, VS Code, and MCP Inspector
- Canonical HTML: https://authplane.ai/

## Hero

**OAuth for MCP in 5 lines. Open source. Free.**

AuthPlane is the open-source authorization server for MCP servers. One Go binary. Deploy it alongside your MCP server and have a spec-compliant OAuth 2.1 layer running in under 10 minutes without writing a line of auth code.

## Quickstart — one command

```bash
export AUTHPLANE_ADMIN_API_KEY="$(openssl rand -hex 32)"
export AUTHPLANE_SESSION_SECRET="$(openssl rand -hex 32)"
docker run -p 9000:9000 -p 9001:9001 \
  -e AUTHPLANE_ADMIN_API_KEY \
  -e AUTHPLANE_SESSION_SECRET \
  -e AUTHPLANE_CLIENT_CREDENTIALS_ENABLED=true \
  -e AUTHPLANE_DPOP_ENABLED=true \
  -e AUTHPLANE_TOKEN_EXCHANGE_ENABLED=true \
  -v authserver-data:/data \
  ghcr.io/authplane/authserver:latest serve
```

Open http://localhost:9001/admin/ui/ and paste the printed API key. OAuth endpoints are live on http://localhost:9000. Full quickstart: https://docs.authplane.ai/quickstart/

## Authorization infrastructure for MCP servers

Building an MCP server takes an afternoon. Securing it correctly takes much longer — OAuth 2.1 flows, token issuance, refresh, revocation, scope enforcement, DPoP, agent delegation chains, and a stack of RFCs. None of that is the problem you actually want to solve.

AuthPlane sits alongside your MCP server, not in front of it. No proxy, no traffic interception, no extra hop on your request path. Your server uses the AuthPlane SDK to validate tokens locally against the JWKS. Everything else — discovery, consent, token issuance, audit — is AuthPlane's job.

### When to use AuthPlane

1. **You're building an MCP server that needs real auth.** Proper OAuth 2.1 with scopes, token lifecycle management, and a discovery endpoint — not API keys in environment variables.
2. **You need to run it inside your own perimeter.** Finance, healthcare, and government teams that can't route tokens through a cloud IdP — data residency, on-prem mandates, compliance constraints. Your keys never leave.
3. **You're building for AI agents.** MCP servers, agent pipelines, and multi-agent workflows where tokens carry delegation chains, DPoP binding, and per-agent identity. The full act-claim chain is auditable.
4. **You want to federate without losing control.** Connect Google, Okta, Azure AD, Auth0, or any OIDC-compliant IdP. AuthPlane handles the OAuth layer and issues the tokens — you keep your access policy.

Auth0, WorkOS, and Descope work well for many use cases. AuthPlane is for the ones where those don't fit: MCP auth, regulated environments, and self-hosted agent infrastructure.

## What you get

- **OAuth 2.1 authorization server** — authorize, consent, token issuance, refresh, revocation, with mandatory PKCE-S256. Implements the MCP Authorization spec 2025-11-25 end to end.
- **Token Vault** — store GitHub, Slack, Linear, Google refresh tokens encrypted at rest; vend fresh access tokens to agents on demand via Token Exchange. No agent ever touches a long-lived credential.
- **Federation to your existing IdP** — Google, Okta, Azure AD, Auth0, anything OIDC-compliant.
- **Agent-to-agent delegation** — every hop recorded as an act-claim chain inside the issued token and the audit log.
- **DPoP proof-of-possession** — cryptographically binds tokens to the client's key so a leaked token can't be replayed (RFC 9449).
- **Embedded Admin UI** — React dashboard built into the same binary.
- **Zero-config dev mode** — SQLite, auto-generated signing keys, sensible defaults.
- **Production-ready** — PostgreSQL with cross-instance LISTEN/NOTIFY, OpenTelemetry, Prometheus, Helm chart, HashiCorp Vault Transit.

## SDKs

Released: Go (`authplane/go-sdk`), TypeScript (`authplane/ts-sdk`), Python (`authplane/python-sdk`). Planned: Rust, C#, Java. Each SDK covers JWT validation against the JWKS, scope enforcement, the `/.well-known/oauth-protected-resource` endpoint (RFC 9728), DPoP proof verification (RFC 9449), the full OAuth client (Client Credentials, Token Exchange RFC 8693, Introspection, Revocation), and ConsentRequiredError decoding for the broker flow.

## Learn more

- Product: https://authplane.ai/product/
- Docs: https://docs.authplane.ai/
- Full context dump for LLMs: https://authplane.ai/llms-full.txt
- Machine-readable index: https://authplane.ai/llms.txt
- GitHub: https://github.com/authplane/authserver
