Weather MCP
Weather MCP
シンプルで使いやすい天気予報MCPツールで、CLIコマンドラインとMCPサーバーの両方の使用方法をサポートしています。
機能特性
🌤️ リアルタイム天気照会 - 世界中のあらゆる都市の現在の天気を取得
🔧 CLIサポート - コマンドラインから直接天気を照会
🤖 MCPプロトコル - Claude、CursorなどのAIクライアントをサポート
🌍 グローバル対応 - 中国語、英語など多言語の都市名に対応
⚡ 無料API - Open-Meteoの無料天気サービスを使用、APIキー不要
📝 型安全性 - TypeScript + Zodによる完全な型サポート
Related MCP server: Weather MCP Server
インストール
方法1:npmグローバルインストール(推奨)
npm install -g weather-mcp方法2:npxで直接使用
npx weather-mcp weather 北京方法3:ソースコードからインストール
git clone https://github.com/tengzhijian/weather-mcp.git
cd weather-mcp
npm install
npm run buildCLIの使用方法
# 查询天气
weather-mcp weather 北京
weather-mcp weather Shanghai
# 查看帮助
weather-mcp --help
weather-mcp --version出力例
{
"ok": true,
"data": {
"city": "北京 (中国)",
"temperature": 22,
"humidity": 70,
"description": "多云",
"windSpeed": 9.3,
"updatedAt": "2024-01-15T08:30:00.000Z"
}
}MCPサーバーの設定
Claude Desktop
%APPDATA%/Claude/settings.json(Windows)または ~/Library/Application Support/Claude/settings.json(Mac)を編集します:
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "weather-mcp", "--mcp"]
}
}
}Cursor
Cursorの Settings → MCP に以下を追加します:
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "weather-mcp", "--mcp"]
}
}
}ローカル開発バージョン
ソースコードから実行する場合:
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/path/to/weather-mcp/dist/index.js", "--mcp"]
}
}
}利用可能なツール
getWeather
指定した都市の天気情報を照会します。
パラメータ:
city(string, 必須): 都市名。例:北京、上海、広州、London、Tokyo
戻り値:
city: 都市名(国名を含む)temperature: 気温(摂氏)humidity: 湿度(パーセント)description: 天気の説明(晴れ、曇りなど)windSpeed: 風速(km/h)updatedAt: データ更新時刻
listSupportedCities
照会可能な都市リストの例を取得します。
戻り値:
cities: 一般的な都市リストの例note: 備考(実際には世界中のあらゆる都市をサポートしています)
AIクライアントでの使用例
設定完了後、ClaudeやCursorなどのクライアントで直接質問できます:
"北京の今日の天気はどうですか?" "上海は明日雨が降りますか?" "ニューヨークの天気を調べて"
AIが自動的に getWeather ツールを呼び出して天気情報を取得します。
開発
# 安装依赖
npm install
# 开发模式
npm run dev weather 北京
# 运行测试
npm test
# 类型检查
npm run typecheck
# 构建
npm run build技術スタック
TypeScript - 型安全なJavaScript
MCP SDK - Model Context Protocol
Commander.js - CLIフレームワーク
Zod - スキーマ検証
Vitest - テストフレームワーク
Open-Meteo - 無料天気API
プロジェクト構造
weather-mcp/
├── src/
│ ├── index.ts # 入口文件
│ ├── cli.ts # CLI 命令
│ ├── mcp-server.ts # MCP Server
│ ├── weather-gateway.ts # 天气 API 封装
│ └── version.ts # 版本号
├── tests/ # 测试文件
├── .github/workflows/ # GitHub Actions
├── package.json
├── tsconfig.json
└── README.mdCI/CD
プロジェクトはGitHub Actionsを使用して自動化されています:
CI: PRおよびPushのたびにテストを自動実行(Node.js 18/20/22)
Release: 手動トリガーによるnpmへの公開
ライセンス
謝辞
天気データは Open-Meteo より無料API提供を受けています
Model Context Protocol 仕様に準拠しています
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides real-time weather data, hourly forecasts, and daily summaries using the free Open-Meteo API with no API key required. It enables users to search for weather conditions by specific coordinates or city names across multiple measurement units.1MIT
- FlicenseNot gradedqualityDmaintenanceA production-ready MCP server that provides real-time weather information, forecasts, and alerts to LLM clients using the Open-Meteo API, with support for 26+ global cities, dual transport (STDIO/HTTP), and Docker deployment.
- AlicenseNot gradedqualityCmaintenanceA no-API-key-required MCP server that wraps Open-Meteo APIs to provide geocoding and weather forecast data, enabling city lookups and multi-day forecasts through tools, resources, and prompts.MIT
- FlicenseNot gradedqualityBmaintenanceA minimal MCP server that provides current weather and forecasts for any city using the free Open-Meteo API, no API key required.11
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tengzhijian/weather-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server