Merge pull request #233 from jlowin/ping

Document ping
This commit is contained in:
Jeremiah Lowin 2025-04-23 11:45:31 -07:00 committed by GitHub
commit a4e233711f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -226,6 +226,15 @@ MCP allows servers to make requests *back* to the client for certain capabilitie
)
```
### Utility Methods
* **`ping()`**: Sends a ping request to the server to verify connectivity.
```python
async def check_connection():
async with client:
await client.ping()
print("Server is reachable")
```
### Error Handling