fix(web): avoid mcp register route slug conflict#3775
Merged
Conversation
emilieschario
approved these changes
Jun 5, 2026
johnnyeric
approved these changes
Jun 5, 2026
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
Renames the MCP gateway dynamic client registration route from
[clientId]to[scope]so it no longer conflicts with the scoped registration route under the same/ api/mcp-gateway/oauth/registerpath.This fixes the Next.js runtime error:
You cannot use different slug names for the same dynamic path ('clientId' !== 'scope')Verification
Visual Changes
Reviewer Notes
Next.js requires sibling dynamic route segments at the same path level to use the same parameter name.
This PR had both:
/api/mcp-gateway/oauth/register/[clientId]
/api/mcp-gateway/oauth/register/[scope]/[ownerId]/[configId]/[routeKey]
At the first dynamic segment under /register, Next sees two route-tree entries for the same URL position:
/register/:clientId
/register/:scope/...
Even though one route is shorter and one has more segments after it, they still share that first dynamic segment position. Next cannot build one route matcher where the
same segment is sometimes named clientId and sometimes named scope, so it throws:
You cannot use different slug names for the same dynamic path ('clientId' !== 'scope')
The fix renames [clientId] to [scope] so the route tree is internally consistent:
/api/mcp-gateway/oauth/register/[scope]
/api/mcp-gateway/oauth/register/[scope]/[ownerId]/[configId]/[routeKey]
The public URL behavior is unchanged. In the one-segment handler, we just treat scope as the old clientId value internally.