mcp-client-x

MCP.Pizza Chef: RGGH

mcp-client-x is a Python-based MCP client example demonstrating how to connect to MCP servers and interact with custom tools. It showcases a simple client-server implementation of the Model Context Protocol, enabling tool calls and response handling. This project is ideal for developers learning MCP integration and building AI workflows with real-time tool interaction.

Unmaintained · No commits in 20 months.

Use This MCP client To

Connect to MCP servers with custom tools Call remote tools and receive responses Implement MCP client logic in Python Test MCP server-client interactions Learn MCP protocol basics through example code

README

MCP Client Example ☀️

This project demonstrates a simple client-server implementation using the Model Context Protocol (MCP), which is a standardized way to connect large language models with tools and data.

Overview

This example shows how to:

  • Create an MCP server with custom tools
  • Connect to the server using an MCP client
  • Call tools and get responses from the server

Tutorial Video

MCP Tutorial Video

Click the image above to watch a tutorial on MCP implementation.

Project Structure

.
├── pyproject.toml
├── README.md
├── src
│   ├── client
│   │   └── mcp_client.py      # MCP client implementation
│   └── server
│       └── example_server.py  # MCP server with tools
└── uv.lock

Server Implementation

The server exposes two tools:

  1. calculate_bmi - A simple calculator that computes Body Mass Index
  2. fetch_weather - An async tool that retrieves weather data from an external API

Client Implementation

The client connects to the server via stdio, initializes a session, and calls the server's tools.

mcp-client-x FAQ

How do I run the mcp-client-x example?
Clone the repository, install dependencies via pyproject.toml, then run the client script in src/client/mcp_client.py to connect to the example server.
What tools does the example MCP server expose?
The example server exposes two tools: calculate_bmi for BMI calculation and fetch_weather for retrieving weather data asynchronously.
Can I extend mcp-client-x to connect to other MCP servers?
Yes, the client code is modular and can be adapted to connect to any MCP server implementing compatible tools.
Does mcp-client-x support asynchronous tool calls?
Yes, it demonstrates async tool invocation, such as fetching weather data, showcasing real-time interaction capabilities.
Is mcp-client-x suitable for production use?
It is primarily an educational example to demonstrate MCP client-server interaction, not a production-ready client.
What programming language is mcp-client-x written in?
It is implemented in Python, making it accessible for Python developers integrating MCP.
Where can I find a tutorial for mcp-client-x?
A tutorial video is linked in the GitHub README, providing step-by-step guidance on MCP implementation.