Weather MCP Server

Weather MCP Server

Annihilater

Research & Data
Visit Server

README

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

Recommended Servers

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
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
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
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
MATLAB MCP Server

MATLAB MCP Server

Integrates MATLAB with AI to execute code, generate scripts from natural language, and access MATLAB documentation seamlessly.

Local
JavaScript
Macrostrat MCP Server

Macrostrat MCP Server

Enables Claude to query comprehensive geologic data from the Macrostrat API, including geologic units, columns, minerals, and timescales through natural language.

Local
JavaScript
MCP Word Counter

MCP Word Counter

A Model Context Protocol server that provides tools for analyzing text documents, including counting words and characters. This server helps LLMs perform text analysis tasks by exposing simple document statistics functionality.

Local
JavaScript