You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Note**: SSE transport is being superseded by streamable HTTP transport. Consider using streamable HTTP for production deployments.
423
+
392
424
You can mount the SSE server to an existing ASGI server using the `sse_app` method. This allows you to integrate the SSE server with other ASGI applications.
393
425
394
426
```python
@@ -621,7 +653,7 @@ if __name__ == "__main__":
621
653
622
654
### Writing MCP Clients
623
655
624
-
The SDK provides a high-level client interface for connecting to MCP servers:
656
+
The SDK provides a high-level client interface for connecting to MCP servers using various transports:
625
657
626
658
```python
627
659
from mcp import ClientSession, StdioServerParameters, types
@@ -685,6 +717,24 @@ if __name__ == "__main__":
685
717
asyncio.run(run())
686
718
```
687
719
720
+
Clients can also connect using streamable HTTP transport:
721
+
722
+
```python
723
+
724
+
# Connect to a streamable HTTP server
725
+
asyncwith streamablehttp_client(http_server_url +"/mcp") as (
726
+
read_stream,
727
+
write_stream,
728
+
_,
729
+
):
730
+
# Create a session using the client streams
731
+
asyncwith ClientSession(read_stream, write_stream) as session:
0 commit comments