mcpField
W
weather-mcp-s

weather-mcp-s

ローカル
github.com/bee1194メディア・デザイン081 週間前に更新

weather-mcp-s について

weather-mcp-s は、MCP ツール開発を学ぶ人向けの、mcp-framework 製 MCP サーバーです。サンプルツールが含まれ、ツールの追加方法と Claude Desktop への接続方法も示されています。

主な機能

  1. 01mcp-framework 製
  2. 02サンプルツールを同梱
  3. 03CLI からツールを追加
  4. 04ツールをビルドして読み込み

活用シーン

  1. 01MCP サーバー開発の学習
  2. 02カスタム MCP ツールの追加
  3. 03Claude Desktop への接続

MCP 対応

MCP クライアントにツールを提供する MCP サーバーです。README では Claude Desktop へのローカル設定方法が説明されています。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

インストール方法は未掲載です

このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。

リポジトリ

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

weather-mcp-s

mcp-framework で構築された Model Context Protocol(MCP)サーバーです。

クイックスタート

# Install dependencies
npm install

# Build the project
npm run build

プロジェクト構成

weather-mcp-s/
├── src/
│   ├── tools/        # MCP Tools
│   │   └── ExampleTool.ts
│   └── index.ts      # Server entry point
├── package.json
└── tsconfig.json

コンポーネントの追加

プロジェクトには、src/tools/ExampleTool.ts にサンプルツールが用意されています。CLI を使用して、さらにツールを追加できます。

# Add a new tool
mcp add tool my-tool

# Example tools you might create:
mcp add tool data-processor
mcp add tool api-client
mcp add tool file-handler

ツールの開発

サンプルツールの構成:

import { MCPTool } from "mcp-framework";
import { z } from "zod";

interface MyToolInput {
  message: string;
}

class MyTool extends MCPTool<MyToolInput> {
  name = "my_tool";
  description = "Describes what your tool does";

  schema = {
    message: {
      type: z.string(),
      description: "Description of this input parameter",
    },
  };

  async execute(input: MyToolInput) {
    // Your tool logic here
    return `Processed: ${input.message}`;
  }
}

export default MyTool;

npm への公開

  1. package.json を更新します:

    • name が一意で、npm の命名規則に従っていることを確認します
    • 適切な version を設定します
    • description、author、license などを追加します
    • bin が正しいエントリーファイルを指していることを確認します
  2. ローカルでビルドしてテストします:

    npm run build
    npm link
    weather-mcp-s  # Test your CLI locally
    
  3. npm にログインします(必要に応じてアカウントを作成してください):

    npm login
    
  4. パッケージを公開します:

    npm publish
    

公開後、ユーザーはこれを Claude デスクトップクライアントに追加する(以下を参照)か、npx で実行できます。


## Using with Claude Desktop

### Local Development

Add this configuration to your Claude Desktop config file:

**MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "weather-mcp-s": {
      "command": "/absolute/path/to/node",
      "args":["/absolute/path/to/weather-mcp-s/dist/index.js"]
    }
  }
}
公開後

以下の設定を Claude Desktop の設定ファイルに追加します:

MacOS:~/Library/Application Support/Claude/claude_desktop_config.json Windows:%APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "weather-mcp-s": {
      "command": "npx",
      "args": ["weather-mcp-s"]
      "env": {
        "OPENWEATHERMAP_API_KEY": "your_api_key"
      }
    }
  }
}

ビルドとテスト

  1. ツールに変更を加えます
  2. npm run build を実行してコンパイルします
  3. サーバーは起動時にツールを自動的に読み込みます

詳細情報

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。