Skip to main content
SSE connection management for MCP implementations. This module provides a connection manager for SSE-based MCP connections that ensures proper task isolation and resource cleanup.

SseConnectionManager

from mcp_use.task_managers.sse import SseConnectionManager

method init

Initialize a new SSE connection manager.Parameters
url
str
required
The SSE endpoint URL
headers
dict[str, str] | None
default:"None"
Optional HTTP headers
timeout
float
default:"5"
Timeout for HTTP operations in seconds
sse_read_timeout
float
default:"300"
Timeout for SSE read operations in seconds
auth
httpx.Auth | None
default:"None"
Optional httpx.Auth instance for authentication
Signature
def __init__(url: str, headers: dict[str, str] | None = None, timeout: float = 5, sse_read_timeout: float = 300, auth: httpx.Auth | None = None):
I