Cover image
天气麦克风服务器
Public

天气麦克风服务器

Try Now
2025-03-09

创建MCP服务器的示例

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

Weather MCP Server

This is a learning project exploring the Model Context Protocol (MCP) concept. The project implements a simple weather service that provides weather alerts and forecasts using the National Weather Service (NWS) API.

About This Project

This project was created as an exercise in learning and implementing MCP (Model Context Protocol) following the documentation at: https://modelcontextprotocol.io/quickstart/server#core-mcp-concepts

MCP is a protocol that allows AI assistants to access external tools and data sources. This project demonstrates how to create an MCP server that can be used with Claude or other MCP-compatible assistants.

Features

  • get_alerts: Retrieve active weather alerts for a US state
  • get_forecast: Get weather forecast for a specific location using latitude and longitude

Requirements

  • Python 3.9+
  • httpx library
  • mcp library

Setup Instructions

  1. Clone this repository

  2. Install the dependencies:

    pip install mcp httpx
    

    or use uv:

    uv pip install mcp httpx
    
  3. Configure the MCP server in your AI assistant:

In Claude Desktop

Add the following to the Claude Desktop configuration:

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather",
        "run",
        "weather.py"
      ]
    }
  }
}

In Cursor

Go to Cursor Settings -> MCP Servers -> Add MCP Server

  • Name: Weather (or any name you prefer)
  • Type: Command
  • Command: uv run /ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/weather.py

Usage Examples

Once the MCP server is set up, you can ask the AI assistant to:

  • "What are the current weather alerts in CA?"
  • "Get me the weather forecast for latitude 37.7749 and longitude -122.4194"

License

This project is for educational purposes.

Acknowledgements

  • National Weather Service (NWS) API for providing weather data
  • MCP documentation for guidance on implementing the server

相关推荐

  • 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.

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

  • Khalid kalib
  • Write professional emails

  • 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

    4 (1)
    Avatar
    user_Mqd2i8Rw
    2025-04-15

    The MultiversX MCP Server is a robust solution for managing cloud platforms effectively. Developed by MultiversX, it offers seamless integration and reliable performance for enterprises. I highly recommend it for its exceptional user experience and functionality. Check it out at https://mcp.so/server/mx-mcp/multiversx.