test-case: :mcp connect / :mcp disconnect at runtime #28
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps
mcp.servers = {}(or nomcpblock at all).:mcp list— should report(no MCP sessions).:mcp connect http://boltzmann.fritz.box:8080/mcp boltzmann. If you can't supply BOLTZMANN_MCP_TOKEN via env, this test won't work unless you tweak the URL to a no-auth lmcp (broglie if reachable, or higgs).auth_envnot set in the runtime form, you'd need to construct a connect path differently — or pass through a config-declared session.mcp.servers(say boltzmann and hertz), boot, then test disconnect/reconnect on hertz.:mcp list— should now show the connected session.:mcp disconnect <alias>.:mcp list— should be empty again (or just the surviving one).:mcp disconnect <same-alias>again — should reportnot connected: <alias>.Expected
[aish] no MCP server connected for alias '...'tool turn (verified by triggering a prompt that asks for the disconnected server's tool).What this exercises
:mcp connect <url> [alias]meta — URL parsing, alias derivation, initialize, tools/list cache.:mcp disconnect <alias>meta — drop from mcp_sessions table.dispatch_tool_callgraceful degradation when alias is no longer connected.Known limitation
Runtime
:mcp connecthas no inline way to specify Bearer auth — auth is config-only. Filing as a separate feature request if needed.PASS with documented limitation (executed 2026-05-12 at commit
3fa6279, against live boltzmann + hertz lmcp).Three config-declared sessions on startup → both connected. Then:
:mcp listshows both ✓:mcp disconnect hertz→[aish] disconnected hertz✓:mcp listshows only boltzmann ✓:mcp disconnect hertz(already gone) →[aish] not connected: hertz✓:mcp connect http://hertz.fritz.box:8080/mcp hertz→[aish] mcp hertz: HTTP 401: {"error":"unauthorized"} (transport_error)— expected per the test case's "Known limitation" section. Runtime:mcp connecthas no inline auth syntax; auth is config-only.Dispatcher graceful-degradation when targeting a disconnected alias not exercised here (would need to trigger a tool call after disconnect, which requires real LLM cooperation). Tracked via TC #30/#26 indirectly.
Closing.