This page is only relevant if you’re building an MCP client. End users don’t need to know any of this - their MCP client handles the OAuth flow automatically.
Overview
Mokaru’s MCP server implements OAuth 2.1 (RFC 6749, RFC 9700) with:- PKCE (RFC 7636, S256 only -
plainis rejected) - Dynamic Client Registration (RFC 7591)
- Authorization Server Metadata (RFC 8414)
- Refresh Token Rotation with reuse detection
Discovery
Step 1: Register your client
https:// URIs or http://localhost / http://127.0.0.1 loopback. No http:// on public hosts.
Step 2: Authorize
Generate a PKCE pair:Step 3: Exchange code for tokens
Step 4: Call /mcp
Use the access token as a Bearer:Step 5: Refresh
Token format
Access and refresh tokens are JWTs (HS256) with these claims:Error responses
OAuth errors follow RFC 6749:Reference implementations
- MCP TypeScript SDK handles all of this automatically when given just the server URL.
- MCP Python SDK ditto.
- Claude Desktop, Claude.ai, Cursor, Continue: built-in MCP OAuth support.
