
自架网关,将本地stdio和远程HTTP MCP服务器聚合到一个OAuth端点——连接一次,即可通过任何AI访问所有工具。
概览
Web/应用AI只能连接到MCP服务器,而且大多数只给你自定义的连接器插槽。而有用的MCP服务器一半是(npx/uvx标准进程)只有Claude Desktop或CLI能访问的。 - 任意数量的MCP服务器——远程(URL)或本地(stdio,托管在你的主机上)——集中到一个端点。- 你的AI只看到一个连接器;其后是你所有的工具。- ——添加服务器、分组工具、控制哪个代理能看到什么、监控审计日志。- 支持的浏览器代理可以在同一登录页面检查网关、打开App Lab诊断,并准备仅审查的连接草稿。- MCP Switch不自带工具;它透明地转发工具、模式、结果,甚至MCP应用界面控件。 没有独立的后端,也没有服务间的HTTP——网关直接与上游服务器通信并对它们进行聚合。 - 生命值:卷曲 http://127.0.0.1:4577/health - 控制台:打开 http://127.0.0.
概述(AI 翻译)
一个自托管端点,用于本地和远程MCP服务器。
英语 ·简体中文 ·日本語
🔗 原始控制台演示📖用户手册
为什么
网页/应用AI只能连接到远程MCP服务器,而且大多数服务器都会给你
只需一个自定义接口槽。与此同时,一半有用的MCP服务器是
本地(npx/uvx标准进程),只有Claude Desktop或CLI能访问。
MCP 交换机位于中间:
- 聚合任意数量的MCP服务器——远程(URL)或本地(stdio,托管于 你的盒子)——合并成一个端点。
- **连接一次。**你的人工智能只看到一个连接器;它背后是你所有的工具。
- 从控制台管理 — 添加服务器、组工具、指定代理能看到什么, 查看审计日志。
- 通过WebMCP操作控制台 — 支持的浏览器代理可以检查 网关、开放应用实验室诊断,并准备仅审查的连接草稿 在同一个登录页面里。
- 纯中继。 MCP 交换机不自带工具;它转发工具、模式, 结果甚至 MCP-Apps UI 控件都能透明显示。
建筑
单一服务(:4577)+它服务的控制台SPA:
| 部分 | 角色 |
|---|
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Why
Web/app AIs can only connect to remote MCP servers, and most of them give you
just one custom connector slot. Meanwhile half the useful MCP servers are
local (npx/uvx stdio processes) that only Claude Desktop / a CLI can reach.
MCP Switch sits in the middle:
local stdio MCP ─┐
┼──► MCP Switch ──► one OAuth URL ──► claude.ai / ChatGPT / …
yet another MCP ─┘ (your VPS)
- Aggregate any number of MCP servers — remote (URL) or local (stdio, hosted on your box) — into one endpoint.
- Connect once. Your AI sees a single connector; behind it are all your tools.
- Manage from a console — add servers, group tools, scope which agent sees what, watch an audit log.
- Work with the console through WebMCP — supported browser agents can inspect the gateway, open App Lab diagnostics, and prepare review-only connection drafts in the same signed-in page.
- Pure relay. MCP Switch ships no tools of its own; it forwards tools, schemas, results and even MCP-Apps UI widgets transparently.
Architecture
A single service (:4577) + a console SPA it serves:
| Part | Role |
|---|---|
| MCP gateway | Public MCP endpoint (/mcp), OAuth 2.1, management console (/console) |
| Registry | Connects to upstream MCP servers in-process — remote (HTTP) and local (stdio) |
| Store | One SQLite file: agents, OAuth, audit, the skill registry, and the server registry |
No separate backend, no inter-service HTTP — the gateway talks to upstream servers directly and aggregates them.
Quick start (Docker)
git clone https://github.com/asashiki/mcp-switch.git
cd mcp-switch
cp .env.example .env
# edit .env → set MCP_PUBLIC_URL to enable OAuth + the console (leave empty for local)
docker compose -f infra/docker/compose.yaml --env-file .env up -d --build
Then:
- Health:
curl http://127.0.0.1:4577/health - Console: open
http://127.0.0.1:4577/console(set a password first — see below)
Behind a reverse proxy on the same VPS? Set
MCP_PUBLIC_URL; keep the host-side port bound to127.0.0.1.
Set the console password
docker compose -f infra/docker/compose.yaml exec mcp-switch \
node dist/cli/console-admin.js set admin "your-password"
Quick start (local dev)
pnpm install
cp .env.example .env # leave MCP_PUBLIC_URL empty for an anonymous local /mcp
pnpm dev # gateway :4577 + console :5173
安装
npx -y steam-mcp-server配置
{ "mcpServers": { "context7": {
"serverUrl": "https://mcp.context7.com/mcp",
"headers": { "CONTEXT7_API_KEY": "..." }
}}}