MCP Client Example ☀️

by RGGH

26 stars
269 downloads
Not rated
GitHub Website

About

MCP Client Example ☀️ is a demonstrative client-server implementation using the Model Context Protocol (MCP). It shows how to connect a large language model with custom tools and data, intended for developers learning MCP.

Details

Author
RGGH
GitHub stars
26
Downloads
269
Categories
Other

- Exposes two tools: calculate_bmi and fetch_weather
- Client connects to server via stdio transport
- Demonstrates synchronous and asynchronous tool calls
- Can be tested with the MCP Inspector
- Built with Python 3.9+ and the MCP Python SDK

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Client Example ☀️
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install dependencies with uv install -e ., then run the client with uv run src/client/mcp_client.py. The client automatically starts the server over stdio, lists available tools, and calls them with sample data.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp client example \u2600\ufe0f": {
            "mcp-client-x": {
                "command": "uv",
                "args": [
                    "run",
                    "src/client/mcp_client.py"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-client-x": {
        "command": "uv",
        "args": [
            "run",
            "src/client/mcp_client.py"
        ]
    }
}

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.

Getting Started

Prerequisites

- Python 3.9+
- uv (Python package manager)

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.