-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[v2] Decouple server from express and hono - http framework-agnostic MCP server
#1326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[v2] Decouple server from express and hono - http framework-agnostic MCP server
#1326
Conversation
…port, add server-express, server-hono to pkg.pr.new
|
commit: |
|
Notes:
TODOs still:
node_modules size
Biggest offender in TODO: Consider if zod v3 is to be supported in |
v1includedexpress(andhonoin recent version), forcing the dependency down to users. (expressbeing >1MB along with middleware deps such asexpress-rate-limitetc.).Achieving final & true implementation of #1299
This PR decouples
@modelcontextprotocol/serverfrom HTTP frameworks completely, and introduces two plugin packages@modelcontextprotocol/server-expressand@modelcontextprotocol/server-hono.The plugin packages are optional, and users could choose to use them or to map to the MCP SDK themselves and not using any of these plugins.
However, the
@modelcontextprotocol/serveris completely HTTP framework dependency-free.Some additional changes:
StreamableHTTPServerTransporttoNodeStreamableHTTPServerTransportimport { A, type B}). Preferimport type { B }andimport { A }on separate lines.expressdependency from@modelcontextprotocol/servercompletely@modelcontextprotocol/server-expressand@modelcontextprotocol/server-hono- each having its own minimum dependenciesssetransport for server (deprecated)serverauthbetter-auth)better-authserver auth demo examples with@modelcontextprotocol/inspectorMotivation and Context
v2
How Has This Been Tested?
Unit tests
Breaking Changes
v2
Types of changes
Checklist
Additional context
node_modules size
Biggest offender in
serveriszod-to-json-schema-19MBstill.TODO: Consider if zod v3 is to be supported in
v2-> will reduce package dependency size onserverto 12MB.