What is MultiServerMCP?
MultiServerMCP is a multi-connection MCP (Model Context Protocol) server framework based on SSE for long-connection communication. It provides context and functional extension capabilities for AI assistants and is designed for developers building MCP servers that support multiple client connections simultaneously.
How to use MultiServerMCP?
Install via npm install multi-server-mcp (or yarn/pnpm), then create a server instance with new MultiServerMCP({ name, version }), register tools/resources/prompts using .tool(), .resource(), .prompt(), and start with .start({ transportType: 'sse' }). Currently only SSE transport is supported.
Key features of MultiServerMCP
- Supports multiple client connections to a single server in SSE mode
- Tool and permission management by URL grouping
- Built‑in heartbeat mechanism for connection stability
- Simplified tool registration process with full MCP protocol compatibility
- Global session management via
SessionManager singleton
- Convenient global functions to retrieve request parameters and client context by sessionId
Use cases of MultiServerMCP
- Building an MCP server that serves concurrent AI assistant clients with isolated tool access
- Implementing permission‑based tool groupings where different URL groups grant different capabilities
- Creating a centralized MCP server that manages resources, tools, and prompts for multiple connected agents
- Developing long‑running assistant environments that require persistent SSE connections and session context
Comments