mcphub
A unified hub for centralized management and dynamic organization of multiple MCP servers into streamable HTTP (SSE) endpoints, with support for flexible routing strategies
GitHub Stars
1,190
User Rating
Not Rated
Favorites
0
Views
53
Forks
141
Issues
25
Installation
Difficulty
IntermediateEstimated Time
10-20 minutes
Requirements
Node.js: 18.0.0 or highernpm: 8.0.0 or higherInstallation
Installation
Prerequisites
Please specify required software and versions:Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
Claude Desktop: Latest version
Installation Steps
1. Clone Repository
bash
git clone https://github.com/samanhappy/mcphub
cd mcphub
2. Install Dependencies
bash
npm install
3. Configure MCP Servers
Create amcp_settings.json file to customize your server settings.
4. Start Server
bash
npm start
Troubleshooting
Common Issues
Issue: Server won't start Solution: Check Node.js version and reinstall dependencies. Issue: Not recognized by Claude Desktop Solution: Verify configuration file path and syntax.Configuration
Configuration
Basic Configuration
MCP Server Setup
Editmcp_settings.json to configure your server settings:
json
{
"mcpServers": {
"amap": {
"command": "npx",
"args": ["-y", "@amap/amap-maps-mcp-server"],
"env": {
"AMAP_MAPS_API_KEY": "your-api-key"
}
}
}
}
Environment Variables
Set the following environment variables as needed:bash
export AMAP_MAPS_API_KEY="your-api-key"
Advanced Configuration
Security Settings
Store API keys in environment variables or secure configuration files
Performance Tuning
Configure timeout values
Limit concurrent executions
Configuration Example
json
{
"mcpServers": {
"example-mcp": {
"command": "node",
"args": ["server.js"],
"env": {
"PORT": "3000"
}
}
}
}
Examples
Examples
Basic Usage
Here are basic usage examples for the MCP server:Programmatic Usage
javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');
const client = new MCPClient();
await client.connect();
// Execute tool
const result = await client.callTool('toolName', {
parameter1: 'value1',
parameter2: 'value2'
});
console.log(result);
Advanced Examples
API Integration
python
Python example
import requests
def call_mcp_tool(tool_name, params):
response = requests.post(
'http://localhost:3000/mcp/call',
json={
'tool': tool_name,
'parameters': params
}
)
return response.json()
Usage example
result = call_mcp_tool('analyze', {
'input': 'sample data',
'options': {'format': 'json'}
})
Use Cases
Centralized management of multiple MCP servers with real-time performance monitoring.
Implement group-based access control for development teams across different MCP servers.
Add or update new MCP servers without downtime.
Integrate with AI clients to retrieve real-time data through streamable HTTP endpoints.
Rapid deployment of MCPHub using Docker to set up development environments.