
tutorial mcp
使用美国国家气象局API提供天气信息的Model Context Protocol (MCP) 服务器。
Repository Info
About This Server
使用美国国家气象局API提供天气信息的Model Context Protocol (MCP) 服务器。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Weather MCP Server
National Weather Service APIを使用した天気情報を提供するModel Context Protocol (MCP) サーバーです。 公式チュートリアルを参考に実装しました。
MCPの利点
-
自然言語インターフェース
- 複雑なAPIパラメータを意識せずに会話形式で情報を取得可能
- ユーザーフレンドリーな対話型インターフェース
-
コンテキスト理解
- AIが質問の意図を理解し、適切なツールを選択
- 曖昧な質問からでも必要な情報を抽出
-
拡張性
- 新しいツールの追加が容易
- 既存のツールの機能拡張が簡単
-
統合性
- 様々なAIクライアント(Cursor, Claude等)と連携可能
- 標準化されたプロトコルによる安定した通信
機能
- 州ごとの天気警報の取得
- 緯度経度指定による天気予報の取得
必要条件
- Node.js v16以上
- npm
- Cursor
インストール
# 依存関係のインストール
npm install
# ビルド
npm run build
使用方法
Cursorでの設定
-
Cursorの設定ファイルを開きます:
# Windows code %APPDATA%\Cursor\settings.json # MacOS/Linux code ~/Library/Application\ Support\Cursor\settings.json -
設定ファイルに以下を追加:
{ "mcp.servers": { "weather": { "command": "node", "args": ["/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/build/index.js"] } } } -
Cursorを再起動します。
コマンド例
-
天気警報の取得:
カリフォルニア州の天気警報を教えて -
天気予報の取得:
サンフランシスコの天気予報を教えて
プロジェクト構造
src/
├── constants/
│ └── weather.constants.ts # 定数定義
├── interfaces/
│ └── weather.interface.ts # 型定義
├── utils/
│ └── format.util.ts # ユーティリティ関数
└── index.ts # メインエントリーポイント
Quick Start
Clone the repository
git clone https://github.com/glkt3912/tutorial-mcpInstall dependencies
cd tutorial-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.