# Auth.md

Agent access and registration for superschema.ai.

## What is free

Everything. Every read surface on this site works without an account, a
token, or a key:

- The MCP server at https://superschema.ai/mcp (all three tools:
  check_schema, get_schema, list_registry)
- The public API described at https://superschema.ai/openapi.json
- All markdown content, sitemaps, and discovery files

There is no paid API tier and nothing behind the OAuth flow that anonymous
callers cannot see. Registration exists for rate limits and identity, not
access.

## Rate limits (enforced, per minute)

| tier | limit | keyed by |
|---|---|---|
| anonymous MCP calls | 30 | IP address |
| registered MCP calls | 120 | client_id |
| absolute ceiling | 240 | IP address, regardless of client_id |
| POST /mcp/register | 10 | IP address |
| /mcp/authorize and /mcp/token | 30 | IP address |

Over the limit you get HTTP 429 with a Retry-After header. The public REST
API under /api is separately limited to 100 requests per 15 minutes per IP.

## What registering does NOT unlock

The same data, faster. That is all. No extra tools, no private fields, no
write access. If 30 calls per minute is enough for you, do not bother
registering.

## How to register (OAuth 2.0 dynamic client registration, RFC 7591)

Registration is open: no approval step, no secret handshake.

1. POST https://superschema.ai/mcp/register with JSON:
   {"client_name": "your-agent", "redirect_uris": ["https://your.app/callback"]}
   (http://localhost redirect URIs are accepted for CLI and native clients)
2. Authorization code flow with PKCE S256 at /mcp/authorize (the only
   accepted code_challenge_method; plain is rejected). Public clients are
   expected: token_endpoint_auth_method is "none".
3. Exchange the code at /mcp/token. Access tokens last 1 hour, refresh
   tokens 30 days.
4. Call the MCP endpoint with Authorization: Bearer <access_token>.

Complete flow, copy-paste ready:

```
# 1. Register (open, instant)
curl -s -X POST https://superschema.ai/mcp/register \
  -H 'Content-Type: application/json' \
  -d '{"client_name":"my-agent","redirect_uris":["http://localhost:9999/cb"]}'
# -> {"client_id":"...","client_secret":"...","token_endpoint_auth_method":"none",...}

# 2. Authorize with PKCE S256 (auto-approves, returns code on your redirect_uri)
# GET https://superschema.ai/mcp/authorize?response_type=code&client_id=CLIENT_ID
#     &redirect_uri=http://localhost:9999/cb&code_challenge=CHALLENGE
#     &code_challenge_method=S256&state=STATE

# 3. Exchange the code
curl -s -X POST https://superschema.ai/mcp/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=authorization_code' \
  --data-urlencode 'code=CODE' \
  --data-urlencode 'redirect_uri=http://localhost:9999/cb' \
  --data-urlencode 'client_id=CLIENT_ID' \
  --data-urlencode 'code_verifier=VERIFIER'
# -> {"access_token":"...","token_type":"Bearer","expires_in":3600,...}

# 4. Call the MCP endpoint
curl -s https://superschema.ai/mcp \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"my-agent","version":"1.0"}}}'
```

Machine-readable metadata:
- https://superschema.ai/.well-known/oauth-authorization-server
- https://superschema.ai/.well-known/oauth-protected-resource (origin) and /.well-known/oauth-protected-resource/mcp (MCP resource)
- https://superschema.ai/.well-known/mcp/server-card.json

## Notes

- Authorization auto-approves: every tool reads only public data and there
  is no user identity involved, so there is nothing to consent to.
- Client credentials are self-encoded and survive server restarts. If a
  credential ever stops verifying, simply register again.
- Contact: https://superschema.ai/contact
