Sponsored by Deepsite.site

Weather MCP Server

Created By
Annihilater9 months ago
Content

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

NameTypeDescription
cityNamestringThe 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

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
CursorThe AI Code Editor
Tavily Mcp
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Amap Maps高德地图官方 MCP Server
WindsurfThe new purpose-built IDE to harness magic
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server