mcp-hub
Single gateway that aggregates dozens of upstream MCP servers, enabling AI clients to connect once and access all tools.
README
MCP Hub
Internal MCP (Model Context Protocol) server and AI tools platform for the homelab. Acts as a single gateway that aggregates dozens of upstream MCP servers — your AIs connect once and get access to everything.
How It Works
Claude Code / Claude Desktop / Any MCP Client
│
▼
┌───────────────┐
│ MCP Hub │ ← single SSE connection
│ (FastAPI) │
└──────┬────────┘
│
┌──────┴────────────────────────────────┐
│ │
▼ ▼ ▼ ▼
Local Tools GitHub MCP Brave MCP Wikipedia MCP
(GitLab,K8s, (stdio) (stdio) (stdio)
Homelab) ... ... ...
Your AI connects to one endpoint and gets access to:
- 15 built-in local tools (GitLab, Kubernetes, Homelab)
- 30+ upstream MCP servers (search, databases, code, AI, monitoring, communication)
Quick Start
cd ~/projects/homelab/mcp-hub
export MH_GITLAB_TOKEN=<your-gitlab-pat>
export MH_GITHUB_TOKEN=<your-github-token>
docker compose up -d
# Dashboard: http://localhost:8500
# MCP SSE: http://localhost:8500/mcp/sse
Connect Your AI
Add to Claude Code settings.json:
{
"mcpServers": {
"mcp-hub": {
"type": "sse",
"url": "http://mcp-hub.steelcanvas.dev/mcp/sse"
}
}
}
That's it. One connection, all tools.
Available Upstream Servers
Configured in upstreams.yaml. Enabled by default (no API key needed):
| Server | Prefix | Description |
|---|---|---|
| fetch | web__ |
Fetch web pages, convert to markdown |
| github | github__ |
Repos, issues, PRs, actions, code search |
| docker | docker__ |
Container, image, volume management |
| arxiv | arxiv__ |
Search and read academic papers |
| wikipedia | wiki__ |
Search and read encyclopedia articles |
| filesystem | fs__ |
Read, write, search files |
| memory | memory__ |
Persistent knowledge graph |
| time | time__ |
Time, timezone conversions |
| sequential-thinking | think__ |
Structured reasoning |
Set an API key to enable:
| Server | Prefix | Env Var |
|---|---|---|
| Brave Search | brave__ |
MH_BRAVE_API_KEY |
| Tavily | tavily__ |
MH_TAVILY_API_KEY |
| Exa | exa__ |
MH_EXA_API_KEY |
| Puppeteer | browser__ |
(just enable) |
| PostgreSQL | pg__ |
MH_PROXY_POSTGRES_URL |
| SQLite | sqlite__ |
MH_SQLITE_PATH |
| Redis | redis__ |
MH_REDIS_URL |
| Qdrant | qdrant__ |
MH_QDRANT_URL |
| Wolfram Alpha | wolfram__ |
MH_WOLFRAM_APP_ID |
| Slack | slack__ |
MH_SLACK_BOT_TOKEN |
| Discord | discord__ |
MH_DISCORD_TOKEN |
| Linear | linear__ |
MH_LINEAR_API_KEY |
| Notion | notion__ |
MH_NOTION_API_KEY |
| HuggingFace | hf__ |
MH_HF_TOKEN |
| OpenAI | openai__ |
MH_OPENAI_API_KEY |
| Prometheus | prom__ |
MH_PROMETHEUS_URL |
| Grafana | grafana__ |
MH_GRAFANA_URL + MH_GRAFANA_API_KEY |
| Sentry | sentry__ |
MH_SENTRY_TOKEN |
| S3/MinIO | s3__ |
MH_S3_ACCESS_KEY + MH_S3_SECRET_KEY |
| Cloudflare | cf__ |
MH_CLOUDFLARE_TOKEN |
| Terraform | tf__ |
(just enable) |
| Google Drive | gdrive__ |
(OAuth setup) |
Adding Custom Upstream Servers
Edit upstreams.yaml:
upstreams:
# stdio-based (spawns a local process)
my-server:
transport: stdio
enabled: true
description: "My custom MCP server"
command: npx
args: ["-y", "my-mcp-package"]
env:
API_KEY: "${MH_MY_API_KEY}"
prefix: my
# SSE-based (connects to a remote HTTP endpoint)
remote-server:
transport: sse
enabled: true
description: "Remote MCP server"
url: "http://192.168.1.50:9000/mcp/sse"
headers:
Authorization: "Bearer ${MH_REMOTE_TOKEN}"
prefix: remote
API Endpoints
| Endpoint | Description |
|---|---|
GET / |
Web dashboard |
GET /health |
Health check (DB + proxy status) |
GET /api/tools |
All tools (local + proxied) with source |
GET /api/logs |
Tool invocation logs |
GET /api/proxy/status |
Upstream connection status |
GET /api/proxy/tools |
Proxied tool name -> source mapping |
POST /api/proxy/reconnect/{name} |
Reconnect a specific upstream |
GET /mcp/sse |
MCP SSE endpoint |
GET /docs |
OpenAPI docs |
Architecture
mcp-hub/
├── mcp_hub/
│ ├── main.py # FastAPI app + dashboard + proxy lifecycle
│ ├── mcp_server.py # MCP server (FastMCP) with local tools
│ ├── config.py # Pydantic settings (MH_* env vars)
│ ├── database.py # SQLAlchemy async engine
│ ├── models/ # ORM models (ToolLog)
│ ├── tools/ # Built-in local tools
│ │ ├── gitlab_tools.py
│ │ ├── k8s_tools.py
│ │ └── homelab_tools.py
│ └── proxy/ # Upstream MCP proxy engine
│ ├── manager.py # Orchestrates connections, registers proxied tools
│ ├── connector.py # MCP client for a single upstream (stdio/SSE)
│ ├── registry.py # Server config dataclass + YAML loader
│ ├── defaults.py # Built-in default upstream configs
│ └── env_resolver.py # ${VAR} placeholder resolution
├── upstreams.yaml # User-editable upstream config
├── templates/ # Jinja2 dashboard
├── static/css/ # Dark-themed dashboard styles
├── Dockerfile # Multi-stage (Python + Node.js for npx)
├── docker-compose.yml # Local dev stack
└── .gitlab-ci.yml # CI/CD pipeline
Development
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
# Run locally
export MH_DATABASE_URL=postgresql+asyncpg://mcphub:mcphub@localhost:5432/mcphub
uvicorn mcp_hub.main:app --reload --port 8500
# Lint & test
ruff check .
pytest -v
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。