python-sdk
python-sdk copied to clipboard
Use of Context in the Client
In the documentation it is briefly described how to use Context in the server, it seems it is called as a parameter in the server tool. But then in the client there is no example of Context definition, and I am not able to understand how the whole thing works from the source code. Thank you for your help
+1.
Thank you.
Since this issue was created there have been quite a few examples for how to use Context:
- https://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file#server
- https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/fastmcp/logging_and_progress.py
- https://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file#tools
- https://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file#sampling
As we're currently going through the process of cleaning up the issue backlog I'm going to preemptively close this issue. If you think this is still an issue please feel free to reopen it :)