Cover image
Try Now
2025-03-30

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

Weather MCP Server

中文文档 | English

A simple weather information service built with Model Context Protocol (MCP).

Overview

Weather MCP Server provides weather information for cities around the world through a simple API interface. It uses the Model Context Protocol (MCP) to communicate with clients, allowing easy integration with AI assistants and other MCP-compatible applications.

Features

  • Get current weather conditions by city name
  • Returns temperature, weather description, humidity, and wind speed
  • Fallback to generated data if external API is unavailable
  • Simple and lightweight implementation

Tech Stack

  • TypeScript
  • Node.js
  • MCP SDK (@modelcontextprotocol/sdk)
  • Zod for validation

Installation

  1. Clone the repository
git clone https://github.com/Annihilater/mcp-server-get-weather
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Usage

Start the server:

npx @modelcontextprotocol/inspector node dist/index.js

MCP Configuration

要在Cursor中使用此天气服务,需要在~/.cursor/mcp.json文件中添加以下配置:

"mcp-server-get-weather": {
  "command": "node",
  "args": [
    "<path-to-your-project>/dist/index.js"
  ]
}

<path-to-your-project>替换为实际项目路径。配置完成后,可以通过MCP工具调用mcp_mcp_server_get_weather_get_weather函数来获取天气信息。

Example

MCP Config MCP Usage

API Reference

get_weather

Gets weather information for a specified city.

Parameters

Name Type Description
cityName string The name of the city to get weather for

Response

Returns a JSON object with the following structure:

{
  "city": "London",
  "current_condition": {
    "temperature": "15",
    "weatherDesc": "Partly cloudy",
    "humidity": "71",
    "windSpeed": "11",
    "observation_time": "06:53 PM"
  },
  "forecast": {
    "maxTemp": "16",
    "minTemp": "9",
    "sunHour": "7.4",
    "date": "2023-04-12"
  }
}

Development

Available Scripts

  • npm run build - Builds the project and makes the entry point executable
  • npm run watch - Watches for changes and rebuilds automatically
  • npx @modelcontextprotocol/inspector node dist/index.js - Starts the server

Project Structure

  • src/index.ts - Entry point, sets up the MCP server with stdio transport
  • src/server.ts - Server implementation, defines the weather tool

License

MIT

相关推荐

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

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

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

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • HiveNexus
  • Un bot de chat IA pour les petites et moyennes équipes, soutenant des modèles tels que Deepseek, Open AI, Claude et Gemini. 专为中小团队设计的 Ai 聊天应用 , 支持 Deepseek 、 Open Ai 、 Claude 、 Gemini 等模型。

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • Sysc4lls
  • Lecteur de documentation IDA (Sort-of) MCP Server

    Reviews

    3 (1)
    Avatar
    user_khDAmgXL
    2025-04-16

    I've been using the mcp-server-get-weather application and am thoroughly impressed with its performance. It integrates seamlessly into my existing setup and provides accurate weather data promptly. Kudos to Annihilater for creating such a reliable and efficient tool. Highly recommend checking it out!