Weather MCP
A weather server providing weather information for locations within the United States.
MCPサーバーを作ってみよう
参考資料
2025/6/13やったこと
- 記事通りに構築
- 一旦記事通り構築できたはす記述しているsrcのモジュールがうまく読み込めていないので、また確認
2025/6/28 エラー解消と解決方法
🔍 発生した問題
- 不要なコードとインポート:
src/index.tsに記事にない追加のコードが混入 - Node.jsバージョン: v14では動作せず、v20が必要
- CursorのMCP設定: Node.jsの正確なパスが必要
- 不要な依存関係: 記事で使用されていない
axiosがpackage.jsonに含まれている
✅ 解決方法
1. src/index.tsの修正
- 不要なインポート
import { getWeather } from './weather.js';を削除 - 記事にない
get-city-weatherツールを削除 - メイン関数を記事通りのMCPサーバー起動処理に修正
2. Node.jsバージョン変更
nvm use 20
nvm alias default 20
3. package.json修正
- 不要な依存関係
axiosを削除 - 記事通りの構成に統一
4. 不要ファイル削除
- 使用されていない
src/weather.tsを削除
5. CursorのMCP設定
{
"mcpServers": {
"weather": {
"command": "/Users/r273-2576/.nvm/versions/node/v20.18.0/bin/node",
"args": ["/Users/r273-2576/Documents/AI-mokumoku/weather-mcp/build/index.js"]
}
}
}
🎯 動作確認
- MCPサーバーのビルド成功 (
npm run build) - CursorでMCP設定が緑色のインジケーター表示
- 「サンフランシスコの天気を教えて」で正常に天気情報取得可能
📝 注意点
- NWS APIはアメリカ国内の天気情報のみ対応
- 東京などの海外都市は非対応
- Cursor設定変更後は必ず完全再起動が必要
Weather MCP Server構築
-
どんなものを作ったか
- アメリア国内の天気情報を取得できる
-
検証結果
-
記事通りにはいかなかった点
- Nodeのバージョン
- 案件の影響でv14を使用していた。実行するバージョンがv20系からになっており、nvmでv20系を設定していてもチャットで実行してもらうときには、グローバルのパスがv14系になっていたので実行できなかった。
- Nodeのバージョン
Related Servers
HyperKitty MCP Server
MCP server that provides read-only access to HyperKitty, the web-based email archive component of Mailman 3.
RSS3
Integrates the RSS3 API to query the Open Web.
Google Search
Perform Google searches and view web content with advanced bot detection avoidance.
Sci-Hub MCP Server
Search and access academic papers from Sci-Hub by DOI, title, or keyword.
Ticketmaster
Discover events, venues, and attractions using the Ticketmaster Discovery API.
Marketaux
Search for market news and financial data by entity, country, industry, or symbol using the Marketaux API.
Medical Research MCP Suite
An AI-powered API for medical research, unifying ClinicalTrials.gov, PubMed, and FDA databases with intelligent analysis.
Search MCP Server
A server providing web and similarity search functionalities, designed for Claude Desktop. It requires external embedding and API services.
YouTube Data MCP
High-efficiency YouTube MCP server providing token-optimized, structured data for LLMs.
MarineTraffic MCP Server
Provides access to MarineTraffic vessel tracking data.