BerriAI/litellm · error · ValueError

stdio_config is required for stdio transport

Error message

stdio_config is required for stdio transport

What it means

Transport construction guard in the experimental MCP client: the transport type is stdio but no stdio_config (command/args/env) was supplied, so there is nothing to build a stdio transport from.

Solutions

  1. Pass a stdio_config (command, args, env) when using stdio transport for the MCP client.
  2. Use SSE or streamable HTTP transport if the server is remote instead.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/experimental_mcp_client/client.py:269 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/a03a5c4056604d4b. Report an issue: GitHub.

Appendix: source

Thrown at litellm/experimental_mcp_client/client.py:269

        self._elicitation_callback: Callable | None = elicitation_callback
        self._logging_callback: Callable | None = logging_callback
        # handle the basic auth value if provided
        if auth_value:
            self.update_auth_value(auth_value)

    def _create_transport_context(
        self,
    ) -> tuple[Any, httpx.AsyncClient | None]:
        """
        Create the appropriate transport context based on transport type.
        Returns:
            Tuple of (transport_context, http_client).
            http_client is only set for HTTP transport and needs cleanup.
        """
        http_client: httpx.AsyncClient | None = None
        if self.transport_type == MCPTransport.stdio:
            if not self.stdio_config:
                raise ValueError("stdio_config is required for stdio transport")
            server_params: Final = StdioServerParameters(
                command=self.stdio_config.get("command", ""),
                args=self.stdio_config.get("args", []),
                env=self._get_safe_stdio_env(self.stdio_config.get("env")),
            )
            return stdio_client(server_params), None
        if self.transport_type == MCPTransport.sse:
            headers = self._get_auth_headers()
            httpx_client_factory = self._create_httpx_client_factory()
            return (
                sse_client(
                    url=self.server_url,
                    timeout=self.timeout,
                    headers=headers,
                    httpx_client_factory=httpx_client_factory,
                ),
                None,
            )

View on GitHub (pinned to 77b7c6c40c)