Skip to main content
HTTP connector for MCP implementations. This module provides a connector for communicating with MCP implementations through HTTP APIs with SSE or Streamable HTTP for transport.

HttpConnector

method init

Initialize a new HTTP connector.Parameters
str
required
The base URL of the MCP HTTP API.
dict[str, str] | None
default:"None"
Optional additional headers.
float
default:"5"
Timeout for HTTP operations in seconds.
float
default:"300"
Timeout for SSE read operations in seconds.
str | dict[str, typing.Any] | httpx.Auth | None
default:"None"
Authentication method - can be:
mcp.client.session.SamplingFnT | None
default:"None"
Optional sampling callback.
mcp.client.session.ElicitationFnT | None
default:"None"
Optional elicitation callback.
mcp.client.session.MessageHandlerFnT | None
default:"None"
Optional callback to handle messages.
mcp.client.session.LoggingFnT | None
default:"None"
Optional callback to handle log messages.
list[mcp_use.client.middleware.middleware.Middleware] | None
default:"None"
Optional list of middleware.
bool | None
default:"True"
Whether to verify SSL certificates.
list[mcp.types.Root] | None
default:"None"
Optional initial list of roots to advertise to the server.
mcp.client.session.ListRootsFnT | None
default:"None"
Optional custom callback to handle roots/list requests.
Signature