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

Proposal for Client Examples Repository or Section in MCP Python SDK

Open 3choff opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

While the MCP ecosystem has a dedicated repository for server examples (modelcontextprotocol/servers), there doesn't seem to be a centralized location for sharing client implementations.

This makes it harder for new developers to:

  • Find reference implementations
  • Learn best practices for client development
  • See real-world examples of MCP integration
  • Understand different patterns for tool handling

Describe the solution you'd like

I propose either:

  1. Creating a new modelcontextprotocol/clients repository to showcase different client implementations, similar to the servers repository
  2. Adding a subdirectory in the examples/clients directory in the python-SDK repository for community-contributed client examples.

I have developed a Python chatbot example that demonstrates:

  • Connecting to multiple MCP servers
  • Discovering and executing tools
  • Supporting any OpenAI API-compatible LLM provider
  • Tracking progress and handling capabilities

This example could serve as an initial reference implementation.

Describe alternatives you've considered

  • Including example clients directly in the SDK documentation.
  • Creating a separate repository exclusively for community-contributed client resources.

Additional context

The example CLI chatbot follows the SDK's development guidelines:

  • Uses proper type hints
  • Includes comprehensive docstrings
  • Follows PEP 8 style
  • Implements proper error handling

The code is ready for contribution and can be adjusted to fit any preferred format or additional guidelines.

3choff avatar Dec 05 '24 18:12 3choff

I am happy to accept a examples/clients PR. Do you want to take a stab?

I like the idea of an clients repository with a README listing different clients. I'll talk to @jspahrsummers and see what he thinks and we can get that going.

dsp-ant avatar Dec 10 '24 14:12 dsp-ant

Note that there is also https://modelcontextprotocol.io/clients

dsp-ant avatar Dec 10 '24 14:12 dsp-ant

Great! I'll send a PR to add the client example to the examples/clients directory.

3choff avatar Dec 10 '24 18:12 3choff

Hi! I believe this issue can be closed now — I just checked and saw that the example is now present under the examples/client directory. 👍

tadeodonegana avatar Apr 01 '25 14:04 tadeodonegana