MCP Servers · Publisher repository

MCPHub

MCPHub is a self-hosted gateway between AI clients and multiple MCP servers, combining endpoint aggregation, group routing, access control, credential isolation, runtime logs, and optional vector-based smart routing.

2.4k StarsApache-2.0TypeScriptUpdated today
01

Project overview

MCPHub is a self-hosted gateway and control plane placed between AI clients and multiple MCP servers. It exposes all servers, a group, one server, or Smart Routing through separate unified endpoints, while one web dashboard manages authentication, visibility, personal credentials, runtime status, and logs. It is team-level MCP infrastructure rather than a single tool server. Before adoption, define the upstream permission, secret-storage, activity-log, and network-exposure boundaries.

MCPHub web dashboard showing the MCP server list, status, and management actions
The repository-provided MCPHub dashboard screenshot illustrates centralized management for multiple MCP servers.View repository image
02

Core capabilities

01

Unified MCP endpoints

Aggregate configured servers at /mcp, or restrict access to a group or one server through /mcp/{group} and /mcp/{server}.

02

Authentication and access control

Supports bearer keys, JWT, MCP OAuth, and Better Auth, with server visibility set to private, group, or public.

03

Per-user credential isolation

Administrators declare environment-variable or header credential slots; each user's values are encrypted with AES-256-GCM and injected into an isolated runtime.

04

Smart tool routing

Indexes tool names, descriptions, and parameters, searches them by vector similarity at the $smart endpoint, and can restrict discovery to a group.

05

Dashboard and runtime visibility

The web dashboard shows server status, logs, and activity; /health is unauthenticated, while database mode can persist tool-call activity.

03

Setup and connection

The recommended starting point is one Docker instance with a persistent data directory and a least-privilege upstream test server. Add PostgreSQL, pgvector, and an embedding service only when Smart Routing or multiple instances are required.

AI AGENT INSTALL

Let an AI Agent install it

Send this prompt to Codex, Claude Code, or another AI agent that can work with your local environment.

Help me deploy MCPHub v1.0.36 from https://github.com/samanhappy/mcphub. First read the README plus the quickstart, authentication, per-user-credentials, and monitoring documents. Prefer Docker with a persistent data directory. Generate strong random ADMIN_PASSWORD, JWT_SECRET, and MCPHUB_CREDENTIAL_ENCRYPTION_KEY values and inject them through secret management; do not write them to version control or chat. Start with one low-privilege test MCP server, then verify /health, administrator login, the server list, and the tool list. Do not enable skipAuth, Smart Routing, or production credentials unless I explicitly authorize it. Ask before exposing a public port, mounting a sensitive directory, changing existing configuration, calling an external embedding service, or requesting extra permissions.
01Before you start
  • Docker is available and host port 3000 is free
  • Prepare a strong random dashboard password and inject it through the environment or a secret manager
  • If mounting a configuration file, prepare mcp_settings.json in the current directory
  • Review the file, command, network, and credential permissions required by every upstream MCP server
  • Smart Routing additionally requires PostgreSQL, pgvector, and a compatible embedding service
02Copy the install command or configuration
docker run -p 3000:3000 -v ./mcp_settings.json:/app/mcp_settings.json -v ./data:/app/data samanhappy/mcphub
03Complete the setup steps
  1. 1
    Prepare minimal configuration and secrets

    Check the port and persistent data directory, then prepare separate random secrets for the administrator, JWT sessions, and personal-credential encryption. Keep them out of Git.

  2. 2
    Start a persistent Docker instance

    Run the documented Docker command. If no custom server is ready, omit the mcp_settings.json mount initially but keep the persistent data volume.

  3. 3
    Sign in and add a low-privilege server

    Open http://localhost:3000, sign in as the administrator, add a test server that needs no production secret, and restrict its visibility.

  4. 4
    Connect a client and verify scope

    Point an MCP client at http://localhost:3000/mcp or a narrower group or server endpoint. Confirm it lists and calls only the expected tools.

  5. 5
    Upgrade the operating mode only when needed

    Move to PostgreSQL only for multiple instances, persistent activity, Better Auth, or Smart Routing. Review the embedding provider's data policy before enabling Smart Routing.

How to verify the setup

After the container starts, open http://localhost:3000 and sign in with the password from first-run logs or the configured password. Add one minimal test server, then run `mcphub servers list` and `mcphub tools list`. The base installation is verified when that server and its tools appear and /health reports a healthy service.

Before using it
  • Without ADMIN_PASSWORD, first launch prints a random administrator password to logs; save it promptly and restrict log access.
  • Set JWT_SECRET explicitly in production, because a generated value invalidates sessions after restart and cannot be shared across replicas.
  • Persist and back up the credential-encryption key; losing it makes existing personal credentials unreadable.
  • Never enable skipAuth where untrusted users can reach the service.
04

Use cases

SCENARIO 01

One MCP ingress for a team

Several clients maintain one gateway address while administrators centrally update server definitions, aliases, and visibility.

SCENARIO 02

Groups by team or environment

Use /mcp/{group} to isolate development, staging, production, or department tools behind distinct endpoints and access scopes.

SCENARIO 03

Shared server definitions with personal secrets

A team shares one upstream server template while each user supplies a private API key or header that is isolated at runtime.

SCENARIO 04

Semantic discovery across large tool catalogs

In PostgreSQL mode, query $smart in natural language and use progressive disclosure to avoid loading every full parameter schema into context.

05

Assessment

MCPHub turns scattered MCP servers into centrally governed shared infrastructure. Unified endpoints, groups, per-user credentials, and a straightforward Docker path make gradual team adoption practical. The tradeoff is that one gateway now concentrates privileged tools, secrets, and call content, so operational and audit responsibility also becomes centralized. The repository is active and v1.0.36 continues to improve credential handling and stability, but activity is not a substitute for an independent security review.

Why it may be useful

  • Covers stdio, SSE, and Streamable HTTP upstream transports
  • Provides global, group, single-server, and Smart Routing endpoints
  • Encrypted per-user credentials reduce secret mixing in shared configuration
  • Documents Docker, npm, and local-development paths
  • Uses a clear Apache-2.0 license and has recent releases and commits

What to know first

  • No SECURITY.md or public vulnerability-reporting workflow
  • Database activity records can persist complete request inputs and response outputs
  • Smart Routing depends on a database and an external or self-hosted embedding service
  • Built-in visibility is not a complete metrics, tracing, and alerting stack
  • An overprivileged centralized gateway amplifies upstream MCP permission risk
06

README

MCPHub


Overview

MCPHub is a self-hosted gateway between AI clients and multiple MCP servers, combining endpoint aggregation, group routing, access control, credential isolation, runtime logs, and optional vector-based smart routing. Self-hosted MCP gateway and control plane for connecting, controlling, and operating MCP servers.

Getting started

  • The recommended starting point is one Docker instance with a persistent data directory and a least-privilege upstream test server. Add PostgreSQL, pgvector, and an embedding service only when Smart Routing or multiple instances are required.
  • The project is a self-hosted MCP gateway and control plane that exposes all servers, a group, one server, or Smart Routing through separate MCP endpoints.
  • Servers can use stdio, SSE, or Streamable HTTP. The dashboard manages servers, groups, aliases, access control, logs, health, and hot updates.
  • After the container starts, open http://localhost:3000 and sign in with the password from first-run logs or the configured password. Add one minimal test server, then run `mcphub servers list` and `mcphub tools list`. The base installation is verified when that server and its tools appear and /health reports a healthy service.

Configuration

docker run -p 3000:3000 -v ./mcp_settings.json:/app/mcp_settings.json -v ./data:/app/data samanhappy/mcphub
Read the complete README on GitHub