anthropics/skills · error · ValueError

Unsupported transport type: {transport}. Use 'stdio', 'sse',

Error message

Unsupported transport type: {transport}. Use 'stdio', 'sse', or 'http'

What it means

create_connection() accepts only the transports it knows: 'stdio', 'sse', and 'http'/'streamable_http'/'streamable-http' (case-insensitive). Anything else raises this ValueError immediately, listing the valid values. It exists to catch config typos and deprecated transport names before a connection object is built.

Source

Thrown at skills/mcp-builder/scripts/connections.py:151

    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

  1. Use one of the supported values exactly: 'stdio', 'sse', or 'http' (aliases 'streamable_http', 'streamable-http').
  2. Strip whitespace: transport.strip() before the call if the value comes from user input.
  3. For websocket-based servers, check whether the server also exposes a streamable-http endpoint and use that.
  4. Upgrade mcp-builder if a newer transport name was added upstream.

Example fix

# before
create_connection(name="w", transport="websocket", url="ws://localhost:9000")

# after
create_connection(name="w", transport="http", url="http://localhost:9000/mcp")
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = {"stdio", "sse", "http", "streamable_http", "streamable-http"}

def supported_transport(value: str) -> bool:
    return isinstance(value, str) and value.strip().lower() in SUPPORTED

Type guard

def is_supported_transport(value: str) -> bool:
    return isinstance(value, str) and value.strip().lower() in {"stdio", "sse", "http", "streamable_http", "streamable-http"}

Try / catch

try:
    conn = create_connection(name=n, transport=t, **fields)
except ValueError as e:
    if "Unsupported transport" in str(e):
        log.error("server %s: transport %r not supported; use stdio/sse/http", n, t)
        skip_server(n)
    else:
        raise

Prevention

When it happens

Trigger: Calling create_connection(transport='websocket'), 'ws', 'HTTPS' with odd casing like 'Http ' (note: exact-match set is 'http' variants after .lower(); leading/trailing spaces still fail), 'streamable' (abbreviated), or 'stdio-http'.

Common situations: New transport names appearing in the MCP ecosystem before this library supports them; config files hand-written with 'ws://' URLs implying a websocket transport; trailing whitespace or YAML quoting quirks in the transport field.

Related errors


AI-assisted analysis of anthropics/skills@f6656c1256 (2026-08-14). Data as JSON: /api/errors/1423a3ae2abcc14a. Report an issue: GitHub.