MCP Python demo with a weather server and client

MCP Python demo with a weather server and client

mcp-demo-guobinqiu•byguobinqiu

A Python Model Context Protocol demo that runs a server exposing weather alert and forecast tools alongside a client that connects to it and calls those tools.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides two MCP tools, get_alerts and get_forecast, that the client discovers through a ListToolsRequest.
  • •The client invokes the server's tools via a CallToolRequest, and the forecast tool calls the weather.gov API for point and forecast data.
  • •Uses deepseek-chat as the LLM, because DeepSeek V3 supports the tools attribute while deepseek-reasoner does not.

BEST FOR

  • •Developers learning how an MCP client and server exchange tool-list and tool-call requests.
  • •Experimenting with a weather-focused MCP tool by querying forecasts through an LLM.

ABOUT MCP-DEMO-GUOBINQIU

MCP Python demo with a weather server and client is cataloged as an MCP server attributed to guobinqiu. A Python Model Context Protocol demo that runs a server exposing weather alert and forecast tools alongside a client that connects to it and calls those tools. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP Python demo with a weather server and client are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which LLM does the demo use, and why?

It uses deepseek-chat because only V3 supports the tools attribute, whereas deepseek-reasoner does not.

Upstream README

View this exact version on GitHub

README.md · 783a32c330d2 · Fetched 2026-11-13 10:55:33 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

MCP Python Demo

LLM 使用的 deepseek-chat 因为只有v3有tools属性 (deepseek-reasoner是不行的)

chat_response = client.chat.completions.create(
    model="deepseek-chat", # 通过指定 model='deepseek-chat' 即可调用 DeepSeek-V3 V3有tools属性
    messages=messages,
    tools=available_tools,
    tool_choice="auto"
)

安装

pip install uv
# uv init mcp-demo-python
git clone git@github.com:guobinqiu/mcp-demo-python.git
cd mcp-demo-python
uv venv
source .venv/bin/activate
# uv add "mcp[cli]" httpx
# uv add mcp openai python-dotenv
# rm main.py

运行

运行前把.env文件里的OPENAI_API_KEY换成你自己的

source .venv/bin/activate
python client/main.py server/main.py

输出

[04/23/25 21:11:54] INFO     Processing request of type ListToolsRequest                                                                                 server.py:534

Connected to server with tools: ['get_alerts', 'get_forecast']

MCP Client Started!
Type your queries or 'quit' to exit.

Query: what's the weather in new york 
[04/23/25 21:12:09] INFO     Processing request of type ListToolsRequest                                                                                 server.py:534
[04/23/25 21:12:15] INFO     Processing request of type CallToolRequest                                                                                  server.py:534
                    INFO     HTTP Request: GET https://api.weather.gov/points/40.7128,-74.006 "HTTP/1.1 200 OK"                                        _client.py:1740
[04/23/25 21:12:16] INFO     HTTP Request: GET https://api.weather.gov/gridpoints/OKX/33,35/forecast "HTTP/1.1 200 OK"                                 _client.py:1740
[DEBUG] final_text[0] type: <class 'str'>, value: Here's the current weather forecast for New York:

### Today:  
- **Temperature:** 73°F  
- **Wind:** 7 mph NW  
- **Forecast:** Mostly sunny, with a high near 73.  

### Tonight:  
- **Temperature:** 57°F  
- **Wind:** 3 to 7 mph SE  
- **Forecast:** Mostly clear.  

### Thursday:  
- **Temperature:** 68°F (falling to 64°F in the afternoon)  
- **Wind:** 3 to 12 mph SE  
- **Forecast:** Sunny.  

### Thursday Night:  
- **Temperature:** 56°F  
- **Wind:** 6 to 12 mph S  
- **Forecast:** Mostly clear.  

### Friday:  
- **Temperature:** 70°F (falling to 66°F in the afternoon)  
- **Wind:** 5 to 14 mph S  
- **Forecast:** Partly sunny.  

Let me know if you'd like more details!

Here's the current weather forecast for New York:

### Today:  
- **Temperature:** 73°F  
- **Wind:** 7 mph NW  
- **Forecast:** Mostly sunny, with a high near 73.  

### Tonight:  
- **Temperature:** 57°F  
- **Wind:** 3 to 7 mph SE  
- **Forecast:** Mostly clear.  

### Thursday:  
- **Temperature:** 68°F (falling to 64°F in the afternoon)  
- **Wind:** 3 to 12 mph SE  
- **Forecast:** Sunny.  

### Thursday Night:  
- **Temperature:** 56°F  
- **Wind:** 6 to 12 mph S  
- **Forecast:** Mostly clear.  

### Friday:  
- **Temperature:** 70°F (falling to 66°F in the afternoon)  
- **Wind:** 5 to 14 mph S  
- **Forecast:** Partly sunny.  

Let me know if you'd like more details!

Query: 

Golang版

https://github.com/guobinqiu/mcp-demo-golang

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP Python demo with a weather server and client from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-demo-guobinqiu)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools