Cover image
Try Now
2025-03-13

MCP服务器和风天气API例子。

3 years

Works with Finder

1

Github Watches

2

Github Forks

1

Github Stars

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设置中添加:

使用uvx
"mcpServers": {
  "weather": {
    "command": "uvx",
    "args": ["mcp-server-weather"]
  }
}
使用docker
"mcpServers": {
  "weather": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "mcp/weather"]
  }
}
使用pip安装
"mcpServers": {
  "weather": {
    "command": "python",
    "args": ["-m", "mcp_server_weather"]
  }
}

配置Zed

在Zed的settings.json中添加:

使用uvx
"context_servers": [
  "mcp-server-weather": {
    "command": "uvx",
    "args": ["mcp-server-weather"]
  }
],
使用pip安装
"context_servers": {
  "mcp-server-weather": {
    "command": "python",
    "args": ["-m", "mcp_server_weather"]
  }
},

示例交互

  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文件。

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    5 (1)
    Avatar
    user_zPqyMgWN
    2025-04-15

    As a dedicated user of the Grumpy Senior Developer MCP server, I am thoroughly impressed by its functionality and reliability. Authored by sinedied, this server brings a touch of seasoned expertise into the MCP environment. The welcome information sets a professional tone, ensuring a smooth start. Highly recommended for those seeking a robust and efficient server solution. Check it out here: https://mcp.so/server/grumpydev-mcp/sinedied.