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.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

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.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 783a32c330d2 · 采集于 2026-11-13 10:55:33 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

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.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

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