| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
Some checks failed
Conformance Tests / client-conformance (push) Has been cancelled
Conformance Tests / server-conformance (push) Has been cancelled
Deploy Docs / deploy-docs (push) Has been cancelled
Examples / examples (build + e2e) (push) Has been cancelled
/ build (push) Has been cancelled
/ test (20) (push) Has been cancelled
/ test (22) (push) Has been cancelled
/ test (24) (push) Has been cancelled
/ test-e2e (20) (push) Has been cancelled
/ test-e2e (22) (push) Has been cancelled
/ test-e2e (24) (push) Has been cancelled
/ test-runtimes (bun, 1.x) (push) Has been cancelled
/ test-runtimes (deno, v2.x) (push) Has been cancelled
Publish Any Commit / pkg-publish (push) Has been cancelled
Release / Version (push) Has been cancelled
Release / Publish (push) Has been cancelled
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> |
||
| .. | ||
| express | ||
| fastify | ||
| hono | ||
| node | ||
| README.md | ||
Middleware packages
The packages in packages/middleware/* are thin integration layers that help you expose an MCP server in a specific runtime, platform, or web framework.
They intentionally do not add new MCP features or “business logic”. MCP functionality (tools, resources, prompts, transports, auth primitives, etc.) lives in @modelcontextprotocol/server (and other core packages). Middleware packages should primarily:
- adapt request/response types to the SDK (e.g. Node.js
IncomingMessage/ServerResponse) - provide small framework helpers (e.g. wiring, body parsing hooks)
- supply safe defaults for common deployment pitfalls (e.g. localhost DNS rebinding protection)
Packages
@modelcontextprotocol/express— Express helpers (app defaults + Host header validation for DNS rebinding protection).@modelcontextprotocol/fastify— Fastify helpers (app defaults + Host header validation).@modelcontextprotocol/hono— Hono helpers (app defaults + JSON body parsing hook + Host header validation).@modelcontextprotocol/node— Node.js Streamable HTTP transport wrapper forIncomingMessage/ServerResponse.
Typical usage
Most servers use:
@modelcontextprotocol/serverfor the MCP server implementation- one middleware package for framework/runtime integration (this folder)
- (optionally) additional platform/framework dependencies (Express, Hono, etc.)