Express Mcp Handler
Createdjhgaylor
Integrates the Model Context Protocol (MCP) into Express applications with lightweight stateful, stateless, and SSE middleware.
About
Express Mcp Handler is a middleware designed to simplify the integration of Model Context Protocol (MCP) into Express applications. It offers three handler types—stateful, stateless, and SSE—to accommodate diverse communication needs between LLMs and external tools. With features like type-safe APIs, flexible configuration, and seamless Express integration, this tool allows developers to efficiently build robust and scalable MCP-compatible applications, whether they require session management, real-time streaming, or simple one-off interactions.
Key Features
- Supports stateful, stateless, and SSE handler modes.
- Offers flexible configuration options for error handling, session management, and lifecycle hooks.
- Provides type-safe APIs built with TypeScript.
- Seamlessly integrates with Express routes using middleware pattern.
- Enables real-time streaming responses using Server-Sent Events (SSE).
- 0 GitHub stars
Use Cases
- Handling one-off requests in serverless environments with stateless mode.
- Maintaining context across multiple interactions using stateful sessions.
- Building real-time applications with MCP over Server-Sent Events (SSE).