Weather MCP Server

Weather MCP Server

MCP Server 和风天气API例子。

xuezhijian

Research & Data
Visit Server

README

Weather MCP Server

一个提供天气预报和城市信息查询功能的Model Context Protocol服务器。该服务器允许LLMs获取未来24小时的天气信息,并支持通过城市名称、经纬度等方式查询城市信息。

可用工具

  • get_24h_weather - 获取未来24小时的天气预报。
    • 必需参数:
      • location (string): 城市名称或经纬度(例如,北京或116.41,39.92)

安装

使用uv(推荐)

使用uv时无需特定安装。我们将使用uvx直接运行mcp-server-weather

使用PIP

或者,你可以通过pip安装mcp-server-weather

pip install mcp-server-weather

安装后,你可以使用以下命令作为脚本运行:

python -m mcp_server_weather

配置

配置Claude.app

在Claude设置中添加:

<details> <summary>使用uvx</summary>

"mcpServers": {
  "weather": {
    "command": "uvx",
    "args": ["mcp-server-weather"]
  }
}

</details>

<details> <summary>使用docker</summary>

"mcpServers": {
  "weather": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "mcp/weather"]
  }
}

</details>

<details> <summary>使用pip安装</summary>

"mcpServers": {
  "weather": {
    "command": "python",
    "args": ["-m", "mcp_server_weather"]
  }
}

</details>

配置Zed

在Zed的settings.json中添加:

<details> <summary>使用uvx</summary>

"context_servers": [
  "mcp-server-weather": {
    "command": "uvx",
    "args": ["mcp-server-weather"]
  }
],

</details>

<details> <summary>使用pip安装</summary>

"context_servers": {
  "mcp-server-weather": {
    "command": "python",
    "args": ["-m", "mcp_server_weather"]
  }
},

</details>

示例交互

  1. 获取未来24小时天气:
{
  "name": "get_24h_weather",
  "arguments": {
    "location": "广州 天河"
  }
}

响应:

{
  "location": "广州 天河",
  "forecast": "未来24小时的天气信息..."
}

调试

你可以使用MCP inspector来调试服务器。对于uvx安装:

npx @modelcontextprotocol/inspector uvx mcp-server-weather

或者如果你在特定目录中安装了包或正在开发:

cd path/to/servers/src/weather
npx @modelcontextprotocol/inspector uv run mcp-server-weather

构建

Docker 构建:

docker build -t mcp/weather .

贡献

我们鼓励对mcp-server-weather的贡献,以帮助扩展和改进其功能。无论是添加新的天气相关工具、增强现有功能,还是改进文档,你的输入都很有价值。

有关其他MCP服务器和实现模式的示例,请参见: https://github.com/modelcontextprotocol/servers

欢迎提交拉取请求!随时贡献新想法、错误修复或增强功能,以使mcp-server-weather更加强大和实用。

许可证

mcp-server-weather根据MIT许可证授权。这意味着你可以自由使用、修改和分发软件,但需遵守MIT许可证的条款和条件。有关详细信息,请参阅项目存储库中的LICENSE文件。

Recommended Servers

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.

Featured
TypeScript
MCP PubMed Search

MCP PubMed Search

Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.

Featured
Python
dbt Semantic Layer MCP Server

dbt Semantic Layer MCP Server

A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.

Featured
TypeScript
mixpanel

mixpanel

Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Featured
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python
Nefino MCP Server

Nefino MCP Server

Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.

Official
Python
Vectorize

Vectorize

Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.

Official
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.

Local
Python
kb-mcp-server

kb-mcp-server

An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded

Local
Python
Research MCP Server

Research MCP Server

The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.

Local
Python