DocsMCPStdio Transport

Stdio Transport

The stdio transport spawns an MCP server as a child process and communicates via stdin/stdout. This is the most common transport for local servers.

Configuration

[mcp.servers.filesystem]
transport = { type = "stdio", command = "npx", args = ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/documents"] }
auto_connect = true
timeout_secs = 120

Fields

FieldRequiredDescription
commandYesExecutable path or command name
argsNoCommand arguments (array of strings)
envNoAdditional environment variables

Environment Variables

Pass environment variables to the server process:

[mcp.servers.github]
transport = { type = "stdio", command = "npx", args = ["-y", "@modelcontextprotocol/server-github"], env = { GITHUB_TOKEN = "${GITHUB_TOKEN}" } }

Environment variables support ${VAR} expansion from the host environment.

How It Works

  1. Ryvos spawns the command as a subprocess
  2. JSON-RPC messages are exchanged over stdin/stdout
  3. The server publishes its tool list via tools/list
  4. Ryvos bridges each tool into the ToolRegistry
  5. When a tool is called, Ryvos sends tools/call via stdin
  6. The result is read from stdout

Auto-Reconnection

If a stdio server crashes, Ryvos detects the broken pipe and marks the server as disconnected. On the next tool call attempt, it tries to reconnect by respawning the process.

Examples

# Filesystem access
[mcp.servers.filesystem]
transport = { type = "stdio", command = "npx", args = ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"] }
 
# Git operations
[mcp.servers.git]
transport = { type = "stdio", command = "npx", args = ["-y", "@modelcontextprotocol/server-git"] }
 
# Custom Python server
[mcp.servers.custom]
transport = { type = "stdio", command = "python3", args = ["./my_mcp_server.py"] }

CLI

ryvos mcp add filesystem --command npx --args "-y" "@modelcontextprotocol/server-filesystem" "/tmp"
ryvos mcp list
ryvos mcp remove filesystem