Skip to content

fix: accept trailing slash endpoints#162

Open
EfeDurmaz16 wants to merge 1 commit into
vercel:mainfrom
EfeDurmaz16:efe/normalize-trailing-slash-routes
Open

fix: accept trailing slash endpoints#162
EfeDurmaz16 wants to merge 1 commit into
vercel:mainfrom
EfeDurmaz16:efe/normalize-trailing-slash-routes

Conversation

@EfeDurmaz16
Copy link
Copy Markdown

Summary

Allows MCP endpoint matching to tolerate trailing slash redirects, e.g. /mcp/ when Next.js trailingSlash is enabled.

Fixes #143.

Changes

  • Normalize request pathnames before comparing them with configured MCP endpoints
  • Preserve root path behavior
  • Apply the same normalization to streamable HTTP, SSE, and SSE message endpoints
  • Add unit coverage for trailing slash normalization

Verification

  • pnpm install --frozen-lockfile
  • pnpm test tests/mcp.test.ts
  • pnpm build
  • git diff --check

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.

Doesn't seem to work with trailingSlash: true

1 participant