Skip to content

Add public OAuth CIMD with default hosted document and --callback-port#187

Merged
jancurn merged 7 commits into
mainfrom
claude/add-public-oauth-profile-AcE6w
Apr 17, 2026
Merged

Add public OAuth CIMD with default hosted document and --callback-port#187
jancurn merged 7 commits into
mainfrom
claude/add-public-oauth-profile-AcE6w

Conversation

@jancurn

@jancurn jancurn commented Apr 17, 2026

Copy link
Copy Markdown
Member

Summary

mcpc now ships with a hosted Client ID Metadata Document (CIMD) so every installation presents a consistent client identity to CIMD-capable authorization servers — the same pattern used by VS Code and Claude Code.

Key changes

  • Hosted CIMD at client-metadata.json: published at the repo root via GitHub Pages. The URL follows VS Code's naming convention (client-metadata.json) and serves as the client_id on CIMD-capable servers.
  • Default CIMD: mcpc login now uses the hosted CIMD by default — no flags needed. Override with --client-metadata-url <url> or disable with --no-client-metadata-url to force DCR.
  • Fixed OAuth callback port range (13316–13325): CIMD documents are static, so the AS does exact-match on redirect_uris. All 10 ports × both 127.0.0.1 and localhost forms are pre-registered in the hosted document. Ports are tried in order; concurrent logins get different ports.
  • --callback-port <port>: new flag to completely override the port (useful for pre-registered clients, CI, or environments where the default range is unavailable).
  • Stricter CIMD URL validation: validateClientMetadataUrl() now enforces the full spec — rejects fragments, embedded credentials, and ./.. path segments (per draft-ietf-oauth-client-id-metadata-document).
  • GitHub Pages setup: added _config.yml at repo root so https://apify.github.io/mcpc/ renders the project README. Requires changing the Pages source in repo Settings from main/docs to main/(root).
  • DCR metadata parity: the in-code clientMetadata getter now includes logo_uri, tos_uri, policy_uri so DCR-registered clients also show branding.

Test plan

  • npm run lint passes
  • npm run build passes
  • npm run test:unit passes (532 tests, 18 suites)
  • New unit tests for validateClientMetadataUrl (fragment, creds, dot segments)
  • New E2E tests for CLI flag validation and --no-client-metadata-url help
  • Manual: change GitHub Pages source to main/(root) and verify both URLs work
  • Manual: test mcpc login against a CIMD-capable AS

https://claude.ai/code/session_015YnY1wPJF48HUrfdPaFJ1x

claude added 6 commits April 17, 2026 23:02
Host a Client ID Metadata Document (CIMD) at
https://apify.github.io/mcpc/client-metadata/v1.json so every mcpc
installation presents a consistent client identity on CIMD-capable
authorization servers. This follows the same pattern as VS Code and
Claude Code.

Key changes:
- New docs/client-metadata/v1.json served via GitHub Pages
- mcpc login now defaults to the hosted CIMD; use --no-client-metadata-url
  to opt out or --client-metadata-url <url> to override
- OAuth callback uses fixed port range 13316-13325 to match the CIMD's
  registered redirect_uris (CIMD docs are static, so exact-match ports
  are required by most authorization servers)
- Tightened CIMD URL validation per the spec: reject fragments, embedded
  credentials, and dot path segments
- Added logo_uri, tos_uri, policy_uri to the DCR client metadata getter
  for branding parity with the hosted CIMD

https://claude.ai/code/session_015YnY1wPJF48HUrfdPaFJ1x
Drop the branching between CIMD and non-CIMD port ranges. Using the same
fixed range in all modes (CIMD, DCR, pre-registered --client-id) makes
the callback port predictable for firewalls, docs, and pre-registered
clients, and removes a chunk of conditional logic. Pre-registered
clients can rely on RFC 8252 loopback-any-port semantics or list the
mcpc range in their redirect URIs, same as before.

https://claude.ai/code/session_015YnY1wPJF48HUrfdPaFJ1x
Matches the draft-ietf-oauth-client-id-metadata-document spec example
URL (https://example.com/client.json) and trims 13 chars off the
displayed client_id on consent screens.

https://claude.ai/code/session_015YnY1wPJF48HUrfdPaFJ1x
Move client.json from docs/ to the repo root and add a minimal
_config.yml excluding dev dirs, so https://apify.github.io/mcpc/ shows
the project README and https://apify.github.io/mcpc/client.json serves
the OAuth CIMD.

Note: requires changing the GitHub Pages source in repo Settings from
"main / docs" to "main / (root)".

https://claude.ai/code/session_015YnY1wPJF48HUrfdPaFJ1x
- Resolve merge conflicts with origin/main (CHANGELOG, oauth-flow.ts)
- Rename client.json → client-metadata.json to match VS Code's naming
  convention (most self-documenting industry pattern)
- Add --callback-port <port> option to mcpc login, allowing callers to
  completely override the default port range (13316–13325)
- Adopt main's 127.0.0.1 redirect URL change

https://claude.ai/code/session_015YnY1wPJF48HUrfdPaFJ1x
@jancurn jancurn changed the title Add Client ID Metadata Document (CIMD) support with fixed port range Add public OAuth CIMD with default hosted document and --callback-port Apr 17, 2026
- logo_uri → client-logo.svg (served via GitHub Pages)
- tos_uri → LICENSE on GitHub Pages (not raw GitHub blob URL)
- Remove policy_uri (no standalone privacy policy page)

https://claude.ai/code/session_015YnY1wPJF48HUrfdPaFJ1x
@jancurn jancurn merged commit 6205f25 into main Apr 17, 2026
6 checks passed
@jancurn jancurn deleted the claude/add-public-oauth-profile-AcE6w branch April 17, 2026 23:59
jancurn pushed a commit that referenced this pull request Apr 18, 2026
PR #187 set `logo_uri` in client-metadata.json to
https://apify.github.io/mcpc/client-logo.svg, but the file was never
committed, so OAuth authorization servers consuming the CIMD got a 404
when trying to display the client logo on consent screens.

Adds a Swiss Army knife illustration with an MCP emblem on the handle,
matching the README's "Swiss Army knife for MCP" positioning.

https://claude.ai/code/session_014ooBBpJAUWAcUkGXHpgGo8
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.

3 participants