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.
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
Click the image above to watch a tutorial on MCP implementation.
.
├── pyproject.toml
├── README.md
├── src
│ ├── client
│ │ └── mcp_client.py # MCP client implementation
│ └── server
│ └── example_server.py # MCP server with tools
└── uv.lock
The server exposes two tools:
calculate_bmi- A simple calculator that computes Body Mass Indexfetch_weather- An async tool that retrieves weather data from an external API
The client connects to the server via stdio, initializes a session, and calls the server's tools.
