KeyFlint GitHub

Passwordless OAuth 2.1 (6-Digit OTP) for Remote MCP Servers

Asking non-technical users to copy a 140-character LIC-... bearer token into claude_desktop_config.json kills conversion. Here is how to let users connect a remote MCP server with one URL and a 6-digit email code.

Why OAuth 2.1 + KeyFlint?

Modern MCP clients (Claude Desktop, Claude.ai Connectors, Cursor) support remote Streamable HTTP MCP servers protected by OAuth 2.1 with PKCE (RFC 8414 + RFC 9728). Instead of building a full user-password identity provider, your MCP edge router can map verified email addresses directly to KeyFlint Ed25519 licenses.

StepProtocol EndpointWhat happens
1. ChallengePOST /<slug>/mcp → 401Returns WWW-Authenticate: Bearer resource_metadata=".../.well-known/oauth-protected-resource".
2. Discovery & DCR/.well-known/oauth-authorization-server, /oauth/registerMCP client registers dynamically and starts PKCE authorization (S256).
3. 6-Digit Email OTPGET /authorizeUser enters their email and a 6-digit code sent via Resend.
4. License ResolutionGET /api/v1/licenses/by-customerGateway returns the active licenses for that email. If there are none, the hub issues a 25-credit Community trial via POST /api/v1/licenses/issue.
5. Token ExchangeToken endpointIssues a short-lived OAuth access token bound to that LIC-... license. Every subsequent tool call is metered atomically against it.

Querying Active Licenses by Email

KeyFlint v1.2+ includes an admin-protected endpoint that resolves all active, non-expired, non-revoked licenses for a verified email address, sorted with paid tiers first and highest credit balance first:

GET https://licenses.your-domain.com/api/v1/licenses/by-customer?email=user%40company.com
X-Admin-Key: <YOUR_ADMIN_API_KEY>

Response:

{
  "success": true,
  "data": [
    {
      "key": "LIC-PRO-eyJ...",
      "tier": "pro",
      "status": "active",
      "name": "Licencia PRO (3 puestos)",
      "credits": 980,
      "max_seats": 3,
      "expires_at": "2027-11-09T00:00:00+00:00"
    }
  ]
}

Zero-Click Trial Fallback

If /api/v1/licenses/by-customer returns an empty list, your OAuth authorize handler can either:

See It Live in Production

This exact architecture powers Flint by KeyFlint across 5 remote MCP servers, including our unified 17-tool accounting connector at https://mcp.keyflint.dev/despacho/mcp.

Get KeyFlint Gateway Guide: Paid MCP Server