docs: the MCP router page says how tools go on demand (dangzhuotong on X)

dangzhuotong asked on X whether magpie's router can expose only the tools
a task needs. It does (hub_ondemand.go, since v0.1.2950), but the MCP
router page in en, zh and ja didn't say so. Each now has a "Tools on
demand" section: past 10 tools an agent is given find_tools (best 5 with
parameters, 15 more by name) and call_tool in their place, on by
default; Claude Code, Claude Desktop, Codex, Pi, Droid and omp
(hubSearchesItself), an agent with 10 or fewer, and the Other apps
address get every tool; Library -> MCP -> Tools on demand turns it off
(settings routerAllTools, the GUI's own label in each language). There
is no CLI for it, so none is named.

llms-full.txt, search/{en,zh,ja}.json and docs-index.sums rebuilt with
docs-index.mjs's writeAll.

Run in WSL magpie-desktop via wsl-run (mote at load 40-52, mica's disk
full), at this tree: node --test site/search.test.mjs worker.test.mjs
files.test.mjs: 58 of 58; go test -tags nogui ./internal/testenv (the
docs-index sums guard): ok.
Not run: the Go suite and GUI files (no Go or GUI change).
This commit is contained in:
yetone
2026-11-18 22:07:15 +08:00
parent 09944544d6
commit 35a03fee0f
8 changed files with 44 additions and 6 deletions
+3 -3
View File
@@ -110,7 +110,7 @@ f063a06ffc57785ad0f8f40f0b2f0bd2ae897ec9d6f290cf664bae2e12d899ed docs/ja/intent
4d665a14ad50a99e6a035a6b8217a67feac0541623244f71daff2e2ce6297a00 docs/ja/lody.html
9bea8e6efdb7f57ce75fd89c239d2829af4222b1bb9917e823c1ba102e05fdb2 docs/ja/longcat.html
7b5a0c8413ba3095ce4cdbb75915de32f44abf75d13e085bacf0199279012773 docs/ja/masking.html
00ba8b13585f45d00f86e8958d67984e1227334e8d7b1677b61255dc4ee6f3d1 docs/ja/mcp-router.html
f8f7c4da5a6ca001ed40006701c019543f4a162b3dc490e9f9bc0093b166efb5 docs/ja/mcp-router.html
0a1bd26af3942a3537a6006a0aa78981f7dffe12c20f11a7b830906d765f6dce docs/ja/minimax.html
a52e5907f53affdf8e3cb348886fd2520343fce404e8fbab15498fff8dcfe673 docs/ja/miniq.html
1fc928d5ca3f04df3d9242b5308dd23e2f1918ec68c74340c52754c36a46835b docs/ja/mirrors.html
@@ -185,7 +185,7 @@ f83bd40947cc12cac5e7477e91f5531328872f6459e8ee1e31b6d2f190095e77 docs/local-mod
bd548638edd3756c4331ee720516e2f0de897f57e691c8a78a1d414110c3bf2d docs/lody.html
eaad977724db5b88137e9be4c1734ba9065a4d45dbba3354490a876c79d55313 docs/longcat.html
0d36ee3e874cb2f7fc720a3320c9c91e7c8117a50551ec1e7a13da28d3ceaa7c docs/masking.html
18e43cee747eb7964282836e95f33fc3705560bf1aaee0607a3478bf5b7c18ce docs/mcp-router.html
be0600229e330e3171beeac64e3932dcbd74f1f0f5406a7fc3eaf5ead9ca18ce docs/mcp-router.html
4c0629bd0c76c7ecc9bd4559991d58eebb51ac4f2bc88f3a2660036c0b9524d1 docs/minimax.html
2b377d49172ec2d3c79c8378595602f441e875af34e09d825270d11cfbdd4b91 docs/miniq.html
62798ef1f942fbdbb1b420318d4bf0bbec4eb7ded9ee2b6fa645fb786a23611d docs/mirrors.html
@@ -310,7 +310,7 @@ ae704fe7a6aaf74c1ecbe2aab1efc86db51c73424d71518baf567a28f9502b3c docs/zh/librar
16be660a0d387ebcde497f1bdc2f645fae8158ae81592670ddffa80ed5060d12 docs/zh/lody.html
37549abe83acef720dffbc8a085227084556b0ad8ae543ad4f2ee71023a1afcc docs/zh/longcat.html
48c22c5e63678f221e3b604da134de0bc7f06b7274d6aaa2d80a793e2759ed3d docs/zh/masking.html
276314968edb73a40864c9182b101d7b8bce2cff7306934646dd470c8fabecd0 docs/zh/mcp-router.html
fc2728e0847c7c277545ca5812ca3bef3c805b30c1838b02040ffee6e208d92c docs/zh/mcp-router.html
45a02efc89166679be0ddb321f139ccb7c285bba14948a850f3dc4371a1ac159 docs/zh/minimax.html
64e838ea41c9f8f3d493ec027b444864acfbdc4eddfd96b471d90903dada34b2 docs/zh/miniq.html
3dd4df392c315918b9caf680e4f091938cb3745e0b1326adf86981f8fcdb401b docs/zh/mirrors.html
+9
View File
@@ -164,6 +164,15 @@ magpie library mcp router off</pre>
</div>
<p><code>magpie library</code> で、ルーターを渡されたエージェントと個別のエントリを残すエージェントが、理由とともに一覧できます。</p>
<h2 id="on-demand"><a class="anchor" href="#on-demand">ツールをオンデマンドで渡す</a></h2>
<p>エージェントに渡したツールは、パラメーターのスキーマ全体とともに毎回のリクエストで送られます。そのため、ルーター経由で 10 個を超えるツールを渡されるエージェントには、代わりに 2 つのツールを渡します。これは<b>既定でオン</b>です:</p>
<ul>
<li><b><code>find_tools</code></b>:タスクに必要な語で一致するツールを探します。上位 5 個は説明とパラメーター付きで、続けて最大 15 個を名前で返します。説明には各サーバーとそのツールが書かれているので、モデルは何が探せるかを知っています。</li>
<li><b><code>call_tool</code></b>:ツールを名前で、引数とともに実行します。</li>
</ul>
<p>MCP ツールを自分で検索するエージェントにはすべてのツールを渡し、そのエージェント自身の検索が毎回のリクエストからツールを外します:Claude Code、Claude Desktop、Codex、Pi、Droid、omp。ツールが 10 個以下のエージェントと、<a href="#apps">ほかのアプリ</a> のアドレスに接続するアプリ(どのアプリかは magpie にはわかりません)にもすべてのツールを渡します。</p>
<p>すべてのエージェントにすべてのツールを渡すには、<span class="ui">ライブラリ</span> → <span class="ui">MCP</span> の <span class="ui">MCP ルーター</span> の下にある <span class="ui">ツールをオンデマンドで渡す</span> をオフにして、エージェントを再起動してください。</p>
<h2 id="apps"><a class="anchor" href="#apps">ほかのアプリ</a></h2>
<p>ルーターがオンのとき、<span class="ui">ほかのアプリ</span> の行に <code>/mcp/magpie/hub</code> で終わるアドレスが出ます。ここではライブラリのすべてのサーバーを提供します。<span class="ui">接続…</span> を押すと、Cursor、VS Code、Windsurf、JSON の MCP 設定を受け付けるアプリ向けのエントリがコピーできるシートが開きます。アプリのウィンドウでは、Cursor と VS Code には <span class="ui">追加</span> もあり、そのアプリが開いて確認を求めます。別のコンピュータのアプリには、ネットワークからのほかのリクエストと同じくゲートウェイのキーが必要です(<a href="/docs/ja/remote">リモート magpie</a> を参照)。</p>
<div class="callout"><b>コマンドのサーバーはこのコンピュータで動きます。</b>ネットワーク上でゲートウェイのキーを持つ人は、ルーターを通してあなたの権限でそれを呼び出せます。キーは信頼できる人にだけ渡してください。</div>
+9
View File
@@ -164,6 +164,15 @@ magpie library mcp router off</pre>
</div>
<p><code>magpie library</code> lists which agents are given the router and which keep their own entries, with why.</p>
<h2 id="on-demand"><a class="anchor" href="#on-demand">Tools on demand</a></h2>
<p>Every tool an agent is given goes out, with its whole parameter schema, on every request. So an agent given more than 10 tools through the router is given two in their place, and this is <b>on by default</b>:</p>
<ul>
<li><b><code>find_tools</code></b> takes the words of what the task needs and gives the tools that match: the best 5 with their description and parameters, then up to 15 more by name. Its own description names each server and its tools, so the model knows what there is to find.</li>
<li><b><code>call_tool</code></b> runs a tool by name, with its arguments.</li>
</ul>
<p>An agent that searches its MCP tools itself is given every tool, and its own search keeps them out of each request: Claude Code, Claude Desktop, Codex, Pi, Droid and omp. So is an agent given 10 tools or fewer, and an app at the <a href="#apps">Other apps</a> address, since magpie can’t tell which app that is.</p>
<p>To give every agent every tool instead, turn off <span class="ui">Tools on demand</span> under <span class="ui">MCP router</span> in <span class="ui">Library</span> → <span class="ui">MCP</span>, then restart your agents.</p>
<h2 id="apps"><a class="anchor" href="#apps">Other apps</a></h2>
<p>With the router on, the <span class="ui">Other apps</span> row shows an address ending in <code>/mcp/magpie/hub</code>, which serves every server in the Library. <span class="ui">Connect…</span> 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 <span class="ui">Add</span>, which opens the app to confirm. An app on another computer needs a gateway key, as every request from your network does (see <a href="/docs/remote">Remote magpie</a>).</p>
<div class="callout"><b>Command servers run on this computer.</b> Anyone holding a gateway key on your network can call them through the router, with your rights here. Only share keys with people you trust.</div>
+9
View File
@@ -164,6 +164,15 @@ magpie library mcp router off</pre>
</div>
<p><code>magpie library</code> 会列出哪些 Agent 用上了 MCP 路由、哪些保留各自的条目,以及原因。</p>
<h2 id="on-demand"><a class="anchor" href="#on-demand">按需加载工具</a></h2>
<p>给 Agent 的每个工具,连同完整的参数定义,会随每次请求一起发出。所以通过 MCP 路由拿到超过 10 个工具的 Agent,会改为拿到两个工具,<b>默认开启</b>:</p>
<ul>
<li><b><code>find_tools</code></b>:按任务需要的关键词查找匹配的工具,最匹配的 5 个附带描述和参数,其后最多再列 15 个工具名。它自己的描述里列出了每个服务器和它的工具,模型知道有哪些可找。</li>
<li><b><code>call_tool</code></b>:按名字运行一个工具,并传入参数。</li>
</ul>
<p>自己会搜索 MCP 工具的 Agent 仍会拿到全部工具,由它自己的工具搜索把工具挡在每次请求之外:Claude Code、Claude Desktop、Codex、Pi、Droid 和 omp。工具不超过 10 个的 Agent,以及连接 <a href="#apps">其他应用</a> 地址的应用(magpie 无法知道是哪个应用),也拿到全部工具。</p>
<p>想让所有 Agent 都拿到全部工具,在 <span class="ui">资源库</span> → <span class="ui">MCP</span> 的 <span class="ui">MCP 路由</span> 下关闭 <span class="ui">按需加载工具</span>,然后重启 Agent。</p>
<h2 id="apps"><a class="anchor" href="#apps">其他应用</a></h2>
<p>MCP 路由打开后,<span class="ui">其他应用</span> 一行显示一个以 <code>/mcp/magpie/hub</code> 结尾的地址,它提供资源库里的所有服务器。<span class="ui">连接…</span> 会打开一个面板,里面有给 Cursor、VS Code、Windsurf 或任何接受 JSON MCP 配置的应用准备好的条目,可直接复制;在应用窗口里,Cursor 和 VS Code 还有 <span class="ui">添加</span>,会打开对应应用让你确认。另一台电脑上的应用需要网关密钥,和局域网里的其他请求一样(见 <a href="/docs/zh/remote">远程 magpie</a>)。</p>
<div class="callout"><b>命令型服务器运行在这台电脑上。</b>局域网里持有网关密钥的人都能通过 MCP 路由调用它们,权限就是你在这台电脑上的权限。密钥只给信任的人。</div>
+11
View File
@@ -10562,6 +10562,17 @@ magpie library mcp router off
`magpie library` lists which agents are given the router and which keep their own entries, with why.
## Tools on demand
Every tool an agent is given goes out, with its whole parameter schema, on every request. So an agent given more than 10 tools through the router is given two in their place, and this is **on by default**:
- **`find_tools`.** takes the words of what the task needs and gives the tools that match: the best 5 with their description and parameters, then up to 15 more by name. Its own description names each server and its tools, so the model knows what there is to find.
- **`call_tool`.** runs a tool by name, with its arguments.
An agent that searches its MCP tools itself is given every tool, and its own search keeps them out of each request: Claude Code, Claude Desktop, Codex, Pi, Droid and omp. So is an agent given 10 tools or fewer, and an app at the Other apps address, since magpie can’t tell which app that is.
To give every agent every tool instead, turn off Tools on demand under MCP router in Library → MCP, then restart your agents.
## Other apps
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](https://usemagpie.ai/docs/remote)).
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long