Skip to content

fix: disable CIMD to prevent size limit errors on /authorize#46

Merged
mattzcarey merged 2 commits intomainfrom
fix/disable-cimd
Feb 26, 2026
Merged

fix: disable CIMD to prevent size limit errors on /authorize#46
mattzcarey merged 2 commits intomainfrom
fix/disable-cimd

Conversation

@mattzcarey
Copy link
Contributor

Summary

  • Removes the global_fetch_strictly_public compatibility flag from wrangler.jsonc, which disables Client ID Metadata Document (CIMD) support in @cloudflare/workers-oauth-provider

Problem

When MCP clients use a URL as their client_id (e.g. https://claude.ai/oauth/mcp-oauth-client-metadata), the OAuth provider fetches the metadata document from that URL. The library enforces a 5KB size limit on the response, and some client metadata documents exceed this, causing:

Error: Response exceeded size limit of 5120 bytes

This results in a 500 error page on /authorize — users see "Server Error" immediately when trying to connect. We found 68 such errors on /authorize in the last 24 hours via Workers Observability telemetry.

Fix

Removing global_fetch_strictly_public from compatibility flags makes the library report client_id_metadata_document_supported: false in the OAuth metadata discovery endpoint. Clients then fall back to Dynamic Client Registration (DCR) instead of CIMD, avoiding the size limit entirely.

Test plan

  • npm run check passes (format, lint, typecheck, 69 tests)
  • Library logs expected warning: "CIMD is disabled"
  • Clients using URL-based client_ids will use DCR instead

Fixes #45

mattzcarey and others added 2 commits February 26, 2026 21:17
Remove the global_fetch_strictly_public compatibility flag which
enabled Client ID Metadata Document (CIMD) fetching. When clients
use a URL as their client_id (e.g. claude.ai), the library fetches
metadata from that URL with a 5KB size limit, causing "Response
exceeded size limit of 5120 bytes" errors on /authorize.

With CIMD disabled, the OAuth metadata endpoint reports
client_id_metadata_document_supported: false and clients fall back
to Dynamic Client Registration (DCR) instead.

Fixes #45
@mattzcarey mattzcarey merged commit 76be264 into main Feb 26, 2026
4 checks passed
@mattzcarey mattzcarey deleted the fix/disable-cimd branch February 26, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Authorize consent page fails with 'Response exceeded size limit of 5120 bytes'

1 participant