mcphub
Self-hosted MCP gateway and management platform for connecting, managing, and operating MCP servers.
Documentation
MCPHub
> A self-hosted MCP gateway and management platform for connecting, managing, and operating MCP servers.
English | FranΓ§ais | δΈζη
MCPHub provides a unified way to connect and manage multiple MCP servers, organize them into groups, control access, and expose stable MCP endpoints for clients such as Claude Code, Cursor, Cherry Studio, OpenWebUI, and other MCP-compatible applications.

π Website, Demo & Docs
- Website: mcphub.app
- Documentation: docs.mcphub.app
- Demo Environment: demo.mcphub.app
π Features
- Unified MCP Gateway - Expose all connected servers through stable MCP endpoints, including routes for groups and individual servers
- Server and Group Management - Organize servers into groups, manage visibility, and control Tool, Prompt, and Resource exposure
- SSE / Streamable HTTP / stdio Support - Connect local and remote MCP servers over the supported transports
- Authentication and Access Control - Use OAuth 2.0, bearer keys, and server or group visibility controls to manage access
- Server Aliases and Routing - Define aliases and route clients to all servers, specific groups, individual servers, or smart routing
- Logs and Observability - Inspect tool-call activity, request status, latency, and server logs
- Health Checks - Monitor connection health and server status from one place
- Web Dashboard - Manage server configuration and runtime operations from a browser
- Smart Routing - AI-powered tool discovery using vector semantic search (Learn more)
- MCP Apps Proxy - Transparently forward interactive MCP Apps on single-server routes (Learn more)
- Tool Result Compression - Transparently reduce large text tool outputs before they reach clients
- Hot-Swappable Config - Add, remove, or update servers without downtime
- OAuth 2.0 Support - Both client and server modes for secure authentication (Learn more)
- Social Login - Seamless GitHub and Google login support with Better Auth integration (requires Database Mode)
- Database Mode - Store configuration in PostgreSQL for production environments (Learn more)
- Docker-Ready - Deploy instantly with containerized setup
π§ Quick Start
Configuration
Create a `mcp_settings.json` file:
{
"mcpServers": {
"time": {
"command": "npx",
"args": ["-y", "time-mcp"]
},
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
}
}π See Configuration Guide for full options including OAuth, environment variables, and more.
Docker Deployment
# Run with custom config (recommended)
docker run -p 3000:3000 -v ./mcp_settings.json:/app/mcp_settings.json -v ./data:/app/data samanhappy/mcphub
# Or run with default settings (also mount ./data so credentials and state survive restarts)
docker run -p 3000:3000 -v ./data:/app/data samanhappy/mcphubTwo image variants are published under `samanhappy/mcphub`:
- `latest` β the default image. Includes Node.js/pnpm, Python, uv/uvx, Git, and build tools. Covers most MCP servers.
- `latest-full` β the extended image. Adds Rust toolchain (Cargo/rustc), Docker Engine, and Playwright browsers (Chrome + Firefox, amd64 only). Use this for Rust-based servers or container-in-container workflows. Larger download.
See Docker Setup for build options and Docker-in-Docker configuration.
Access Dashboard
Open `http://localhost:3000` and log in with username `admin`. On first launch, if no `ADMIN_PASSWORD` environment variable is set, a random password is generated and printed to the server logs. You can also pre-set the password:
# Docker: set admin password via environment variable
docker run -p 3000:3000 -e ADMIN_PASSWORD=your-secure-password samanhappy/mcphub> Tip: Change the admin password after first login for security.
> Headless mode: Set `DISABLE_WEB=true` to skip serving the bundled dashboard UI and run MCPHub with only the backend/API and MCP endpoints. This is useful when you want to manage servers directly from `mcp_settings.json`.
Connect AI Clients
Connect AI clients (Claude Desktop, Cursor, etc.) via:
http://localhost:3000/mcp # All servers
http://localhost:3000/mcp/{group} # Specific group
http://localhost:3000/mcp/{server} # Specific server
http://localhost:3000/mcp/$smart # Smart routing
http://localhost:3000/mcp/$smart/{group} # Smart routing within group> Security note: MCP endpoints require authentication by default to prevent accidental exposure. To allow unauthenticated MCP access, disable Enable Bearer Authentication in the Keys section. Skip Authentication only affects dashboard login. Use only in trusted environments.
π See API Reference for detailed endpoint documentation.
Manage From the Terminal
The same `mcphub` binary doubles as a CLI for the running hub β no extra install needed.
mcphub login --url http://localhost:3000 --username admin
mcphub servers list
mcphub servers add fetch --type stdio --command uvx --arg mcp-server-fetch
mcphub tools list # discover what tools are available
mcphub tools get fetch_url # see required params + sample command
mcphub call fetch_url url=https://example.com --json
mcphub keys create --name ci --access-type allIt also speaks the public marketplace API (`mcphub discover`, `mcphub install ...`) so server lookup and one-command install work against any hub with discovery enabled.
π See CLI Guide for every subcommand, profiles, and CI usage.
π Documentation
| Topic | Description |
|---|---|
| Quick Start | Get started in 5 minutes |
| Configuration | MCP server configuration options |
| Database Mode | PostgreSQL setup for production |
| OAuth | OAuth 2.0 client and server setup |
| Smart Routing | AI-powered tool discovery |
| MCP Apps | Interactive Apps transparent proxy |
| CLI Guide | Manage and call the hub from a terminal |
| Docker Setup | Docker deployment guide |
π§βπ» Local Development
git clone https://github.com/samanhappy/mcphub.git
cd mcphub
pnpm install
pnpm devLocal development uses `admin` / `admin123` and stores its writable settings copy at `data/mcp_settings.dev.json`, so the repository `mcp_settings.json` stays credential-free.
> For Windows users, start backend and frontend separately: `pnpm backend:dev`, `pnpm frontend:dev`
π See Development Guide for detailed setup instructions.
π Tech Stack
- Backend: Node.js, Express, TypeScript (ESM)
- Frontend: React, Vite, Tailwind CSS
- Storage: file-based `mcp_settings.json` by default; PostgreSQL via TypeORM with pgvector for Smart Routing
- Auth: JWT + bcrypt for local accounts; bearer keys; built-in OAuth 2.0 server (`@node-oauth/oauth2-server`); optional Better Auth for GitHub/Google login
- Protocol: Model Context Protocol SDK
π’ Production Support
Running MCPHub in production?
Work directly with the maintainer on production deployment, OAuth/OIDC,
access control, credential management, audit, Kubernetes, and HA readiness.
Discuss a production pilot β
π₯ Contributing
Contributions welcome! See our Discord community for discussions and support.
β€οΈ Sponsor
π Star History
π License
Licensed under the Apache 2.0 License.
Frequently asked questions
What is mcphub?
mcphub is Self-hosted MCP gateway and management platform for connecting, managing, and operating MCP servers.
How do I install mcphub?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcphub open source?
Yes β it is hosted on GitHub at https://github.com/samanhappy/mcphub and has 2,368 stars.
Related MCP tools
MCP Aggregator, Orchestrator, Middleware, Gateway in one docker
Testing and evaluation platform to chat, inspect, and debug MCP servers, MCP apps, and ChatGPT apps.
π§© MCP Gateway - A lightweight gateway service that instantly transforms existing MCP Servers and APIs into MCP servers with zero code changes.
MCP Aggregator, Orchestrator, Middleware, Gateway in one docker TypeScript-based implementation. Trusted by 1400+ developers.
The Open-Source Multimodal AI Agent Stack: Connecting Cutting-Edge AI Models and Agent Infra
A MCP for Claude Desktop / Claude Code / Windsurf / Cursor to build n8n workflows for you
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP