MCP Servers

模型上下文协议服务器、框架、SDK 和模板的综合目录。

Resource-first MCP hub for routing upstream MCP servers through one small local tool surface.

创建于 5/12/2026
更新于 about 4 hours ago
Repository documentation and setup instructions

MCP Hub

MCP Hub is an MCP server that exposes one stable local stdio surface and routes calls to registered upstream MCP servers.

It is designed for agents and clients that need access to multiple MCP servers without loading every upstream tool into the client tool list. The hub keeps its own tool surface small, publishes server and tool catalogs as MCP resources, and forwards selected upstream calls through hub.tools_call.

Install

Install MCP Hub as a global .NET tool:

dotnet tool install --global mcp-hub

The installed command is:

mcp-hub

Update

Update an existing global installation:

dotnet tool update --global mcp-hub

What It Does

  • Registers upstream MCP servers behind one hub server
  • Supports in-memory servers for one session
  • Supports persisted server definitions in a shared TOML config
  • Spawns in-memory servers from persisted launch templates
  • Publishes hub-owned documentation, runtime info, server, template, and tool catalog resources
  • Reads hub-owned and upstream resources with safe text paging
  • Saves selected resource content to allowed local file roots
  • Proxies upstream resource subscriptions and pending update polling
  • Returns structured machine-readable hub errors
  • Forwards upstream tool calls through hub.tools_call

When It Fits

MCP Hub is a good fit when you want:

  • one MCP client entry that can reach many upstream MCP servers
  • resource-based discovery instead of a very large flat tool list
  • stable server ids for upstream MCP processes
  • short-lived project-specific upstreams created from templates
  • shared persisted MCP server config across local agent sessions
  • structured hub-layer errors for recoverable client workflows

It is not trying to hide upstream MCP behavior. Upstream tool results and upstream protocol errors are forwarded as the upstream server returned them.

Configuration

The mcp subcommand runs MCP Hub as an MCP server over stdio.

mcp-hub mcp

Run against a shared TOML config when server definitions, templates, logging defaults, resource save roots, or approval policy should survive hub restarts:

mcp-hub mcp --config /path/to/hub.toml

MCP server options:

| Option | Purpose | | --- | --- | | --config | Loads a shared TOML config for persisted servers, templates, logging defaults, resource roots, and approval policy. | | --approval-prompt-strategy | Controls approval prompt rendering: auto detects Codex clients, codex forces Codex-compatible approval prompts, and standard uses schema-based MCP elicitation. | | --graceful-unload-timeout | Sets how long hub waits for upstream servers to shut down before forcing disposal. | | --log-level | Sets hub file log verbosity when file logging is enabled. | | --log-format | Selects text or JSON file logs when file logging is enabled. | | --log-file | Appends all hub sessions to one log file. | | --log-directory | Writes each hub session to a separate log file in a directory. | | --debug | Publishes debug-only MCP resources and documentation. |

The config path is optional. Without --config, all registered upstream servers are in-memory and disappear when the hub process exits.

Resources

When running as an MCP server, MCP Hub publishes hub-owned resources for documentation, runtime info, server catalogs, templates, and upstream tool inspection.

The repository source for the main usage guide is Docs/about.md. When the server is running, the same guide is available as hub://docs/about.

Other embedded docs live under:

Tools

| Tool | Purpose | | --- | --- | | hub.servers_spawn | Registers a new upstream server definition. | | hub.templates_spawn | Creates an in-memory upstream server from a persisted template. | | hub.servers_update | Updates an existing upstream server definition. | | hub.servers_remove | Removes an upstream server from the live registry and persisted config when applicable. | | hub.servers_reload | Unloads current runtime state so the upstream starts again on next access. | | hub.tools_call | Invokes one upstream tool after resource-first discovery. | | hub.resources_list | Lists hub-owned or upstream resources. | | hub.resource_templates_list | Lists hub-owned or upstream resource templates. | | hub.resources_read | Reads one hub-owned or upstream resource with safe text paging. | | hub.resources_save | Saves one selected resource content item to an allowed local file path. | | hub.resources_subscribe | Subscribes to one upstream resource. | | hub.resources_unsubscribe | Removes one upstream resource subscription. | | hub.resources_updates | Polls pending upstream resource update notifications. |

The local CLI can inspect the advertised schema for a hub-owned tool:

mcp-hub schema hub.tools_call

Important Behavior

  • Without --config, upstream server definitions live only for the current hub process.
  • With --config, MCP Hub can load and update persisted server definitions in the shared TOML config.
  • Launch templates are useful for project-specific or session-specific upstream servers.
  • Hub-owned resources provide the detailed agent-facing usage flow; the README intentionally stays high level.
  • Upstream tool results and upstream protocol errors are forwarded as returned by the upstream server.

Development

Run local tests:

dotnet test MCP.Hub.slnx

Pack locally:

dotnet pack MCP.Hub/MCP.Hub.csproj -c Release

See CONTRIBUTING.md for release checks and the NuGet publishing flow.

License

MIT. See LICENSE.

快速设置
此服务器的安装指南

安装命令 (包未发布)

git clone https://github.com/cNoNim/mcp-hub
手动安装: 请查看 README 获取详细的设置说明和所需的其他依赖项。

Cursor 配置 (mcp.json)

{ "mcpServers": { "cnonim-mcp-hub": { "command": "git", "args": [ "clone", "https://github.com/cNoNim/mcp-hub" ] } } }