-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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-toolsWeb 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.subprocessfor 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
- CLI can connect to STDIO-based MCP servers
- Web UI can launch and connect to STDIO servers
- Proper error handling for process failures
- Documentation updated with STDIO examples
References
- MCP Inspector implementation: https://github.com/modelcontextprotocol/inspector
- MCP STDIO transport spec: https://spec.modelcontextprotocol.io/specification/basic/transports/#stdio
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request