anthropics/skills · error · ValueError
Command is required for stdio transport
Error message
Command is required for stdio transport
What it means
create_connection() in mcp-builder's connections.py validates transport parameters: for transport='stdio' the command (the executable to launch) is mandatory, since an MCP stdio client must spawn a server process. Empty/None command means the caller cannot possibly form a valid MCPConnectionStdio, so it fails fast rather than constructing a broken connection.
Source
Thrown at skills/mcp-builder/scripts/connections.py:137
) -> MCPConnection:
"""Factory function to create the appropriate MCP connection.
Args:
transport: Connection type ("stdio", "sse", or "http")
command: Command to run (stdio only)
args: Command arguments (stdio only)
env: Environment variables (stdio only)
url: Server URL (sse and http only)
headers: HTTP headers (sse and http only)
Returns:
MCPConnection instance
"""
transport = transport.lower()
if transport == "stdio":
if not command:
raise ValueError("Command is required for stdio transport")
return MCPConnectionStdio(command=command, args=args, env=env)
elif transport == "sse":
if not url:
raise ValueError("URL is required for sse transport")
return MCPConnectionSSE(url=url, headers=headers)
elif transport in ["http", "streamable_http", "streamable-http"]:
if not url:
raise ValueError("URL is required for http transport")
return MCPConnectionHTTP(url=url, headers=headers)
else:
raise ValueError(f"Unsupported transport type: {transport}. Use 'stdio', 'sse', or 'http'")
View on GitHub (pinned to f6656c1256)
Solutions
- Supply the server command: create_connection(name='x', transport='stdio', command='npx', args=['-y', 'server-puppeteer']).
- Check the config source for typos — the key must be exactly 'command' (not 'cmd', 'exec', 'path').
- If the server is remote, switch transport to 'sse' or 'http' with a url instead.
- Validate config entries before passing them: assert entry.get('command') for stdio entries.
Example fix
# before create_connection(name="fs", transport="stdio", command="", args=["--root", "/tmp"]) # after create_connection(name="fs", transport="stdio", command="npx", args=["-y", "@modelcontextprotocol/server-filesystem", "/tmp"])
Defensive patterns
Strategy: validation
Validate before calling
def valid_stdio_entry(entry: dict) -> bool:
return bool(entry.get("transport", "stdio").lower() == "stdio" and (entry.get("command") or "").strip()) Try / catch
try:
conn = create_connection(name=n, transport="stdio", command=cmd, args=a)
except ValueError as e:
if "Command is required" in str(e):
raise ConfigError(f"server {n!r}: stdio entry missing 'command'") from e
raise Prevention
- Schema-validate config entries before building connections (command required for stdio).
- Use exact key names: command/args/env for stdio; url/headers for sse/http.
- Fail config loading loudly at startup rather than per-connection at runtime.
When it happens
Trigger: Calling create_connection(name=..., transport='stdio', command=None or '') — e.g. reading config where the 'command' key was misspelled or omitted, or wiring a URL-based server config to stdio transport.
Common situations: Misconfigured JSON/YAML MCP server entries (command field missing); mixing up transports (an sse/http server entry passed with transport='stdio'); empty-string command from templating bugs in generated config files.
Related errors
- URL is required for sse transport
- URL is required for http transport
- Unsupported transport type: {transport}. Use 'stdio', 'sse',
- {word} not found (not an unpacked .docx?)
- parent comment {parent_id} not found
AI-assisted analysis of anthropics/skills@f6656c1256 (2026-08-14).
Data as JSON: /api/errors/68cb1e991aa3d450.
Report an issue: GitHub.