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: SkyStage MCP Test Server
なぜ 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 deployed
Maintenance
Related MCP Connectors
Minimal streamable HTTP MCP server used for owned-account registry connectivity tests.
Security research canary remote MCP server for owned-account testing.
Experimental MCP server for current empirical verification of explicit public HTTPS endpoint claims.
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
Related MCP Servers
- AlicenseCqualityDmaintenanceA simple server implementing the Model Context Protocol (MCP) that echoes messages back, designed for testing MCP clients.13MIT
- FlicenseNot gradedqualityDmaintenanceMinimal 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.-
- FlicenseNot gradedqualityDmaintenanceA simple MCP server with OAuth 2.0 authentication for testing OAuth support in mcp-cli.-
- AlicenseNot gradedqualityCmaintenanceEducational MCP server demonstrating the 2026-07-28 stateless protocol with raw Starlette, no SDK, featuring tools, request state handles, MRTR elicitation, and subscriptions.MIT