mcp-resource-subscribe-test
mcp-resource-subscribe-test
MCPクライアントが resources/subscribe および notifications/resources/updated を正しく処理できるかをテストするための、最小限のMCP Streamable HTTPサーバーです。
このリポジトリは、Codex CLI、Gemini CLI、OpenCode、GitHub Copilot CLI、Claude Code、Goose、CrushなどのCLI AIエージェントにおける再現可能な問題報告や互換性検証のためのラボとして機能します。
目的
このサーバーは、1つの固定されたMCPリソースを公開します:
test://review/status初期コンテンツ:
status: pending
version: 1
message: Waiting for simulated review result.クライアントがリソースを購読した後、サーバーは MCP_TEST_UPDATE_DELAY_SECONDS だけ待機し、リソースを変更して以下を送信します:
{
"method": "notifications/resources/updated",
"params": {
"uri": "test://review/status"
}
}更新後のコンテンツ:
status: reviewed
version: 2
message: Simulated review result is now available.Related MCP server: mcp-hello-world
なぜ tools/call ではなく resources/subscribe なのか
tools/call は明示的なアクションには有用ですが、多くのエージェントワークフローは、元のリクエスト後に変化するコンテキストに依存しています。すべてのソースをポーリングするのはノイズが多く、クライアント固有の処理が必要です。MCPリソースの購読機能は、既知のコンテキストオブジェクトが変更され、再読み込みが必要であることをクライアントが知るためのプロトコルレベルの方法を提供します。
購読の動作が重要となる例:
Copilotのレビュー結果
PRレビューのスレッド
CIステータス
Codecovのコメント
GitHubのIssue議論
ローカルのビルド/テスト結果
このテストサーバーは、クライアントがリソースの更新に気づき、resources/read を再実行し、新しいコンテンツをエージェントループやモデルのコンテキストに反映させるかどうかに焦点を当てています。
開始方法
docker compose up --buildMCP URL:
http://127.0.0.1:8089/mcpローカル開発用:
npm install
npm run dev設定
環境変数 | デフォルト値 |
|
|
|
|
|
|
|
|
|
|
|
|
MCP_TEST_SEND_LIST_CHANGED=true の場合、サーバーはシミュレートされた更新後に notifications/resources/list_changed も送信します。
期待されるクライアントの動作
理想的なMCPクライアントは、以下のフローに従う必要があります:
initialize
↓
resources/list
↓
resources/read test://review/status
↓
resources/subscribe test://review/status
↓
receive notifications/resources/updated
↓
resources/read test://review/status again
↓
reflect updated status: reviewed in agent contextサーバーの機能
初期化レスポンスで以下を通知します:
{
"resources": {
"subscribe": true,
"listChanged": true
}
}実装されているMCPメッセージ
initializeresources/listresources/readresources/subscriberesources/unsubscribenotifications/resources/updatednotifications/resources/list_changed(MCP_TEST_SEND_LIST_CHANGED=trueの場合)
ツールは実装されていません。
ログ
サーバーは重要なメッセージをすべてログに記録するため、クライアントの動作を客観的に確認できます:
[initialize] client connected
[resources/list] requested
[resources/read] uri=test://review/status version=1
[resources/subscribe] uri=test://review/status
[resource/update] uri=test://review/status version=2
[notification/send] notifications/resources/updated uri=test://review/status
[resources/read] uri=test://review/status version=2
[resources/unsubscribe] uri=test://review/statusリソース購読サポートの重要な証拠は以下の通りです:
resources/subscribe was received
notification was sent
resources/read was received again after the notificationテスト
npm testテストスイートは以下を検証します:
resources/listがtest://review/statusを返すこと初回の
resources/readがバージョン1を返すことresources/subscribeがバージョン2への内部更新をトリガーすることnotifications/resources/updatedが受信されること更新後の
resources/readがバージョン2を返すこと
クライアント互換性ノート
Codex CLI
MCP接続:
resources/listを呼び出しますか?resources/readを呼び出しますか?resources/subscribeを呼び出しますか?notifications/resources/updatedを受信しますか?更新後にリソースを再読み込みしますか?
メモ:
Gemini CLI
MCP接続:
resources/listを呼び出しますか?resources/readを呼び出しますか?resources/subscribeを呼び出しますか?notifications/resources/updatedを受信しますか?更新後にリソースを再読み込みしますか?
メモ:
OpenCode
MCP接続:
resources/listを呼び出しますか?resources/readを呼び出しますか?resources/subscribeを呼び出しますか?notifications/resources/updatedを受信しますか?更新後にリソースを再読み込みしますか?
メモ:
GitHub Copilot CLI
MCP接続:
resources/listを呼び出しますか?resources/readを呼び出しますか?resources/subscribeを呼び出しますか?notifications/resources/updatedを受信しますか?更新後にリソースを再読み込みしますか?
メモ:
Claude Code
MCP接続:
resources/listを呼び出しますか?resources/readを呼び出しますか?resources/subscribeを呼び出しますか?notifications/resources/updatedを受信しますか?更新後にリソースを再読み込みしますか?
メモ:
Goose
MCP接続:
resources/listを呼び出しますか?resources/readを呼び出しますか?resources/subscribeを呼び出しますか?notifications/resources/updatedを受信しますか?更新後にリソースを再読み込みしますか?
メモ:
Crush
MCP接続:
resources/listを呼び出しますか?resources/readを呼び出しますか?resources/subscribeを呼び出しますか?notifications/resources/updatedを受信しますか?更新後にリソースを再読み込みしますか?
メモ:
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityDmaintenanceA simple server implementing the Model Context Protocol (MCP) that echoes messages back, designed for testing MCP clients.12MIT
- Alicense-qualityBmaintenanceA minimal MCP server mock for testing, providing echo, debug, and greeting resources to simulate MCP interactions.20,48022MIT
- Flicense-qualityCmaintenanceMinimal MCP server for testing SkyStage's self-auth auto-detection feature. It includes tools like ping, echo, server_info, and read_secret, and uses a mock OAuth provider for login.
- Flicense-qualityDmaintenanceA simple MCP server with OAuth 2.0 authentication for testing OAuth support in mcp-cli.
Related MCP Connectors
MCP server wrapping the Tesla Fleet API and TeslaMate API
A basic MCP server to operate on the Postman API.
MCP (Model Context Protocol) server for Appwrite
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/scottlz0310/mcp-resource-subscriber'
If you have feedback or need assistance with the MCP directory API, please join our Discord server