{"record":{"id":"2af17933cadbdc72","repo":"BerriAI/litellm","slug":"streamable-http-client-is-not-available-please-in","errorCode":null,"errorMessage":"streamable_http_client is not available. Please install mcp with HTTP support.","messagePattern":"streamable_http_client is not available\\. Please install mcp with HTTP support\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/experimental_mcp_client/client.py","lineNumber":290,"sourceCode":"                args=self.stdio_config.get(\"args\", []),\n                env=self._get_safe_stdio_env(self.stdio_config.get(\"env\")),\n            )\n            return stdio_client(server_params), None\n        if self.transport_type == MCPTransport.sse:\n            headers = self._get_auth_headers()\n            httpx_client_factory = self._create_httpx_client_factory()\n            return (\n                sse_client(\n                    url=self.server_url,\n                    timeout=self.timeout,\n                    headers=headers,\n                    httpx_client_factory=httpx_client_factory,\n                ),\n                None,\n            )\n        # HTTP transport (default)\n        if streamable_http_client is None:\n            raise ImportError(\"streamable_http_client is not available. Please install mcp with HTTP support.\")\n        headers = self._get_auth_headers()\n        httpx_client_factory = self._create_httpx_client_factory()\n        verbose_logger.debug(\"litellm headers for streamable_http_client: %s\", headers)\n        http_client = httpx_client_factory(\n            headers=headers,\n            timeout=httpx.Timeout(self.timeout),\n        )\n        transport_ctx: Final = streamable_http_client(\n            url=self.server_url,\n            http_client=http_client,\n        )\n        return transport_ctx, http_client\n\n    def _get_safe_stdio_env(self, provided_env: dict[str, str] | None) -> dict[str, str] | None:\n        \"\"\"\n        Return a safe environment for the stdio subprocess.\n\n        If provided_env is set, we use it as-is.","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/experimental_mcp_client/client.py#L272-L308","documentation":"At import time LiteLLM tries to load mcp.client.streamable_http.streamable_http_client; the module is optional in the `mcp` package. If the installed mcp version lacks the streamable HTTP client (or it is not exported), streamable_http_client stays None and the default HTTP transport path raises ImportError when the client tries to use it.","triggerScenarios":"transport_type='http' (the default) with an old mcp install (pre-streamable-http, roughly <1.8), an mcp build installed without HTTP extras, or a version where the attribute name differs so getattr returns None.","commonSituations":"Long-lived venvs that installed mcp early and were never upgraded; lockfiles pinning mcp to an old version; minimal installs that pulled only the stdio subset of the SDK.","solutions":["Upgrade the mcp SDK: pip install -U mcp (streamable HTTP client ships with current versions)","Verify in the runtime env: python -c \"from mcp.client.streamable_http import streamable_http_client; print(streamable_http_client)\"","If you specifically need server-sent events instead, set transport_type='sse' — the sse_client import is mandatory and already worked","Regenerate lockfiles/requirements so litellm's mcp dependency resolves to a version with HTTP support"],"exampleFix":"# before\npip install 'mcp==1.7.0'   # ImportError at connect time\n\n# after\npip install -U 'mcp>=1.8'","handlingStrategy":"validation","validationCode":"def mcp_http_supported() -> bool:\n    try:\n        from mcp.client.streamable_http import streamable_http_client  # noqa: F401\n        return True\n    except Exception:\n        return False\n\nif server.transport_type == \"http\" and not mcp_http_supported():\n    raise RuntimeError(\"upgrade mcp: pip install -U mcp\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin mcp to a version with streamable_http (>=1.8)","Startup smoke-test: import mcp.client.streamable_http in healthchecks","Prefer sse transport only for legacy servers"],"tags":["mcp","http-transport","dependencies","version-mismatch"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}