Summary
Add support for STDIO transport to enable testing local MCP servers that communicate via stdin/stdout instead of HTTP.
Background
The official MCP Inspector supports multiple transports:
- STDIO - Direct process communication for local servers
- SSE - Server-Sent Events for remote servers
- Streamable HTTP - Bidirectional HTTP streaming (currently supported by Anvil)
Many MCP servers, especially those used with Claude Desktop, are configured to run via STDIO. Supporting this transport would significantly expand the servers Anvil can test.
Proposed Implementation
CLI
# Launch a local server via stdio
anvil --stdio "python -m my_mcp_server" list-tools
anvil --stdio "node build/index.js" call get_weather --arg city=Berlin
# Or with a config file reference
anvil --server my-local-server list-tools
Web UI
- Add transport type selector (HTTP / STDIO)
- For STDIO: input field for the command to execute
- Spawn subprocess and communicate via stdin/stdout
Technical Considerations
- Use
asyncio.subprocess for spawning the MCP server process
- Implement proper process lifecycle management (start, stop, restart)
- Handle process crashes gracefully
- Consider security implications of executing arbitrary commands
Acceptance Criteria
References
Summary
Add support for STDIO transport to enable testing local MCP servers that communicate via stdin/stdout instead of HTTP.
Background
The official MCP Inspector supports multiple transports:
Many MCP servers, especially those used with Claude Desktop, are configured to run via STDIO. Supporting this transport would significantly expand the servers Anvil can test.
Proposed Implementation
CLI
Web UI
Technical Considerations
asyncio.subprocessfor spawning the MCP server processAcceptance Criteria
References