EW

ezh0v/weather-mcp-server

Deployment & DevOps

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

246 stars 22 forks 品質 73 トレンド 18MIT

ezh0v/weather-mcp-server は、https://github.com/ezh0v/weather-mcp-server. からインポートされたMCPサーバー候補です。

概要

ezh0v/weather-mcp-server は、https://github.com/ezh0v/weather-mcp-server. からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

天候API MCPサーバー

バグを報告 |リクエスト機能

軽量なモデルコンテキストプロトコル(MCP)サーバーで、ClaudeのようなAIアシスタントがリアルタイムの気象データを取得・解釈できるようにします。

Claudeデスクトップへのインストール

Claude DesktopでMCPサーバーを使用するには、Claudeの設定に追加してください:

1.ローカルモード

WeatherAPIの個人アカウントからAPIキーを取得できます。

2.リモートモード

ソースから構築

goを使ってcmd/github-mcp-serverディレクトリ内のバイナリを作成できます。

Docker コンテナを使ったMCP

1.Dockerイメージを構築する:

2.Dockerコンテナを実行する:

your-api-keyを実際のWeatherAPI APIキーに置き換えてください。

道具

  • current_weather - 都市の最新天気を把握する

  • city:都市名(文字列、必要)

プロジェクト構成

プロジェクトは複数の主要なディレクトリに分かれています。

テスト

新機能を追加する場合は、必ずテストを含めてください。

1.モックゲンツールをインストールしてください:

go.uber.org/mock の設置ガイドをご覧ください。

2.モックファイルを生成するには以下のコマンドを使用します:

3.ユニットテストを実行するには:

貢献

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data.

Installing on Claude Desktop

To use your MCP server with Claude Desktop, add it to your Claude configuration:

1. Local mode

{
  "mcpServers": {
    "weather-mcp-server": {
      "command": "/path/to/weather-mcp-server",
      "env": {
        "WEATHER_API_KEY": "your-api-key"
      }
    }
  }
}

You can get an API key from your personal account on WeatherAPI.

2. Remote mode

{
  "mcpServers": {
    "weather-mcp-server": {
      "url": "http://host:port/sse"
    }
  }
}

Build from source

You can use go to build the binary in the cmd/github-mcp-server directory.

go build -o weather-mcp-server ./cmd/weather-mcp-server

Using MCP with Docker Containers

1. Build the Docker Image:

docker build -t weather-mcp-server .

2. Run the Docker Container:

docker run -e WEATHER_API_KEY=your-api-key -d --name weather-mcp-server -p 8000:8000 weather-mcp-server

Replace your-api-key with your actual WeatherAPI API key.

Tools

  • current_weather - Gets the current weather for a city

    • city: The name of the city (string, required)

Project Structure

The project is organized into several key directories:

├── cmd
│   └── weather-mcp-server
├── internal
│   └── server
│       ├── handlers # MCP handlers
│       ├── services # Business logic layer
│       │   ├── core # Core application logic
│       │   └── mock # Mock services for testing
│       ├── tools # MCP tools
│       └── view # Templates for displaying messages
└── pkg

Testing

GitHub で README 全文を見る

インストール

docker run -e WEATHER_API_KEY=your-api-key -d --name weather-mcp-server -p 8000:8000 weather-mcp-server
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "weather-mcp-server": { "command": "/path/to/weather-mcp-server", "env": { "WEATHER_API_KEY": "your-api-key" } } } }