π The fast, Pythonic way to build MCP servers and clients.
Update client.mdx
Jeremiah Lowin97bccb910474
diff --git a/docs/clients/client.mdx b/docs/clients/client.mdxindex 74ee9e3b4..504993fa4 100644--- a/docs/clients/client.mdx+++ b/docs/clients/client.mdx@@ -286,55 +286,22 @@ When using stdio transports, clients support a `keep_alive` feature (enabled byWhen `keep_alive=False`, the client will automatically close the session when the context manager exits.-<CodeGroup>-```python keep_alive=True-from fastmcp import Client--# Client with keep_alive=True (default)-client = Client("my_mcp_server.py")--async def example():- # First session- async with client:- await client.ping()-- # Second session - uses the same subprocess- async with client:- await client.ping()-- # Manually close the session- await client.close()-- # Third session - will start a new subprocess- async with client:- await client.ping()--asyncio.run(example())-```-```python keep_alive=False+```pythonfrom fastmcp import Client-# Client with keep_alive=False-client = Client("my_mcp_server.py", keep_alive=False)+client = Client("my_mcp_server.py") # keep_alive=True by defaultasync def example():- # First sessionasync with client:await client.ping()- # Second session - will start a new subprocess- async with client:- await client.ping()-- # Third session - will start a new subprocessasync with client:- await client.ping()--asyncio.run(example())+ await client.ping() # Same subprocess as above```-</CodeGroup>-+<Note>+For detailed examples and configuration options, see [Session Management in Transports](/clients/transports#session-management).+</Note>#### Timeouts