MCP Client

by wintertechforum

MCP Client 3 stars
  • agent-framework

A very simple MCP demo, based off of Anthropics MCP examples, with the added bonus of an agency loop

About

What is MCP Client?

MCP Client is a Python application that implements the Model Context Protocol (MCP) with Anthropic integration. It is designed for developers who need to connect MCP servers to Anthropic's language models.

How to use MCP Client?

Clone the repository, create and activate a virtual environment (using uv or venv), install dependencies with uv sync or pip install ., set the ANTHROPIC_API_KEY in a .env file, then run python client.py weather/weather.py, replacing the server path as needed.

Key features of MCP Client

- Python 3.13+ support
- Uses Anthropic API for language model integration
- Compatible with MCP CLI tools (v1.3.0+)
- Environment variables managed via python-dotenv
- HTTP client via httpx for network communication
- Extensible to any MCP tool server

Use cases of MCP Client

- Connecting a weather data MCP server to an Anthropic-powered assistant
- Building custom agent pipelines that combine multiple MCP tools
- Prototyping MCP server integrations before production deployment

FAQ from MCP Client

What is MCP Client?

MCP Client is a Python-based client that implements the Model Context Protocol, specifically integrated with Anthropic's API to enable communication between MCP servers and Anthropic language models.

What are the system requirements?

Python 3.13 or higher and either the uv or pip package manager are required.

How do I set up the environment?

Create a .env file in the project root with your Anthropic API key (ANTHROPIC_API_KEY=your_key_here) and install dependencies with uv sync or pip install ..

Does MCP Client support other model providers?

The README describes integration only with Anthropic. No other providers are mentioned.

What is the licensing model of MCP Client?

The README does not specify any licensing or pricing information.

Details

Author
wintertechforum
GitHub stars
3
Category
agent-framework
Repository
wintertechforum/mcp-demo

MCP Client

A client implementation for MCP with Anthropic integration.

Requirements

- Python 3.13 or higher
- pip or uv package manager

Setup Instructions

1. Clone the repository:

   git clone <repository-url>
cd mcp-client

2. Create and activate a virtual environment:

   uv venv  # Recommended
source .venv/bin/activate # On Unix-like systems
# Or on Windows:
# .venv\Scripts\activate

# Alternatively with Python's venv module:
# python -m venv .venv
# source .venv/bin/activate # On Unix-like systems
# .venv\Scripts\activate # On Windows

3. Install dependencies:

   uv sync  # Recommended
# Or alternatively with pip:
# pip install .

4. Configure environment variables:
- Create a .env file in the project root with the following content:

     ANTHROPIC_API_KEY=your_api_key_here

- Replace your_api_key_here with your actual Anthropic API key

5. Running:
python client.py weather/weather.py

If you have a separate tools server, replace weather/weather.py with the location of your server

Dependencies

- anthropic (>=0.49.0): Anthropic API client
- httpx (>=0.28.1): HTTP client
- mcp[cli] (>=1.3.0): MCP CLI tools
- python-dotenv (>=1.0.1): Environment variable management

Environment Variables

The following environment variables are required:

- ANTHROPIC_API_KEY: Your Anthropic API key for authentication

Note

Make sure to keep your .env file secure and never commit it to version control. The repository includes a .gitignore file that should already exclude the .env file.