MultiServerMCP

by arrenxxxxx

1 295 downloads Not rated yet MIT

About

To resolve the SSE MCP SDK server's lack of multiple connection support.

Details

License
MIT

Explore

- Support for multiple client connections to a single server in SSE mode
- Tool and permission management by URL grouping
- Built-in heartbeat mechanism to ensure connection stability
- Simplified tool registration process
- Full compatibility with MCP protocol
- Global session management with SessionManager to access client context anywhere
- Convenient global functions to retrieve request parameters and client context by sessionId

npm install multi-server-mcp

typescript
import { MultiServerMCP } from 'multi-server-mcp';

// Create MCP server instance
const server = new MultiServerMCP({
name: 'my-mcp-server',
version: '1.0.0'
});

// Register a tool
server.tool('my-tool', async () => {
return {
content: [{ type: 'text', text: 'Tool executed successfully!' }]
};
});

// Start the server
server.start({
transportType: 'sse',
sse: {
port: 3000,
endpoint: '/mcp',
messagesEndpoint: '/mcp-messages'
}
});
```

// Register a tool with grouping
server.tool('group1/group2/my-tool', async () => {
  return {
    content: [{ type: 'text', text: 'Tool executed successfully!' }]
  };
});

// Start server with permission management
server.start({
transportType: 'sse',
enableUrlGroups: true
});

- Regular tools: server.tool()
- Resource tools: server.resource()
- Prompt tools: server.prompt()

A multi-connection MCP server framework based on SSE for long-connection communication. Provides context and functional extension capabilities for AI assistants.
Currently only supports SSE mode.

License: MIT
English
中文简体

🚀 MultiServerMCP — Enable AI assistants with extended capabilities through multi-connection server framework!

MultiServerMCP is designed to provide a robust server framework that supports multiple client connections to a single server, allowing for efficient tool and permission management for AI assistants.

🌟 Main Features

- Support for multiple client connections to a single server in SSE mode
- Tool and permission management by URL grouping
- Built-in heartbeat mechanism to ensure connection stability
- Simplified tool registration process
- Full compatibility with MCP protocol
- Global session management with SessionManager to access client context anywhere
- Convenient global functions to retrieve request parameters and client context by sessionId

📦 Installation

```bash
npm install multi-server-mcp

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.