loading…
Search for a command to run...
loading…
Minimal MCP server for testing client support for resources/subscribe and notifications/resources/updated, simulating an asynchronous status update.
Minimal MCP server for testing client support for resources/subscribe and notifications/resources/updated, simulating an asynchronous status update.
Minimal MCP Streamable HTTP server for testing whether MCP clients correctly handle resources/subscribe and notifications/resources/updated.
This repository is meant to be a reproducible issue / compatibility lab for CLI AI agents such as Codex CLI, Gemini CLI, OpenCode, GitHub Copilot CLI, Claude Code, Goose, and Crush.
The server exposes one fixed MCP resource:
test://review/status
Initial content:
status: pending
version: 1
message: Waiting for simulated review result.
After a client subscribes to the resource, the server waits for MCP_TEST_UPDATE_DELAY_SECONDS, changes the resource, and sends:
{
"method": "notifications/resources/updated",
"params": {
"uri": "test://review/status"
}
}
Updated content:
status: reviewed
version: 2
message: Simulated review result is now available.
tools/call is useful for explicit actions, but many agent workflows depend on context that changes after the original request. Polling every source is noisy and client-specific. MCP resource subscriptions give clients a protocol-level way to learn that a known context object changed and should be re-read.
Examples where subscription behavior matters:
This test server focuses on whether the client notices a resource update, re-runs resources/read, and reflects the new content in the agent loop / model context.
docker compose up --build
MCP URL:
http://127.0.0.1:8089/mcp
For local development:
npm install
npm run dev
| Environment variable | Default | Description |
|---|---|---|
MCP_TEST_PORT |
8089 |
TCP port the server listens on |
MCP_TEST_PATH |
/mcp |
Additional MCP endpoint path. The server always registers /mcp; this adds a second path (e.g. /mcp/subscribe-probe for gateway routing). Both paths share the same MCP handler. |
MCP_TEST_UPDATE_DELAY_SECONDS |
5 |
Seconds to wait before sending the resource update notification |
MCP_TEST_INITIAL_STATUS |
pending |
Initial value of the status field in the resource |
MCP_TEST_UPDATED_STATUS |
reviewed |
Value of status after the simulated update |
MCP_TEST_SEND_LIST_CHANGED |
false |
Also send notifications/resources/list_changed after the update |
MCP_TEST_LOG_LEVEL |
debug |
Log verbosity (debug / info / warn / error / silent) |
If MCP_TEST_SEND_LIST_CHANGED=true, the server also sends notifications/resources/list_changed after the simulated update.
An ideal MCP client should follow this flow:
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
The initialize response advertises:
{
"resources": {
"subscribe": true,
"listChanged": true
}
}
initializeresources/listresources/readresources/subscriberesources/unsubscribenotifications/resources/updatednotifications/resources/list_changed when MCP_TEST_SEND_LIST_CHANGED=trueNo tools are implemented.
The server logs each important message so client behavior can be checked objectively:
[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
The key evidence for resource subscription support is:
resources/subscribe was received
notification was sent
resources/read was received again after the notification
npm test
The test suite verifies:
resources/list returns test://review/statusresources/read returns version 1resources/subscribe triggers an internal update to version 2notifications/resources/updated is receivedresources/read returns version 2Use docs/verification-guide.md for a repeatable client verification procedure.
Record results in results/compatibility-matrix.md.
resources/list?resources/read?resources/subscribe?notifications/resources/updated?resources/list?resources/read?resources/subscribe?notifications/resources/updated?resources/list?resources/read?resources/subscribe?notifications/resources/updated?resources/list?resources/read?resources/subscribe?notifications/resources/updated?resources/list?resources/read?resources/subscribe?notifications/resources/updated?resources/list?resources/read?resources/subscribe?notifications/resources/updated?resources/list?resources/read?resources/subscribe?notifications/resources/updated?Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-resource-subscribe-test": {
"command": "npx",
"args": []
}
}
}