mcp-hub

mcp-hub

A lightweight control plane and local stdio agent that enables multiple MCP clients to connect to one local agent while configuration is managed from a remote control plane, supporting tool naming, exposure control, and multiple upstream source types.

Category
访问服务器

README

mcp-hub

mcp-hub is a lightweight control plane and local stdio agent for managing MCP sources across AI coding tools.

It lets Codex, Claude Code, OpenCode, and other MCP clients connect to one local agent while the actual upstream MCP services are configured from a remote control plane.

Overview

MCP tools are often installed and configured per client. As the number of tools grows, keeping every local client in sync becomes repetitive and error-prone.

mcp-hub separates the system into two parts:

  • Local agent
    • Runs as a stdio MCP server.
    • Loads workspace configuration from a control-plane API.
    • Connects to upstream MCP services from the local machine.
    • Falls back to cached configuration when the control plane is temporarily unavailable.
  • Control plane
    • Maintains MCP sources, exposed tools, and hosted source definitions.
    • Provides configuration endpoints for local agents.
    • Includes a web console for managing sources and copied client configs.

Features

  • One local stdio entrypoint for multiple MCP clients.
  • Remote workspace configuration with local cache fallback.
  • Tool naming and exposure control.
  • Support for multiple upstream source types:
    • direct-http
    • local-stdio
    • hosted-npm
    • hosted-single-file
  • Codex-friendly TOML output with explicit type = "stdio".
  • Shell-wrapped npx command generation for GUI clients with limited $PATH.
  • Optional export profiles for exposing different source sets as separate MCP servers.

Install

Use the published local agent directly with npx:

npx -y @a1ua/mcp-hub \
  --base-url https://your-control-plane.example.com \
  --workspace mcp-hub \
  --token your-token

Or install it globally:

npm install -g @a1ua/mcp-hub

Client Setup

Codex

codex mcp add mcp-hub -- \
  npx -y @a1ua/mcp-hub \
  --base-url https://your-control-plane.example.com \
  --workspace mcp-hub \
  --token your-token

You can also write the server configuration directly:

[mcp_servers."mcp-hub"]
type = "stdio"
command = "/bin/sh"
args = ["-lc", "PATH=\"/opt/homebrew/bin:/usr/local/bin:$PATH\"; if [ -d \"$HOME/.nvm/versions/node\" ]; then for dir in \"$HOME\"/.nvm/versions/node/*/bin; do [ -d \"$dir\" ] && PATH=\"$dir:$PATH\"; done; fi; cd \"$HOME\"; exec 'npx' '-y' '@a1ua/mcp-hub' '--base-url' 'https://your-control-plane.example.com' '--workspace' 'mcp-hub' '--token' 'your-token'"]

Config URL Mode

Use --config-url when the control plane gives you a full workspace or export config endpoint:

npx -y @a1ua/mcp-hub \
  --config-url https://your-control-plane.example.com/v1/workspaces/mcp-hub/config \
  --workspace mcp-hub \
  --token your-token

CLI Options

Option Description
--base-url Control-plane base URL. The agent resolves /v1/workspaces/<workspace>/config.
--config-url Full configuration URL. Takes precedence over --base-url.
--workspace Workspace ID and local cache key.
--token Bearer token passed directly on the command line.
--token-env Environment variable name used to read the Bearer token.
--cache-dir Custom local cache directory.

The same settings can also be supplied through environment variables:

  • MCP_AGENT_BASE_URL
  • MCP_AGENT_CONFIG_URL
  • MCP_AGENT_WORKSPACE
  • MCP_AGENT_TOKEN
  • MCP_AGENT_TOKEN_ENV
  • MCP_AGENT_CACHE_DIR

Project Structure

.
├── apps
│   ├── control-plane-api     # Fastify API and hosted-source runtime management
│   └── control-plane-web     # React control-plane console
├── packages
│   ├── agent                 # Published local stdio agent
│   ├── runtime               # MCP aggregation runtime
│   └── shared                # Shared schemas and config mapping
└── docs                      # Architecture and product notes

Development

Install dependencies:

pnpm install

Run the development helper:

pnpm go

Run API and web console separately:

pnpm dev:api
pnpm dev:web

Run checks:

pnpm -r test
pnpm build

Control-Plane Contract

The local agent expects a workspace config endpoint that returns a JSON workspace configuration.

With --base-url https://your-control-plane.example.com --workspace mcp-hub, the agent requests:

https://your-control-plane.example.com/v1/workspaces/mcp-hub/config

With export profiles, the control plane can provide separate config URLs for different MCP server views.

Current Scope

mcp-hub focuses on local MCP aggregation and configuration delivery. It is not intended to be a multi-tenant SaaS backend out of the box.

The current implementation is best suited for:

  • personal MCP workspaces,
  • small team tool setups,
  • self-hosted control planes,
  • experiments with hosted or generated MCP sources.

Roadmap

  • Improve the public setup wizard and install documentation.
  • Expand hosted-source lifecycle management.
  • Add more automated coverage around source discovery and export profiles.
  • Refine the web console for clearer source, tool, and export workflows.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选