About MCP Client & Server Example
A Python example project demonstrating a simple MCP client and weather server. It is intended for developers exploring MCP, with a National Weather Service example and an interactive client integrated with Claude AI.
Key features
- 01Example MCP weather server
- 02Weather example using National Weather Service API
- 03Interactive client with Claude AI
Use cases
- 01Explore a basic MCP server implementation
- 02Try an interactive MCP client with Claude AI
MCP support
Includes an MCP server with weather service endpoints and a client example that connects with Claude AI.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Client & Server Example
Prerequisites
- Python 3.12 or higher
- uv (Python package installer and environment manager)
- Environment variables set up in
.envfile (for Anthropic API key)
Installation
-
Clone the repository
-
Install uv if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Create and activate a new environment:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies using uv:
uv pip install -e .
- Configure .env by copying
.env.exampleto.envand filling in your Anthropic API key:
Project Structure
- Simple client and server
weather_server.py- MCP server implementation with weather service endpoints
- Client example and Server example
weather_example.py- Example implementation using the National Weather Service APIclient_example.py- Interactive client with Claude AI integration
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.