python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

Use of Context in the Client

Open celcof opened this issue 1 year ago • 2 comments

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

celcof avatar Mar 22 '25 18:03 celcof

+1.

Thank you.

samirbajaj avatar Mar 25 '25 16:03 samirbajaj

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 :)

maxisbey avatar Sep 26 '25 17:09 maxisbey