# Authenticate an MCP client

Resource: https://mcp.fakten.io/mcp

## Keyless sandbox

Omit the Authorization header. Initialization, ping and tool discovery are public. Use search_catalog and query_official_stats for sandbox reads.

Keyless sandbox calls cost 0 credits. Each IP can make two concurrent calls and 30 requests per minute to the T1 catalog and national German macro series.
A free account requires no credit card and includes 2,000 monthly credits for API-key requests and 2,000 monthly OAuth MCP calls.

Connect your CLI to the Streamable HTTP endpoint:

    claude mcp add --transport http fakten https://mcp.fakten.io/mcp
    codex mcp add fakten --url https://mcp.fakten.io/mcp
    gemini mcp add --transport http fakten https://mcp.fakten.io/mcp

## OAuth for Claude, ChatGPT, Langdock and Copilot Studio

1. Read https://mcp.fakten.io/.well-known/oauth-protected-resource/mcp (RFC 9728). A protected call returns HTTP 401 with this URL in WWW-Authenticate.
2. Discover issuer https://fakten.io via https://fakten.io/.well-known/oauth-authorization-server or https://fakten.io/.well-known/oauth-authorization-server/api/mcp/v1/b2b (RFC 8414).
3. Supply a supported HTTPS Client ID Metadata Document (CIMD) or register a public client at https://fakten.io/api/oauth/register (DCR). Register the exact redirect URI. Tenant-specific DCR callbacks require operator registration.
4. Start an authorization-code grant at https://fakten.io/api/oauth/authorize with PKCE S256, state, resource=https://mcp.fakten.io/mcp and scope=mcp:b2b. Sign in to your fakten.io account and approve the grant. Validate state and the authorization response issuer.
5. Exchange the code and verifier at https://fakten.io/api/oauth/token with the same resource and redirect URI. Send Authorization: Bearer <access_token>. Refresh with the same resource. Legacy MCP tokens have a separate audience.

Store OAuth metadata advertises scopes_supported: ["mcp:b2b"] for all seven tools. API keys and existing tokens also support narrower scopes: mcp:read and data:read permit reads, verify:write permits verification and job polling, mcp:b2b permits all seven tools. OAuth requests use the account's monthly MCP quota.

## API keys

Send Authorization: Bearer fk_live_<32 hex digits> (or fk_test_<32 hex digits>). Set mcp:b2b for the whole MCP server or data:read / verify:write for narrower access. Other API-key scopes are geo:read (REST geography), answers:read, monitors:write and batches:write. Keep keys on the client backend.

Monthly API-key prices are net of VAT.

| Plan | Price | Monthly API credits |
| --- | --- | ---: |
| Free (AX Sandbox) | 0 € | 2,000 |
| Pro | 149 €/Mo | 25,000 |
| Team / Business | 690 €/Mo | 150,000 |
| Enterprise / Sovereign | 18.000–48.000 €/Jahr | By agreement |

## Recovery

- 401: use the advertised metadata, refresh an expired token or supply a valid key.
- 402: inspect creditsRequired and creditsRemaining in the structured error. Refill credits or shorten the document.
- 403: check granted scopes, resource audience, license eligibility and sandbox scope.
- 429: observe Retry-After when supplied. For a monthly quota exhaustion, wait for the next UTC billing month. Use X-RateLimit-Mode, X-RateLimit-Concurrency-Limit and X-RateLimit-Concurrency-Remaining to schedule calls. Successful metered responses report X-Fakten-Credits-Used and X-Fakten-Credits-Remaining.

Use GET on the MCP resource for health and OPTIONS for CORS discovery. POST requests have a 256 KiB body limit except base64 audit files (10 MiB decoded).
