Skip to content

refactor: simplify and harden framework-mounted MCP routes - #176

Merged
quuu merged 4 commits into
mainfrom
docs/framework-agnostic-readme
Jul 29, 2026
Merged

refactor: simplify and harden framework-mounted MCP routes#176
quuu merged 4 commits into
mainfrom
docs/framework-agnostic-readme

Conversation

@quuu

@quuu quuu commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • describe mcp-handler as a framework-agnostic Web Request/Response adapter
  • mount one static Streamable HTTP route instead of generating a dynamic transport route
  • remove internal endpoint derivation and legacy SSE/message response handling
  • keep removed 1.x config keys as ignored 2.x type compatibility shims
  • preserve explicit auth handoff without request-global async context
  • reject unexpected browser Origins and support an explicit allowedOriginHostnames list
  • preserve Allow: POST on stateless 405 responses and isolate sync/async event-hook failures
  • make the CLI support src/app, --no-install, and safe refusal to overwrite existing routes
  • fix the CommonJS type declaration export and ship documentation linked from the npm README

Validation

  • pnpm test: 44 tests across 6 files
  • SDK 1.26 client connect, discovery, and tool call
  • SDK 2 client in legacy and pinned 2026-07-28 modes
  • concurrent auth isolation plus required, scope, expiry, and verifier failure paths
  • raw HTTP media type, malformed JSON, Origin, method, route, and event failure boundaries
  • generated CLI route and packed CJS/ESM artifact smoke tests
  • pnpm build
  • pnpm exec tsc --noEmit --noUnusedLocals --noUnusedParameters
  • git diff --check
  • linked package in the mcp-for-next.js template: production build and type check pass
  • MCP Inspector CLI: tools/list, valid and invalid tools/call, and a dynamic custom mount path pass

Release

Includes a patch changeset for mcp-handler.

@quuu quuu changed the title docs: describe framework-agnostic adapter refactor: simplify framework-mounted MCP routes Jul 29, 2026
@quuu
quuu merged commit e6e6378 into main Jul 29, 2026
2 checks passed
@quuu quuu changed the title refactor: simplify framework-mounted MCP routes refactor: simplify and harden framework-mounted MCP routes Jul 30, 2026
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.

1 participant