ドキュメント · MCP ハブ
-MCP ハブ
-magpie の ライブラリ に追加した MCP サーバーは、通常はサーバーごとに一つずつ、各エージェントの設定に書き込まれます。MCP ハブ をオンにすると、各エージェントには代わりに magpie という一つのサーバーだけが渡され、magpie が各呼び出しを裏のライブラリのサーバーに渡します。既定ではオフです。
ドキュメント · MCP ルーター
+MCP ルーター
+magpie の ライブラリ に追加した MCP サーバーは、通常はサーバーごとに一つずつ、各エージェントの設定に書き込まれます。MCP ルーター をオンにすると、各エージェントには代わりに magpie という一つのサーバーだけが渡され、magpie が各呼び出しを裏のライブラリのサーバーに渡します。既定ではオフです。
- 設定は一度。ライブラリで一度書いたサーバーが、一つのエントリですべてのエージェントとアプリに届きます。
- 動かすのも一度。コマンドのサーバー(
npx …のようにプログラムとして起動するもの)は、エージェントごとではなく magpie の中で一つだけ動きます。10 分間呼び出しのないサーバーは止まり、次の呼び出しでまた起動します。
@@ -93,21 +93,21 @@
- ページを開くライブラリ → MCP を開きます。 -
- スイッチを入れるサーバー一覧の下の MCP ハブ をオンにします。ライブラリのサーバーにチェックが入っていて、HTTP(Streamable HTTP)でサーバーにつなげるエージェントには、magpie のゲートウェイの
/mcp/magpie/hub/<agent>を指すmagpieエントリが一つ渡され、それらのサーバーの個別のエントリは設定から外されます。
+ - スイッチを入れるサーバー一覧の下の MCP ルーター をオンにします。ライブラリのサーバーにチェックが入っていて、HTTP(Streamable HTTP)でサーバーにつなげるエージェントには、magpie のゲートウェイの
/mcp/magpie/hub/<agent>を指すmagpieエントリが一つ渡され、それらのサーバーの個別のエントリは設定から外されます。 - エージェントを再起動エージェントは次に起動したときに変更を読みます。
- Set up once. A server written once in the Library reaches every agent and app through one entry.
- Run once. A command server (one started as a program, such as
npx …) runs once in magpie, not once in each agent. A server with no calls for 10 minutes is stopped and starts again on the next call.
@@ -93,21 +93,21 @@
- Open the pageGo to Library → MCP. -
- Switch it onBelow the server list, turn on MCP hub. Each agent that has Library servers ticked and can reach a server over HTTP (Streamable HTTP) gets one
magpieentry at/mcp/magpie/hub/<agent>on magpie’s gateway, and those servers’ own entries are taken out of its config.
+ - Switch it onBelow the server list, turn on MCP router. Each agent that has Library servers ticked and can reach a server over HTTP (Streamable HTTP) gets one
magpieentry at/mcp/magpie/hub/<agent>on magpie’s gateway, and those servers’ own entries are taken out of its config. - Restart your agentsAn agent reads the change when it starts again.
- 配一次。资源库里写好一次的服务器,通过一个条目给所有 Agent 和应用使用。
- 只运行一份。命令型服务器(以程序启动的,比如
npx …)在 magpie 里只运行一份,而不是每个 Agent 各起一份。10 分钟没有调用的服务器会被停掉,下次调用时再启动。
@@ -93,21 +93,21 @@
- 打开页面进入 资源库 → MCP。 -
- 打开开关在服务器列表下方打开 MCP 聚合。每个勾选了资源库服务器、且能通过 HTTP(Streamable HTTP)连接服务器的 Agent,会得到一个
magpie条目,地址是 magpie 网关上的/mcp/magpie/hub/<agent>,那些服务器原来的条目会从它的配置里移除。
+ - 打开开关在服务器列表下方打开 MCP 路由。每个勾选了资源库服务器、且能通过 HTTP(Streamable HTTP)连接服务器的 Agent,会得到一个
magpie条目,地址是 magpie 网关上的/mcp/magpie/hub/<agent>,那些服务器原来的条目会从它的配置里移除。 - 重启 AgentAgent 重新启动后才会读到改动。
オンにする
オフにすると、各サーバーの個別のエントリが書き戻され、magpie が書いた magpie エントリだけが外れ、ハブが起動したサーバーはすべて止まります。コマンドラインでは:
オフにすると、各サーバーの個別のエントリが書き戻され、magpie が書いた magpie エントリだけが外れ、ルーターが起動したサーバーはすべて止まります。コマンドラインでは:
magpie library mcp hub on -magpie library mcp hub off+
magpie library mcp router on +magpie library mcp router off
magpie library で、ハブを渡されたエージェントと個別のエントリを残すエージェントが、理由とともに一覧できます。
magpie library で、ルーターを渡されたエージェントと個別のエントリを残すエージェントが、理由とともに一覧できます。
ほかのアプリ
-ハブがオンのとき、ほかのアプリ の行に /mcp/magpie/hub で終わるアドレスが出ます。ここではライブラリのすべてのサーバーを提供します。接続… を押すと、Cursor、VS Code、Windsurf、JSON の MCP 設定を受け付けるアプリ向けのエントリがコピーできるシートが開きます。アプリのウィンドウでは、Cursor と VS Code には 追加 もあり、そのアプリが開いて確認を求めます。別のコンピュータのアプリには、ネットワークからのほかのリクエストと同じくゲートウェイのキーが必要です(リモート magpie を参照)。
ルーターがオンのとき、ほかのアプリ の行に /mcp/magpie/hub で終わるアドレスが出ます。ここではライブラリのすべてのサーバーを提供します。接続… を押すと、Cursor、VS Code、Windsurf、JSON の MCP 設定を受け付けるアプリ向けのエントリがコピーできるシートが開きます。アプリのウィンドウでは、Cursor と VS Code には 追加 もあり、そのアプリが開いて確認を求めます。別のコンピュータのアプリには、ネットワークからのほかのリクエストと同じくゲートウェイのキーが必要です(リモート magpie を参照)。
自分のエントリを残すエージェント
次のエージェントは各サーバーの個別のエントリを残し、ライブラリのページにどれがなぜかが表示されます:
@@ -136,7 +136,7 @@ magpie library mcp hub off Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 GitHub diff --git a/site/public/docs/ja/plugins.html b/site/public/docs/ja/plugins.html index e20b13fa0..b4350218a 100644 --- a/site/public/docs/ja/plugins.html +++ b/site/public/docs/ja/plugins.html @@ -50,7 +50,7 @@ Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 リリース @@ -776,7 +776,7 @@ claude mcp add --transport http magpie-tools http://127.0.0.1:3425/mcp/magpie/to設定 → プラグインには各プラグインのツールがこの名前で表示され、サーバーのアドレスをコピーできます。args は zod のフィールド定義(tool.schema は zod)、zod オブジェクト、または JSON Schema オブジェクトです。エージェントにはこれが示され、magpie は execute の前に呼び出しの引数をこれで検証します。引数が正しくなければ、その引数を示すエラーを返します。ctx は OpenCode と同じで、agent は呼び出したエージェントです。ツールの実行時間は 55 秒までで、時間切れになると ctx.abort が発火します。
このサーバーは組み込みプラグイン プラグインのツール が提供します。オンのプラグインがツールを提供している間はオンのままで、オフのときはツールが一覧に出ず、呼び出しにはオフであることが返ります。ゲートウェイキーでの呼び出しはそのキーの上限に数えられます。ツールはプロバイダープラグインと同じくあなたの権限でプラグインホスト内で動き、結果は呼び出したエージェントにだけ返ります。
-ツールを提供するプラグインは、ライブラリの MCP タブにもそれぞれ独立したサーバーとして現れ、プラグインの短い名前(search1api)が付きます。アドレスを手で追加する必要はありません。MCP ハブがオンなら、そのツールはハブを使うすべてのエージェントに search1api__search として出ます。ほかのライブラリのサーバーと同じく、エージェントごとにオン・オフでき、ツールを一つずつ止めることもできます。削除すると、プラグインを外して追加し直すまで戻りません。
ツールを提供するプラグインは、ライブラリの MCP タブにもそれぞれ独立したサーバーとして現れ、プラグインの短い名前(search1api)が付きます。アドレスを手で追加する必要はありません。MCP ルーターがオンなら、そのツールはルーターを使うすべてのエージェントに search1api__search として出ます。ほかのライブラリのサーバーと同じく、エージェントごとにオン・オフでき、ツールを一つずつ止めることもできます。削除すると、プラグインを外して追加し直すまで戻りません。
エージェントプラグイン
プラグインはエージェントを追加することもできます。magpie に組み込みの設定がないエージェントです。そのエージェントがモデルをどこに書くか、magpie のゲートウェイを使うために他に何を書くかを伝えます。するとエージェントは magpie 自身のものと同じようにエージェントページに並びます。その行で magpie のモデルを選ぶと、magpie はモデルをゲートウェイのアドレスとエージェント専用のキーと一緒に設定へ書き込み、スイッチを切るとすべてユーザーの元の状態に戻します。下の例は Aider を追加します。
@@ -995,7 +995,7 @@ document.getElementById("calls").textContent = `${s.calls Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 GitHub diff --git a/site/public/docs/ja/privacy.html b/site/public/docs/ja/privacy.html index e7e6c952c..abbc49965 100644 --- a/site/public/docs/ja/privacy.html +++ b/site/public/docs/ja/privacy.html @@ -50,7 +50,7 @@ Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 リリース @@ -217,7 +217,7 @@ Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 GitHub diff --git a/site/public/docs/ja/remote.html b/site/public/docs/ja/remote.html index 598e62373..f7c1ef3b3 100644 --- a/site/public/docs/ja/remote.html +++ b/site/public/docs/ja/remote.html @@ -50,7 +50,7 @@ Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 リリース @@ -158,7 +158,7 @@ magpie provider refresh office # 一覧を再取得Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 GitHub diff --git a/site/public/docs/ja/start.html b/site/public/docs/ja/start.html index 91c8e3901..6dd94a227 100644 --- a/site/public/docs/ja/start.html +++ b/site/public/docs/ja/start.html @@ -50,7 +50,7 @@ Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 リリース @@ -331,7 +331,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve Docker プライバシー プライバシーマスキング - MCP ハブ + MCP ルーター magpie に追加 アプリ連携 GitHub diff --git a/site/public/docs/masking.html b/site/public/docs/masking.html index c1285f9c0..5cc8cc727 100644 --- a/site/public/docs/masking.html +++ b/site/public/docs/masking.html @@ -50,7 +50,7 @@ Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate Releases @@ -173,7 +173,7 @@ Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate GitHub diff --git a/site/public/docs/mcp-hub.html b/site/public/docs/mcp-router.html similarity index 82% rename from site/public/docs/mcp-hub.html rename to site/public/docs/mcp-router.html index f0de81954..01405f469 100644 --- a/site/public/docs/mcp-hub.html +++ b/site/public/docs/mcp-router.html @@ -3,8 +3,8 @@ -Docs · MCP hub
-MCP hub
-The MCP servers you add in magpie’s Library are normally written into each agent’s own config, one entry per server. With the MCP hub on, each agent is given a single server named magpie instead, and magpie passes each call on to the Library server behind it. It is off by default.
Docs · MCP router
+MCP router
+The MCP servers you add in magpie’s Library are normally written into each agent’s own config, one entry per server. With the MCP router on, each agent is given a single server named magpie instead, and magpie passes each call on to the Library server behind it. It is off by default.
Turn it on
Turning it off writes each server’s own entry back, removes only the magpie entry magpie wrote, and stops every server the hub started. From the command line:
Turning it off writes each server’s own entry back, removes only the magpie entry magpie wrote, and stops every server the router started. From the command line:
magpie library mcp hub on -magpie library mcp hub off+
magpie library mcp router on +magpie library mcp router off
magpie library lists which agents are given the hub and which keep their own entries, with why.
magpie library lists which agents are given the router and which keep their own entries, with why.
Other apps
-With the hub on, the Other apps row shows an address ending in /mcp/magpie/hub, which serves every server in the Library. Connect… opens a sheet with a ready entry to copy for Cursor, VS Code, Windsurf or any app that takes a JSON MCP config; in the app window, Cursor and VS Code also have Add, which opens the app to confirm. An app on another computer needs a gateway key, as every request from your network does (see Remote magpie).
With the router on, the Other apps row shows an address ending in /mcp/magpie/hub, which serves every server in the Library. Connect… opens a sheet with a ready entry to copy for Cursor, VS Code, Windsurf or any app that takes a JSON MCP config; in the app window, Cursor and VS Code also have Add, which opens the app to confirm. An app on another computer needs a gateway key, as every request from your network does (see Remote magpie).
Agents that keep their own entries
These agents keep each server’s own entry, and the Library page says which and why:
@@ -136,7 +136,7 @@ magpie library mcp hub off Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate GitHub diff --git a/site/public/docs/plugins.html b/site/public/docs/plugins.html index 20d67ad24..969f01a42 100644 --- a/site/public/docs/plugins.html +++ b/site/public/docs/plugins.html @@ -50,7 +50,7 @@ Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate Releases @@ -776,7 +776,7 @@ claude mcp add --transport http magpie-tools http://127.0.0.1:3425/mcp/magpie/toSettings → Plugins lists each plugin’s tools by these names and copies the server’s address. args is a zod shape (tool.schema is zod), a zod object or a JSON Schema object. The agent is shown it, and magpie checks a call’s arguments against it before execute runs; a wrong argument is answered as an error naming it. ctx is OpenCode’s, with agent the agent that called. A tool has 55 seconds, and ctx.abort fires when they are up.
The built-in plugin Plugin tools serves the server. It stays on while a plugin that is on gives a tool; off, no tool is listed and a call says so. A call made with a gateway key counts against that key’s limits. A tool runs in the plugin host with your rights, as a provider plugin does, and its answer goes only to the agent that called it.
-Each plugin that gives tools is also a server of its own in the Library’s MCP tab, named by the plugin’s short name (search1api), so you don’t have to add the address by hand. With the MCP hub on, its tools are in the hub of every agent the hub is given, as search1api__search; switch it on or off per agent, or turn single tools off, as with any Library server. Removed, it comes back only when you remove the plugin and add it again.
Each plugin that gives tools is also a server of its own in the Library’s MCP tab, named by the plugin’s short name (search1api), so you don’t have to add the address by hand. With the MCP router on, its tools are in the router of every agent the router is given, as search1api__search; switch it on or off per agent, or turn single tools off, as with any Library server. Removed, it comes back only when you remove the plugin and add it again.
Agent plugins
A plugin can also add an agent: one magpie has no setup of its own for. It says where the agent keeps its model and what else to write there for the agent to use magpie’s gateway. The agent is then on the Agents page like magpie’s own: pick one of magpie’s models in its row and magpie writes it into the agent’s config, with the gateway’s address and a key of the agent’s own; switch it off and everything goes back to how the user had it. The example below adds Aider.
@@ -995,7 +995,7 @@ document.getElementById("calls").textContent = `${s.calls Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate GitHub diff --git a/site/public/docs/privacy.html b/site/public/docs/privacy.html index f38039852..9be50b01d 100644 --- a/site/public/docs/privacy.html +++ b/site/public/docs/privacy.html @@ -50,7 +50,7 @@ Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate Releases @@ -217,7 +217,7 @@ Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate GitHub diff --git a/site/public/docs/remote.html b/site/public/docs/remote.html index 5390fecbf..246abe6b5 100644 --- a/site/public/docs/remote.html +++ b/site/public/docs/remote.html @@ -50,7 +50,7 @@ Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate Releases @@ -158,7 +158,7 @@ magpie provider refresh office # fetch its list again Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate GitHub diff --git a/site/public/docs/start.html b/site/public/docs/start.html index d34bcf656..871e77e88 100644 --- a/site/public/docs/start.html +++ b/site/public/docs/start.html @@ -50,7 +50,7 @@ Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate Releases @@ -331,7 +331,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve Docker Privacy Privacy masking - MCP hub + MCP router Add to magpie Integrate GitHub diff --git a/site/public/docs/zh/docker.html b/site/public/docs/zh/docker.html index eb7d03bec..d65665e9e 100644 --- a/site/public/docs/zh/docker.html +++ b/site/public/docs/zh/docker.html @@ -50,7 +50,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -222,7 +222,7 @@ docker logs magpie Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/public/docs/zh/import.html b/site/public/docs/zh/import.html index e99855071..14106d310 100644 --- a/site/public/docs/zh/import.html +++ b/site/public/docs/zh/import.html @@ -50,7 +50,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -266,7 +266,7 @@ href = "https://usemagpie.ai/import#" + urlencode({ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 GitHub Discord 版本发布 diff --git a/site/public/docs/zh/integrate.html b/site/public/docs/zh/integrate.html index f9121262c..000436172 100644 --- a/site/public/docs/zh/integrate.html +++ b/site/public/docs/zh/integrate.html @@ -49,7 +49,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -157,7 +157,7 @@ curl -s http://127.0.0.1:3425/v1/models -H "Authorization: Bearer magpie-acme" Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/public/docs/zh/intent.html b/site/public/docs/zh/intent.html index 1e40d2d15..54b739885 100644 --- a/site/public/docs/zh/intent.html +++ b/site/public/docs/zh/intent.html @@ -50,7 +50,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -329,7 +329,7 @@ The number of its kind (0 for none): Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/public/docs/zh/masking.html b/site/public/docs/zh/masking.html index 9465d9e47..ba3e0179c 100644 --- a/site/public/docs/zh/masking.html +++ b/site/public/docs/zh/masking.html @@ -50,7 +50,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -173,7 +173,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/public/docs/zh/mcp-hub.html b/site/public/docs/zh/mcp-router.html similarity index 85% rename from site/public/docs/zh/mcp-hub.html rename to site/public/docs/zh/mcp-router.html index d79b9ea67..4b96db3cf 100644 --- a/site/public/docs/zh/mcp-hub.html +++ b/site/public/docs/zh/mcp-router.html @@ -3,8 +3,8 @@ -文档 · MCP 聚合
-MCP 聚合
-你在 magpie 资源库 里添加的 MCP 服务器,平时会写进每个 Agent 自己的配置,一个服务器一条。打开 MCP 聚合 后,每个 Agent 只拿到一个名为 magpie 的服务器,magpie 再把每次调用转给后面对应的资源库服务器。默认关闭。
文档 · MCP 路由
+MCP 路由
+你在 magpie 资源库 里添加的 MCP 服务器,平时会写进每个 Agent 自己的配置,一个服务器一条。打开 MCP 路由 后,每个 Agent 只拿到一个名为 magpie 的服务器,magpie 再把每次调用转给后面对应的资源库服务器。默认关闭。
打开
关闭后,每个服务器自己的条目会写回去,只移除 magpie 写入的那个 magpie 条目,聚合启动的服务器也会全部停掉。命令行:
关闭后,每个服务器自己的条目会写回去,只移除 magpie 写入的那个 magpie 条目,MCP 路由启动的服务器也会全部停掉。命令行:
magpie library mcp hub on -magpie library mcp hub off+
magpie library mcp router on +magpie library mcp router off
magpie library 会列出哪些 Agent 用上了聚合、哪些保留各自的条目,以及原因。
magpie library 会列出哪些 Agent 用上了 MCP 路由、哪些保留各自的条目,以及原因。
其他应用
-聚合打开后,其他应用 一行显示一个以 /mcp/magpie/hub 结尾的地址,它提供资源库里的所有服务器。连接… 会打开一个面板,里面有给 Cursor、VS Code、Windsurf 或任何接受 JSON MCP 配置的应用准备好的条目,可直接复制;在应用窗口里,Cursor 和 VS Code 还有 添加,会打开对应应用让你确认。另一台电脑上的应用需要网关密钥,和局域网里的其他请求一样(见 远程 magpie)。
MCP 路由打开后,其他应用 一行显示一个以 /mcp/magpie/hub 结尾的地址,它提供资源库里的所有服务器。连接… 会打开一个面板,里面有给 Cursor、VS Code、Windsurf 或任何接受 JSON MCP 配置的应用准备好的条目,可直接复制;在应用窗口里,Cursor 和 VS Code 还有 添加,会打开对应应用让你确认。另一台电脑上的应用需要网关密钥,和局域网里的其他请求一样(见 远程 magpie)。
保留各自条目的 Agent
以下 Agent 会保留每个服务器自己的条目,资源库页面会写明是哪些、为什么:
@@ -136,7 +136,7 @@ magpie library mcp hub off Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/public/docs/zh/plugins.html b/site/public/docs/zh/plugins.html index ad4b5ecb1..1d5626cbc 100644 --- a/site/public/docs/zh/plugins.html +++ b/site/public/docs/zh/plugins.html @@ -50,7 +50,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -776,7 +776,7 @@ claude mcp add --transport http magpie-tools http://127.0.0.1:3425/mcp/magpie/to设置 → 插件里会按这些名字列出每个插件的工具,并能复制服务器地址。args 可以是 zod 字段表(tool.schema 就是 zod)、zod 对象或 JSON Schema 对象。智能体会看到它,magpie 在 execute 运行前按它检查调用的参数;参数不对时回一个写明是哪个参数的错误。ctx 与 OpenCode 的相同,agent 是发起调用的智能体。每个工具最多运行 55 秒,到时 ctx.abort 触发。
这个服务器由内置插件 插件工具 提供。只要有已开启的插件提供工具,它就保持开启;关闭时不列出任何工具,调用会说明它已关闭。用网关密钥发起的调用计入该密钥的限额。工具和提供方插件一样,以你的权限在插件宿主里运行,结果只回给调用它的智能体。
-每个提供工具的插件也会在资料库的 MCP 页里成为一个独立的服务器,以插件的短名命名(如 search1api),不用再手动添加地址。开启 MCP 聚合时,它的工具会出现在每个接入聚合的智能体里,名为 search1api__search;和资料库里其他服务器一样,可以按智能体开关,或单独关掉某个工具。删掉后,只有把插件移除再重新添加才会再出现。
每个提供工具的插件也会在资料库的 MCP 页里成为一个独立的服务器,以插件的短名命名(如 search1api),不用再手动添加地址。开启 MCP 路由时,它的工具会出现在每个接入路由的智能体里,名为 search1api__search;和资料库里其他服务器一样,可以按智能体开关,或单独关掉某个工具。删掉后,只有把插件移除再重新添加才会再出现。
Agent 插件
插件还可以添加一个 Agent:magpie 没有内置接入的那种。它说明这个 Agent 把模型写在哪里,以及还要写些什么才能让 Agent 走 magpie 的网关。这样它就和 magpie 内置的 Agent 一样出现在 Agent 页:在它那一行选一个 magpie 的模型,magpie 就把模型连同网关地址和这个 Agent 自己的 key 写进它的配置;关掉开关,一切恢复成用户原来的样子。下面的例子添加 Aider。
@@ -995,7 +995,7 @@ document.getElementById("calls").textContent = `${s.calls Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/public/docs/zh/privacy.html b/site/public/docs/zh/privacy.html index 5a475c9fa..d919bf1f5 100644 --- a/site/public/docs/zh/privacy.html +++ b/site/public/docs/zh/privacy.html @@ -50,7 +50,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -217,7 +217,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/public/docs/zh/remote.html b/site/public/docs/zh/remote.html index 2f5cc934b..9257aeaf3 100644 --- a/site/public/docs/zh/remote.html +++ b/site/public/docs/zh/remote.html @@ -50,7 +50,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -158,7 +158,7 @@ magpie provider refresh office # 重新获取列表Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/public/docs/zh/start.html b/site/public/docs/zh/start.html index f6fd549ec..a440f6dec 100644 --- a/site/public/docs/zh/start.html +++ b/site/public/docs/zh/start.html @@ -50,7 +50,7 @@ Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 版本发布 @@ -331,7 +331,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve Docker 隐私 本地脱敏 - MCP 聚合 + MCP 路由 Add to magpie 接入应用 GitHub diff --git a/site/worker.js b/site/worker.js index 885510c0c..2101bfebc 100644 --- a/site/worker.js +++ b/site/worker.js @@ -60,6 +60,9 @@ const SHORT = { // The bare docs paths open the getting-started guide. const DOCS = { "/docs": "/docs/start", "/docs/zh": "/docs/zh/start", "/docs/ja": "/docs/ja/start" }; +// pages that moved, from the old path (no .html) to the new one: the MCP +// hub was renamed the MCP router +const MOVED = { "/docs/mcp-hub": "/docs/mcp-router", "/docs/zh/mcp-hub": "/docs/zh/mcp-router", "/docs/ja/mcp-hub": "/docs/ja/mcp-router" }; // the languages the docs are written in besides English const DOC_LANGS = ["zh", "ja"]; @@ -131,6 +134,8 @@ export default { } const guide = DOCS[url.pathname.replace(/\/+$/, "")]; if (guide) return Response.redirect(new URL(guide, url).toString(), 302); + const moved = MOVED[url.pathname.replace(/(\.html)?\/*$/, "")]; + if (moved) return Response.redirect(new URL(moved + url.search, url).toString(), 301); // an English docs page, to a browser whose language has its own: as / // does, until a language is picked const doc = url.pathname.match(/^\/docs\/([a-z-]+)(\.html)?$/); diff --git a/site/worker.test.mjs b/site/worker.test.mjs index 3c5fec0e6..2d51e4d0b 100644 --- a/site/worker.test.mjs +++ b/site/worker.test.mjs @@ -172,6 +172,18 @@ test("docs: the bare docs paths open each language's guide", async () => { } }); +test("docs: the MCP hub's old pages go to the MCP router's, keeping the query", async () => { + const env = { ASSETS: { fetch: async () => new Response("asset") } }; + for (const [from, to] of [["/docs/mcp-hub", "/docs/mcp-router"], ["/docs/mcp-hub.html", "/docs/mcp-router"], ["/docs/zh/mcp-hub/", "/docs/zh/mcp-router"], ["/docs/ja/mcp-hub.html?x=1", "/docs/ja/mcp-router?x=1"]]) { + const res = await worker.fetch(new Request("https://usemagpie.ai" + from), env, ctx); + assert.equal(res.status, 301, from); + const got = new URL(res.headers.get("Location")); + assert.equal(got.pathname + got.search, to, from); + } + const res = await worker.fetch(new Request("https://usemagpie.ai/docs/mcp-router"), env, ctx); + assert.equal(await res.text(), "asset"); +}); + // #661: the update window showed no notes while GitHub's API limited the // worker, and the failure was kept for five minutes. const ask = (path, env = {}) => worker.fetch(new Request("https://usemagpie.ai" + path), env, ctx);