A simple MCP client that can integrate with MCP servers.
I followed the instructions here. Unlike my Build an MCP weather server experience, I had to make a few changes to get the client to work.
I followed the instructions at the Model Context Protocol site all the way through. The key problem with that approach didn't reveal themselves until I first tried to run the client against my working server. The model they hard-code in the Query Processing Logic section is deprecated according to the model pricing information in Claude Docs so my initial query didn't run. Switching to "claude-3-7-sonnet-latest" resolved that issue.
I also spent $5 (plus 15 cents tax) on credits for calling the API.
The Claude API call is also duplicated in the code, instead of factored out as a separate function. I factored it out for clarity, and added the model and max_tokens values to the .env file to make things a bit more configurable.
If for some reason you're just trying to run this without visiting the Model Context Protocol site, you'll need:
- Python 3.10 or higher already installed
- Python MCP SDK 1.2.0 or higher
Again, the Model Context Protocol site is the best source of information. But if you're not going there:
- Install uv
- Install the Python MCP SDK via uv
client.py contains all the necessary code for the MCP client.
To run the client against any MCP Python or Node server:
uv run client.py path/to/server.py # python server
uv run client.py path/to/build/index.js # node server
from whatever folder you git cloned this repo into.
The instructions are the best source for troubleshooting guidance.
Contributors names and contact info
- 0.1
- Initial Release