Mcphub

Agent frameworks and SDKs

Self-hosted MCP gateway and control plane for connecting, controlling, and operating MCP servers.

Your AI app calls the Mcphub MCP server, which does the agent frameworks and SDKs work and sends the result back to the chat.

About Mcphub

Mcphub is a community MCP server from samanhappy, filed in our directory under agent frameworks and sdks. Self-hosted MCP gateway and control plane for connecting, controlling, and operating MCP servers.

At a glance

Publisher
samanhappy (community)
Runs
See the README for setup
Written in
TypeScript
License
Apache-2.0
GitHub stars
2,793

How to set up Mcphub

  1. Follow the install steps in the Mcphub README; it is written in TypeScript, so have that toolchain ready.
  2. Check the Mcphub README for keys or settings; the registry lists none that Mcphub requires.
  3. Add Mcphub to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Mcphub tools to confirm the connection.
  5. Run one read-only task with Mcphub first, and keep your app asking before each tool call until the results look right.

Mcphub compared with similar servers

  • SuperAssistant by srbhptl39 has fewer GitHub stars than Mcphub (2.7k against 2.8k); both are community servers, and both run locally.
  • Sparfenyuk Proxy by sparfenyuk has more GitHub stars than Mcphub (2.9k against 2.8k); both are community servers, and both run locally.
  • Nitrostack by nitrocloudofficial has fewer GitHub stars than Mcphub (2.6k against 2.8k); both are community servers, and both run locally.

Before you connect Mcphub

  • Give Mcphub its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Mcphub tool call until you trust what it does with them.
  • Treat text that Mcphub fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Mcphub on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Mcphub

How marketing and sales teams put Mcphub to work, by company size. Pick the size closest to yours and start Mcphub on one use case.

Small business

  • A small business with a developer can use Mcphub to build one focused agent, such as lead follow-up, without a big platform.
  • Technical founders can prototype marketing agents with Mcphub and keep what works as a small, owned tool.
  • Mcphub runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineering teams can use Mcphub to build agents that combine CRM, analytics and content tools behind one workflow.
  • Marketing ops can standardize on Mcphub so every agent they ship has the same logging, approvals and error handling.
  • Start Mcphub on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can build on Mcphub with their own identity, policy and evaluation layers, so agents meet the same bar as other software.
  • Platform teams can use Mcphub to give business units a governed way to ship agents without each one starting from scratch.
  • Mcphub is a community server, so have security review the code and pin a version before Mcphub touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Mcphub README

From samanhappy/mcphub on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

MCPHub

An open-source, self-hosted MCP gateway and control plane for connecting, controlling, and operating MCP servers.

English | Français | 中文版

MCPHub provides a unified control point between AI clients and MCP servers. Connect local and remote MCP servers once, organize and route their capabilities through stable endpoints, control access with authentication, scoped credentials, and per-user visibility, and operate everything with centralized logs, activity tracking, and health monitoring.

It works with MCP clients such as Claude Code, Cursor, Cherry Studio, OpenWebUI, and other MCP-compatible applications.

🌐 Website, Demo & Docs

🚀 Features

Connect once, expose everywhere
  • Smart Routing ⭐ - AI-powered tool discovery using vector semantic search (docs.mcphub.app/features/smart-routing)
  • Unified MCP Gateway - Expose all connected servers through stable MCP endpoints, including routes for groups and individual servers
  • Server Aliases and Routing - Define aliases and route clients to all servers, specific groups, individual servers, or smart routing
  • SSE / Streamable HTTP / stdio Support - Connect local and remote MCP servers over the supported transports
  • File Staging - Let stdio tools accept an uploaded copy of a client file or write a result the hub serves as a one-time download (github.com/samanhappy/mcphub/blob/main/docs/features)
  • Skills over MCP - Publish or pause Agent Skills by endpoint. Groups can use the native Skills extension, MCP tools, or automatic compatibility (github.com/samanhappy/mcphub/blob/main/docs/features)
  • Hot-Swappable Config - Add, remove, or update servers without downtime
Control access and credentials
  • Per-user Credentials ⭐ - Bind personal keys to one shared server, with encrypted storage and isolated stdio runtimes (github.com/samanhappy/mcphub/blob/main/docs/features)
  • Authentication and Access Control - Use OAuth 2.0, bearer keys, passkeys, and server or group visibility controls to manage access
  • OAuth 2.0 Support ⭐ - Both client and server modes for secure authentication (docs.mcphub.app/features/oauth)
  • Social Login - Seamless GitHub and Google login support with Better Auth integration (requires Database Mode)
  • Server and Group Management - Organize servers into groups, manage visibility, and control Tool, Prompt, and Resource exposure
Operate with confidence
  • 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
  • MCP Apps Proxy - Transparently forward interactive MCP Apps on single-server routes (docs.mcphub.app/features/mcp-apps)
  • Tool Result Compression - Transparently reduce large text tool outputs before they reach clients
  • Database Mode - Store configuration in PostgreSQL for production environments (docs.mcphub.app/configuration/database-configuration)
  • Multiple Replicas - Share PostgreSQL configuration with explicit session affinity and reconnect boundaries (Deployment guide)
  • Docker-Ready - Deploy instantly with containerized setup

🔧 Quick Start

Prerequisites
  • Docker (recommended), the fastest way to run MCPHub; all commands below use it
  • Node.js >=22.0.0 and pnpm 10.12.4, only needed to run from source or develop locally (see Local Development)
Start with Docker
docker run -p 3000:3000 -v ./data:/app/data samanhappy/mcphub

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.

Settings, users, and credential bindings persist in ./data by default.

Want your own servers? Before the first launch, create data/mcp_settings.json (see Configuration). After launch, add servers in the dashboard or edit the existing file and restart MCPHub.

Configuration

Create data/mcp_settings.json before the first launch:

{
  "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

See Start with Docker for the copy-paste command. Keep ./data mounted so settings, users, and credential bindings survive container recreation.

Two 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.

One-Click Deploy
Upgrading deployments with personal credentials

Database mode requires a persistent MCPHUB_CREDENTIAL_ENCRYPTION_KEY or an existing key file; it no longer generates a local key automatically. Before replacing a working container, back up its original key and preserve the same value in deployment secrets. A database backup alone cannot recover encrypted credentials if the key is lost. See the Credential Key Upgrade and Recovery Guide for working deployments and recovery after a failed upgrade.

Access Dashboard

Open http://localhost:3000 (see Start with Docker for login details). You can also pre-set the password:

# Docker: set admin password via environment variable
docker run -p 3000:3000 -v ./data:/app/data -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

Set SMART_ROUTING_PATH=my_smart to use /mcp/my_smart (and /mcp/my_smart/{group}) without $. Restart to apply; /mcp/$smart remains supported. Include BASE_PATH before /mcp when configured. The custom segment must not match an existing server name, group name or group ID.

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.

📚 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 dev

Local 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, with optional passkeys (WebAuthn); 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 architecture, OAuth/OIDC, identity and 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

Chinese users can also support via WeChat Pay, see 中文版.

Acknowledgements

  • AtomGit: Hosts MCPHub in China, making the project easier to access for users in mainland China.

🌟 Star History

📄 License

Licensed under the Apache 2.0 License.

Questions about Mcphub

What is the Mcphub MCP server?

Self-hosted MCP gateway and control plane for connecting, controlling, and operating MCP servers. Mcphub is maintained by samanhappy on GitHub at samanhappy/mcphub, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Mcphub MCP server?

Mcphub doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (samanhappy/mcphub). Like most servers, Mcphub ends with a command or URL you paste into your AI app's MCP config.

Does Mcphub need an API key?

The registry lists no required keys for Mcphub. Check the Mcphub README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Mcphub an official MCP server?

No. Mcphub is a community server maintained by samanhappy. Community servers can be excellent; read the code and the open issues before you give Mcphub access to company data.

What license is Mcphub under?

Mcphub is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Mcphub; the service it connects to has its own terms.