MCP connection using Streamable HTTP.
| 98 | |
| 99 | |
| 100 | class MCPConnectionHTTP(MCPConnection): |
| 101 | """MCP connection using Streamable HTTP.""" |
| 102 | |
| 103 | def __init__(self, url: str, headers: dict[str, str] = None): |
| 104 | super().__init__() |
| 105 | self.url = url |
| 106 | self.headers = headers or {} |
| 107 | |
| 108 | def _create_context(self): |
| 109 | return streamablehttp_client(url=self.url, headers=self.headers) |
| 110 | |
| 111 | |
| 112 | def create_connection( |