Simple MCP Feature Sample について
Simple MCP Feature Sampleは、MCPサーバーの構築を学び、Claude Desktopやサンプルクライアントで試すための基本プロジェクトです。単一・複数クライアントのデモで、テキスト処理ツールとデータサーバー機能を紹介します。
主な機能
- 01基本的なMCPサーバー設定
- 02テキスト反転と大文字変換ツール
- 03データサーバーの例
- 04単一クライアント用デモスクリプト
- 05複数クライアント用デモスクリプト
活用シーン
- 01MCPサーバー実装の基礎学習
- 02AIクライアントでのテキスト処理ツールの試用
- 03単一または複数クライアントのデモ実行
MCP 対応
基本的なMCPサーバーとサンプルツールを紹介します。Claude Desktopやプロジェクトのサンプルクライアントから接続できます。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。
ツール
ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。
詳細
シンプルな MCP 機能のサンプル
このプロジェクトには、MCP の機能を実装したサンプルがいくつか含まれています。
サーバースクリプトでは、Claude Desktop と連携する基本的な MCP サーバーのセットアップ方法を示しています。
これらのサーバースクリプトは、私が開発したシンプルな MCP クライアントでも動作します。
機能の確認方法
デモを起動するシェルスクリプトが 2 つあります。単一クライアント用と複数クライアント用です。
単一クライアントのデモを起動する
single-client-launch-demo.sh を実行します。
$ ./single-client-launch-demo.sh
すると、コンソールに次のように表示されます。
Connecting to the MCP server...
Command is python
Connected to the server 'simple_server'!
Waiting for server to initialize...
Server initialized!
Connected to the server with tools: ['reverse-text', 'uppercase']
MCP client started!
Type your queries or 'quit' to exit.
Query:
AI に尋ねたいことを入力するか、終了するには quit と入力してください。
reverse text または upper text を含むリクエストを送信すると、AI はシンプルな MCP サーバーのテキスト処理機能を使用します。
複数クライアントのデモを起動する
multi-client-launch-demo.sh を実行します。
$ ./multi-client-launch-demo.sh
すると、コンソールに次のように表示されます。
Connecting to the MCP server...
Command is python
Connected to the server 'simple_server'!
Waiting for server to initialize...
Server initialized!
Connected to the server with tools: ['reverse-text', 'uppercase']
Connecting to the MCP server...
Command is python
Connected to the server 'profile_data_server'!
Waiting for server to initialize...
Server initialized!
Connected to the server with tools: ['profile-data']
MultiMCP client started!
Type your queries or 'quit' to exit.
Query:
AI に尋ねたいことを入力するか、終了するには quit と入力してください。
クエリに Who am I? を含めると、AI はデータ MCP サーバーの機能を使用して質問に回答します。
Claude Desktop へのインストール
Claude Desktop の設定ファイルに次の設定を追加します。
"mcpServers": {
"simple-mcp-sample": {
"command": "python",
"args": [
"/path/to/simple-mcp-sample/server/simple_server.py"
]
}
}
"mcpServers": {
"simple-mcp-sample": {
"command": "python",
"args": [
"/path/to/simple-mcp-sample/server/data_server.py"
]
}
}
メモ
サーバーの起動時に
command not foundエラーが発生する場合は、Python 実行ファイルのフルパスを指定してください。
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。