Skip to content

fix(web): avoid mcp register route slug conflict#3775

Merged
pandemicsyn merged 1 commit into
mainfrom
fix/mcp-register-route-conflict
Jun 5, 2026
Merged

fix(web): avoid mcp register route slug conflict#3775
pandemicsyn merged 1 commit into
mainfrom
fix/mcp-register-route-conflict

Conversation

@pandemicsyn
Copy link
Copy Markdown
Contributor

@pandemicsyn pandemicsyn commented Jun 5, 2026

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/register path.

This fixes the Next.js runtime error:

You cannot use different slug names for the same dynamic path ('clientId' !== 'scope')

Verification

  • [ ]

Visual Changes

Before After

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.

@pandemicsyn pandemicsyn merged commit 504b24c into main Jun 5, 2026
16 checks passed
@pandemicsyn pandemicsyn deleted the fix/mcp-register-route-conflict branch June 5, 2026 18:15
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