fix(mcp-worker): restore dynamic client registration endpoint - #581
Open
jonathannorris wants to merge 1 commit into
Open
fix(mcp-worker): restore dynamic client registration endpoint#581jonathannorris wants to merge 1 commit into
jonathannorris wants to merge 1 commit into
Conversation
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
devcycle-mcp-server | 6ddd1b3 | Jul 27 2026, 05:02 PM |
There was a problem hiding this comment.
Pull request overview
Restores OAuth Dynamic Client Registration support in the remote MCP worker by reintroducing the clientRegistrationEndpoint option on the Cloudflare Workers OAuth provider, so MCP clients that rely on RFC 7591 can obtain a client_id again.
Changes:
- Re-adds
clientRegistrationEndpoint: '/oauth/register'to theOAuthProviderconfiguration. - Adds an in-code comment explaining why the registration endpoint is required (notably for Claude Code /
mcp-remote).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clientRegistrationEndpoint: '/oauth/register'to the remote MCP worker'sOAuthProviderconfig.mcp-remote).The Problem
#577 removed the registration endpoint on the assumption it was unused ("we don't actually support or use anything to do with client registration"). It was not unused:
@cloudflare/workers-oauth-providerimplements RFC 7591 Dynamic Client Registration automatically wheneverclientRegistrationEndpointis set, and for our server that is the only registration mechanism a client can use (see below).Removing the option has two effects in the library:
/.well-known/oauth-authorization-serverno longer advertises aregistration_endpoint. The field is only emittedif (options.clientRegistrationEndpoint), so it disappears entirely from discovery./oauth/registeris no longer routed and falls through to the default handler, returning404 Not Found.The MCP authorization spec gives clients three ways to register: pre-registered static credentials, Client ID Metadata Documents (CIMD), and Dynamic Client Registration. A client tries them in that order and only falls back to DCR when the first two aren't available. Our server offers neither of the first two, so DCR is the only path left, and #577 turned it off.
When that fallback is reached and the discovery metadata has no
registration_endpoint, the MCP TypeScript SDK throws (inregisterClient(),packages/client/src/client/auth.ts):Claude Code surfaces this with a
SDK auth failed:prefix. This is the exact error users hit onclaude mcp add --transport http devcycle https://mcp.devcycle.com/mcp(and vianpx mcp-remote) since #577 landed. The Claude Code MCP docs call out this error by name under "Authenticate with remote MCP servers".Verified against the live server
registration_endpointis absent andclient_id_metadata_document_supportedisfalse, so a dynamic MCP client has no way to obtain aclient_id.Follow-up
Restoring DCR is the fastest fix and matches how this worked before #577. The MCP spec now lists DCR as
MAY(backwards compatibility) and recommends CIMD for new servers (see the MCP blog post Evolving OAuth Client Registration). If the original removal was security-motivated, supporting CIMD (client_id_metadata_document_supported) is the sanctioned alternative and worth a separate look.Related