-
Notifications
You must be signed in to change notification settings - Fork 859
feat: Add comprehensive multi-server support to MCP Inspector #749
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?
feat: Add comprehensive multi-server support to MCP Inspector #749
Conversation
This commit introduces comprehensive multi-server support to the MCP Inspector, transforming it from a single-server debugging tool into a powerful multi-server management platform. ## Key Features �️ **Server-Side Architecture** - Multi-Server API: RESTful endpoints for server management, connection control, and MCP request proxying - Real-Time Event Streaming: Server-Sent Events for live status updates and notifications across all servers - Connection Management: Independent connection lifecycle management for each server - Centralized Logging: Synchronized logging level management across all connected servers - Transport Flexibility: Support for both STDIO and HTTP transport types in multi-server configurations � **Client-Side Interface** - Unified Dashboard: Tabbed interface for managing multiple servers with real-time status monitoring - Server Management: Complete CRUD operations for server configurations with validation - Error Aggregation: Sophisticated error handling with console error interception and deduplication - State Persistence: LocalStorage-based configuration management with cache invalidation - Mode Switching: Seamless toggle between single-server and multi-server modes ## Technical Implementation ### Backend () - ServerManager: Handles CRUD operations for server configurations with Zod validation - ConnectionManager: Manages connection lifecycle, status tracking, and transport creation - EventStreamService: Provides real-time updates via Server-Sent Events - MCP Proxy: Unified API for communicating with individual servers ### Frontend () - useMultiServer Hook: 600+ lines of comprehensive state management with real-time updates - Error Management: Sophisticated error aggregation with console interception - Request Optimization: Deduplication and batching for improved performance - History Management: Centralized notification and interaction tracking ## Benefits - Enhanced Developer Productivity: Manage multiple servers from a single interface - Improved Debugging Capabilities: Compare and analyze multiple servers simultaneously - Scalable Architecture: Support for growing MCP ecosystems - Better Error Tracking: Centralized error aggregation and monitoring - Streamlined Workflows: Reduced context switching and configuration overhead ## Backward Compatibility Full backward compatibility maintained with existing single-server endpoints and workflows. ## Testing - 40+ unit tests covering all services and utilities - Component tests and integration tests - Complete endpoint testing with .http files - Edge case and failure scenario testing This PR is submitted by Elad Ariel on behalf of the SAP AI Guild (IL).
@EladAriel This is awesome work on the inspector. I agree that multi-server connections is absolutely needed and I wished they had that in the inspector very early on. To be honest, it's going to be hard / nearly impossible to get a 95 file PR approved for an open source project of this scale. I maintain the MCPJam inspector, it's an alternative to the mcp inspector and has support for multiple server connections. This might suit your needs. |
Hi @EladAriel, thanks for your work on this! Although multi server support is something that we've talked about before, right now we're more motivated towards stabilizing existing core features like Oauth testing, CLI mode, etc. for the existing flows rather than adding additional complex features. I'll keep this open for now in case other maintainers want to weigh in on prioritizing this though. |
I know it's a huge PR and there's a lot of conflicts to resolve, but it would be amazing to have this support. Not just multiple servers but showing the features supported by the connected server. I don't know about the API but the multiple server connections looks good. We have since implemented an mcp.json configuration file that seems compatible. Any interest in revisiting this? @EladAriel Is there a world where we have a slimmed down version of this? |
@cliffhall Hi, yes, but I need to know exactly what features are required. |
Multi-Server Support for MCP Inspector
Overview
This pull request introduces comprehensive multi-server support to the MCP Inspector, transforming it from a single-server debugging tool into a powerful multi-server management platform. This enhancement addresses the growing need for developers to work with multiple MCP servers simultaneously while maintaining full backward compatibility with existing workflows.
Problem Statement
The original MCP Inspector was designed to work with a single MCP server at a time, which created several limitations for developers:
Solution Overview
We implemented a comprehensive multi-server architecture that extends the MCP Inspector with:
🏗️ Server-Side Architecture
🎨 Client-Side Interface
Technical Implementation
Backend Implementation (
server/src/multiserver/
)The server-side implementation follows a modular architecture:
Key Components:
For detailed technical documentation, see
server/src/multiserver/README.md
.Frontend Implementation (
client/src/components/multiserver/
)The client-side implementation provides a rich, interactive interface:
Key Features:
For detailed technical documentation, see
client/src/components/multiserver/README.md
.Visual Demonstration
Dashboard Overview
The multi-server dashboard provides a comprehensive view of all configured servers:
Server Management
Users can easily add new servers with support for both STDIO and HTTP transports:
Multi-Server Operations
The interface supports managing multiple servers simultaneously:
Server Interaction
Each server provides dedicated tabs for resources, tools, and prompts:
Monitoring and Error Handling
Comprehensive monitoring and error tracking across all servers:
Configuration Management
Easy server configuration editing with validation:
Key Features
🔄 Real-Time Updates
🛠️ Server Management
🔌 Connection Control
📊 Monitoring & Debugging
💾 State Persistence
🔒 Security & Reliability
Backward Compatibility
Full backward compatibility maintained:
API Reference
Core Endpoints
Server Management (
/api/servers
)GET /api/servers
- List all serversPOST /api/servers
- Create serverGET /api/servers/:id
- Get server by IDPUT /api/servers/:id
- Update serverDELETE /api/servers/:id
- Delete serverConnection Management (
/api/connections
)GET /api/connections
- Get all connection statusesPOST /api/connections/:id/connect
- Connect to serverPOST /api/connections/:id/disconnect
- Disconnect from serverMCP Proxy (
/api/mcp
)POST /api/mcp/:id/request
- Generic MCP requestGET /api/mcp/:id/resources
- List resourcesGET /api/mcp/:id/tools
- List toolsGET /api/mcp/:id/prompts
- List promptsEvent Streaming (
/api/events
)GET /api/events
- Subscribe to real-time event streamTesting
Comprehensive Test Coverage
.http
filesTest Categories
Usage
Getting Started
npx @modelcontextprotocol/inspector
http://localhost:6274
Example Server Configuration
STDIO Server:
HTTP Server:
Impact
This multi-server implementation transforms the MCP Inspector from a single-server debugging tool into a comprehensive multi-server management platform, enabling:
Future Enhancements
The multi-server architecture provides a foundation for future enhancements:
This implementation represents a significant evolution of the MCP Inspector, maintaining its core debugging capabilities while adding powerful multi-server management features that scale with the growing MCP ecosystem.
This PR is submitted by Elad Ariel on behalf of the SAP AI Guild (IL).