Protect your MCP server
Use OhAuthCat as the authorization server for your own MCP server, following the MCP Authorization specification.
If you run a Model Context Protocol (MCP) server, OhAuthCat can be its authorization server. MCP clients such as AI assistants then discover how to sign in, register themselves, ask your user for consent and get short-lived tokens for your server only. This follows the MCP Authorization specification (2025-06-18 and 2025-11-25), RFC 9728, RFC 7591, RFC 7592 and RFC 8707.
Set it up
Section titled “Set it up”- Register your server as a resource:
POST /withv1/ oauth/ resources kind: "mcp", its absolutehttpsidentifier (the URL clients use), itsscopesanddynamic_registration: true. MCP tokens last 5 minutes by default. - Fetch the protected resource metadata with
GET /and serve that JSON atv1/ oauth/ resources/ {resource}/ protected_resource_metadata /on your server.. well-known/ oauth-protected-resource - When a request has no valid token, answer
401withWWW-Authenticate: Bearer resource_metadata="<that metadata URL>." - On every request, verify the bearer token: ES256 signature from the issuer’s
/jwks,typ: at+jwt, the issuerhttps:,/ / login. ohauthcat. com/ oauth/ <environment id> audequal to your identifier exactly, and an unexpiredexp. Checkscopefor the tool being called.
The CLI does steps 1 and 2 with ohauthcat mcp-auth resources create and ohauthcat mcp-auth resources metadata.
What clients do
Section titled “What clients do”The client reads your metadata, finds the OhAuthCat issuer, registers itself at /register (open registration exists only while some resource allows it, limited to 10 registrations an hour per address and 100 an hour per environment), runs the authorization code flow with PKCE and resource, and shows your user a consent screen. Dynamically registered clients are always third-party, must name one resource that allows dynamic registration and cannot use client credentials.
Agents and revocation
Section titled “Agents and revocation”GET /v1/oauth/grants lists what users have authorized; grants of dynamic clients carry agent: true. Revoke one grant, every grant of a user, or every grant of an organization’s members (POST /).
OhAuthCat’s own hosted MCP server, which manages your OhAuthCat project, still uses API keys.