skills/skills/langbot-testing/references/mcp-stdio-testing.md
Use this reference when validating MCP server creation, tool discovery, and local-agent tool calls.
Use the bundled test server:
fixtures/mcp/qa_mcp_echo_server.py
It exposes one tool:
qa_mcp_echo(text: str) -> str
Expected tool result:
qa_mcp_echo:<input>
Older versions of this fixture used the visible name qa_echo, which collides
with the qa-plugin-smoke plugin tool. This fixture now uses the unique
qa_mcp_echo name. If a run still returns the plugin sentinel:
qa-plugin-smoke:<input>
that proves the run used the plugin tool or a stale MCP registration, not the current MCP fixture. Refresh the MCP server/tool registration before treating the result as MCP coverage.
LANGBOT_FRONTEND_URL.MCP Servers.Stdio.pythonfixtures/mcp/qa_mcp_echo_server.pyTest.Tools: 1 and qa_mcp_echo.Do not paste python ... into the command field as one string. LangBot stores command and args separately.
qa_mcp_echo.GET /api/v1/mcp/servers shows runtime_info.status=connected.GET /api/v1/tools contains qa_mcp_echo.Use this diagnostic before blaming Local Agent or a model provider:
node scripts/e2e/mcp-stdio-fixture.mjs
It launches the bundled stdio server directly, lists tools over MCP, and calls
qa_mcp_echo without invoking a LangBot model. A pass proves the fixture and MCP
stdio framing work; it does not prove the provider-backed Local Agent tool loop.
Use this diagnostic when the direct fixture passes but LangBot still lists an old tool name or the saved MCP server may be stale:
node scripts/e2e/mcp-stdio-register.mjs
It upserts qa-local-stdio through the authenticated WebUI session, points it at
the bundled qa_mcp_echo_server.py, then checks /api/v1/tools and the MCP
runtime info. A pass proves LangBot has refreshed the saved server and exposes
qa_mcp_echo before any model provider is involved.
Extensions allows the MCP server, or that all MCP servers are enabled.Default or the pluginized langbot/local-agent runner.Debug Chat.Call the qa_mcp_echo tool with exactly this text: mcp-ok-local-agent. Return only the tool result.
Pass when the bot response contains:
qa_mcp_echo:mcp-ok-local-agent
Do not count this case as passed when the bot returns:
qa-plugin-smoke:mcp-ok-local-agent
That proves a plugin tool was called, not the MCP server.
If the provider returns model_not_found or no available channel only when tools are supplied, switch to a known-good function-calling model before diagnosing MCP or local-agent. That failure means the selected model route is unavailable for the requested tool-call shape.