Support different transports in Client (#1972)

This commit is contained in:
Marcelo Trylesinski 2026-01-30 13:11:27 +01:00 • committed by GitHub
commit 21822053df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,11 +10,7 @@ from mcp.client.streamable_http import streamable_http_client
async def main():
# Connect to a streamable HTTP server
async with streamable_http_client("http://localhost:8000/mcp") as (
read_stream,
write_stream,
_,
):
async with streamable_http_client("http://localhost:8000/mcp") as (read_stream, write_stream):
# Create a session using the client streams
async with ClientSession(read_stream, write_stream) as session:
# Initialize the connection