How do I hot-load MCP direct tools in pi-mcp-adapter without reloading Pi?
In pi-mcp-adapter, MCP direct tools are generated from server metadata that can change after Pi has started (first connection, OAuth completion,
/mcp reconnect, panel toggles,tools/list_changednotifications). After such changes, the current session keeps stale tool names visible and callable until Pi is reloaded. Is there a fix that refreshes direct tools in the running Pi session without a manual reload?Originally asked on GitHub: https://github.com/nicobailon/pi-mcp-adapter/issues/74
2 answers
Fixed: pi-mcp-adapter v2.12.0 (merged via PR #72) now hot-loads direct tools in the current Pi session whenever MCP metadata refreshes. The merge was initially blocked on an upstream Pi core change, but the owner confirmed release in v2.12.0 on 2026-07-24.
Upgrade pi-mcp-adapter to v2.12.0 or later to get the fix. After that, direct tools are re-registered in the current session after reconnects, lazy/proxy connects, direct-tool panel changes, and MCP
tools/list_changedorresources/list_changednotifications from live servers. The implementation fingerprints direct tools so unchanged tools are not re-registered unnecessarily, and stale tools are removed from the active tool set. On older Pi versions without an owned unregistration primitive, stale tools are deactivated as a fallback; when Pi exposespi.unregisterTool()(upstream pi-mono PR #4084), stale tools can be fully removed from Pi's extension registry.The PR includes lifecycle tests covering hot-load, stale tool deactivation, fallback behavior, and list-change refresh;
npm testpasses with 30 test files and 249 tests. The adapter PR remains backward compatible with current Pi versions. Note thatnpx tsc --noEmitstill reports pre-existing adapter type errors unrelated to this fix.Did this work for you?What a GitHub user tried on GitHub (Worked)
PR #72 implemented the hot-load fix with metadata refresh hooks, direct-tool fingerprinting, stale-tool deactivation fallback, and handling of MCP tools/list_changed notifications. Local verification passed:
npm test(30 test files, 249 tests) andgit diff --check.Source: https://github.com/nicobailon/pi-mcp-adapter/issues/74 (opens external site)
Did this work for you?
Related questions
- pi-mcp-adapter: per-server override in ~/.pi/agent/mcp.json wipes imported command/url
- pi-mcp-adapter: compact TUI rendering for direct MCP tools?
- pi-mcp-adapter: huge MCP output hangs session, Esc can't abort — fixed upstream?
- Show which MCP tool is actually called when pi-mcp-adapter outputs only `mcp OK`
- pi-mcp-adapter stores OAuth tokens in plaintext — is there a keychain fix?