in-gain/mcp_server_test
If you are the rightful owner of mcp_server_test and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This repository provides a simple TODO server example using the Model Context Protocol (MCP) to demonstrate how to operate tools and resources via MCP from an agent utilizing the OpenAI API.
MCP TODO サンプル
このリポジトリは Model Context Protocol (MCP) を用いた簡単な TODO サーバーの例です。OpenAI API を利用するエージェントから MCP を介してツールやリソースを操作する方法を示します。
必要条件
-
Node.js 22 以降
-
npm
-
OpenAI API キー (
OPENAI_API_KEY
)
インストール
依存パッケージをインストールします:
npm install
この作業にはインターネット接続が必要です。
TypeScript ソースをビルドします:
npm run build
サーバーの起動
次にサーバーを実行します:
npm start
サーバーは MCP 経由でツールとリソースを提供します。
エージェントの実行
エージェントは OpenAI API を使って TODO 項目を生成し、サーバーに送信します。OPENAI_API_KEY
を環境変数に設定して実行してください:
OPENAI_API_KEY=あなたのキー node dist/agent.js "買い物の準備をする"
これにより TODO 項目が作成され、完了後に表示されます。
テスト
Node.js 組み込みのテストランナーで簡単なユニットテストを実行できます:
npm test
環境変数
OPENAI_API_KEY
– OpenAI の API キー