packinggoodsllc_07668 (Discord) runs magpies that only share MCP servers,
and an agent given several routers knew each by its name alone. A
router's initialize instructions now describe what it holds, built from
what the servers themselves say; no model writes any of it.
- After the "Tools of …" first line (and the router's name sentence when
it has one), a line per server: "- name (its serverInfo.title): what it
is for. Tools: tool (first clause of its description), …". The tools
the Library turned off are left out; another router's "[name] " prefix
is dropped. A line too long for its share says tools by name, then as
many as fit and "and N more". The whole is at most 2000 characters
(hubSayMax), the closing text kept whole.
- What a server is for: the market's words as before, else its
serverInfo.description, else its instructions' first line (saysOf).
Another magpie's "Tools of a (…), b." is said with "Tools of" once.
- What a server said and listed is kept in settings.Dir()/
mcp-hub-servers.json (not the synced library folder), keyed by name and
a hash of hubKey, written via temp+rename only on change, pruned of
servers gone. A router started again describes its servers without
starting any; one added or edited since is listed by initialize, which
waits up to 5s for it.
- Pi's hub description (hubAbouts) uses the server's own words too.
Agents, from their installed source (research, not run): Claude Code
shows instructions (4096 chars), Codex as the namespace description,
OpenCode, Gemini CLI (trusted folders only), Qwen Code, Pi (first line in
the prompt); Kimi CLI ignores them. None shows serverInfo.title.
Run at this tree (mote):
- go test -tags nogui ./internal/library: ok (116s)
- go test ./internal/gateway -run 'Hub|MCP|Roots|OversizedBody|
ReadOnlyKeyEveryRoute|FileURI|ImageModel': ok
- GOOS=linux and GOOS=windows go vet internal/gateway internal/library;
go vet internal/gui internal/cli; go build ./...; gofmt -l: clean
- New: TestHubInstructionsDescribeServers, TestHubDescriptionsOutlive
ARestart (library); TestHubAboutBounded, TestHubServerLine,
TestHubClauseBrackets, TestHubLineOfARouter (gateway).
- Red on the old code: TestHubInstructionsDescribeServers at c9af34446
fails ("Tools of la, notes." and nothing more).
- Broken by hand, each red: noteCard not writing the file (restart test),
the DisabledTools filter removed, saysOf returning nothing.
- Real use: two magpie serve builds of this tree in sandbox HOMEs on
mote (127.0.0.1:3561, :3562), A serving a stdio notes server, B with A's
/mcp/magpie/hub as server "la". B's initialize said
"- la (Magpie MCP hub): Tools of notes (…). Tools: notes__add_note (Add
a note to the notebook), notes__search_notes (…)."; B restarted with A
down said the same from the file.
Not tried: a real agent reading the new text (Claude Code, Codex,
OpenCode etc. were read in source only); a router with dozens of real
servers; Windows and Linux runs (the change has no OS-specific code).