mcpField
M
MCP Client & Server Example

MCP Client & Server Example

Local
github.com/xiaoye-huaDeveloper Tools0Updated 84w ago

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

  1. 01Example MCP weather server
  2. 02Weather example using National Weather Service API
  3. 03Interactive client with Claude AI

Use cases

  1. 01Explore a basic MCP server implementation
  2. 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.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Client & Server Example

Prerequisites

  • Python 3.12 or higher
  • uv (Python package installer and environment manager)
  • Environment variables set up in .env file (for Anthropic API key)

Installation

  1. Clone the repository

  2. Install uv if you haven't already:

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create and activate a new environment:
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies using uv:
uv pip install -e .
  1. Configure .env by copying .env.example to .env and 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 API
    • client_example.py - Interactive client with Claude AI integration

Comments

Markdown supported

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.