1ccacad63281094de8a3372d5a507d38f9969e5c
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
922cc0ccf8 |
library: a plugin's tools hidden from every agent from its Plugins row
chengming0v0 (Discord) keeps a plugin for its providers but doesn't want
the MCP server it brings (minimax_query_video_generation and the rest)
shown to agents, and doesn't want to remove the plugin.
Before: a plugin that gives tools is a Library server of its own
(plugin_tools.go), switched per agent with the row's chips in Library ›
MCP, which held through updates and off/on. Nothing on the Plugins page
said so: its line read "Tools for every agent" whatever the Library had,
and an app at the router's address (/mcp/magpie/hub, agent "") was given
every server, ticked for any agent or none, so taking every chip off
still left the tools there.
Now:
- The plugin's tools line says "Tools for agents" or "Tools, hidden from
agents", with Hide from agents / Give to agents beside the copy button
(plugins.js, toolsServer in /api/plugins from library.PluginServers).
- PluginServerOn (servers/plugin-on {name, on}) sets Server.Hidden and
keeps the agents it had in Paused. Hidden, no agent is given it and
hubServers leaves it out for the router's address too. Give to agents
gives the kept agents back; with none kept, the router's agents
(hubAgents), or else every shown agent that can take it.
- It holds through a plugin update, the plugin off and on, an edit in the
Library editor (SaveServer keeps it) and an agent's "every server"
(serversAgents with no names skips a hidden one). Ticking an agent for
it in Library › MCP shows it again (save clears Hidden).
- Library › MCP tags the server "Plugin", its tooltip pointing at Plugins.
- /mcp/magpie/tools (every plugin's tools, wired by hand) is unchanged.
- Docs: plugin-tools.md, mcp-router.md, site docs plugins (en, zh, ja).
- The core script budget is not raised: two plugins.js comments cut, the
button's tooltips and status lines left out.
Run on mote at this tree (before the site docs, html only):
- go build ./..., go vet ./internal/library ./internal/gui, GOOS=windows
go vet of both, GOOS=linux go vet ./internal/library: ok.
- go test -count=1 ./internal/library/: ok (187s).
- go test -count=1 ./internal/gui/ -run 'Plugin|Library|Budget|Script':
ok (TestCoreScriptBudget 1,533,514 of 1,533,802).
- node --test plugin-tools.test.cjs (new: the line's words, Hide and Give
posting {name, on}, the button inside its row at 980 and 420, all five
languages, Chromium and WebKit): ok; builtins, every library-mcp-* and
mcp-* file: ok.
- i18n-keys "a plugin's words are its own": red, the same three words on
origin/main
|
||
|
|
cd9c52c16e |
library: a Remote magpie's MCP router is a Library server of its own
With another magpie as a provider (preset remote-magpie), its router's
MCP servers took adding that same magpie again under Library -> MCP.
Now the gateway's info (GET /v1) says "mcp_hub": true to a caller it
serves MCP to while its router is on with a server that isn't itself
another magpie's router. A fetch of a Remote magpie's models asks that
info with the provider's key, only while the library would still give
it a server, and the library then adds one: named for the provider,
http at <root>/mcp/magpie/hub with Authorization: Bearer <key>, kept to
this computer (local), on for the agents given the hub's entry.
- Offered once (bridgesOffered in library.json): removed or switched
off by the user, it stays so until the provider is removed and added
again.
- A server the user already has at that magpie's router (same origin,
the router's path) is the one; none is added beside it.
- The provider removed takes its server out (adoptBridges, at Sync and
the View read); providers.json unreadable takes nothing out; the
provider's address or key changed changes the server's; edited to
another address or key it becomes the user's own (keptBridge).
- No loop: every dial to a URL under /mcp/magpie/hub carries
X-Magpie-Router, and a request with it is given no such server,
neither listed (library Tools, gateway hubServersOf) nor run (Call,
hubToolNamed). A server carried in by sync is never a bridge.
- No GUI change: it is a server row as any other.
Run (mote, at base
|
||
|
|
b78b1de003 |
library: magpie-image is behind the MCP hub, saving into the calling agent's project
magpie-image was the one MCP server the hub left out, because it saves what it makes on disk and needs to know whose project that is. The hub now serves its tools like any other server's and tells it where the caller works: 1. the hub answers a tools/call as SSE and asks the agent roots/list on that stream (3s), as Claude Code answers; 2. else Codex's _meta x-codex-turn-metadata.workspaces (git repos only); 3. else the Codex thread's cwd from its session file (sessions.CodexThreadCwd), only with session consent; 4. else none, and the image goes to ~/Pictures/Magpie as before. The hub passes `magpie/roots` and `magpie/client` in the call's _meta; imagemcp saves into the first root and names the agent on its usage row. Its result carries `magpie/model`, which the hub's own usage row takes, so the row says which image model drew it. A WSL agent keeps magpie-image as its own entry (the hub can't reach a path inside the distro). docs/subsystems/mcp-hub.md (mcp-router.md after the next commit), gateway-routing.md and gateway-sessions.md say so. It is rebased on #4382 ( |
||
|
|
2f65a33aaf |
library: a tools plugin is a Library server of its own, in the MCP hub (Search1API)
chenxiang0010 (Discord #general) asked for a tools plugin's tools, Search1API's (@magpie-community/tools-search1api), to be in magpie's aggregated MCP server. Until now plugin tools were served only at /mcp/magpie/tools, wired by hand; the hub listed Library servers only. Now each plugin that is on and gives tools becomes a Library server once the plugin host has noted its tools (plugin-tools.json, new plugin.ToolsNoted): - named by the plugin's short name (search1api, search1api-plugin beside a user's server of that name), `plugin` set, `local`, its URL the new /mcp/magpie/tools/<short> (gateway ToolsMCPOne), which serves that plugin's tools alone by their own names; - added with the hub on, it is on for the agents given the hub's entry, so their hub lists search1api__search etc. at once; with the hub off it is on for none until switched on. Per agent and per tool it is switched like any server; - the hub lists and runs its tools in process (gateway.PluginToolsOf, RunPluginToolOf, under the Plugin tools gate); with the hub off an agent is given the per-plugin URL at the address it reaches the gateway (through), with a key from another machine; - offered once (pluginsOffered): removed by the user, it comes back only when the plugin is removed and added again. The plugin removed takes the server out; turned off it stays and lists nothing; an unreadable plugins.json changes nothing (plugin.ReadList). Edited in the Library's editor, which doesn't send `plugin`, it stays the plugin's. Docs: docs/subsystems/plugin-tools.md, mcp-hub.md, site docs plugins (en, zh, ja). Run (mote; full suite at this change on origin/main |