Support resource subscriptions (#839)

Clients can now subscribe to specific resources and receive targeted
notifications when those resources change. Previously, calling
`notifyResourceUpdated` on the server would broadcast the notification
to every connected client regardless of interest — now only sessions
that have explicitly subscribed to a given resource URI receive the
update, making resource change propagation both correct and efficient.
The subscription lifecycle is fully handled: clients can subscribe and
unsubscribe at any time, and the server cleans up subscription state
when a session closes.

Supersedes #838.
Resolves #837, #776.

---------

Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
This commit is contained in:
Dariusz Jędrzejczyk 2026-03-02 15:26:03 +01:00 • committed by GitHub
commit 7f68ea5bc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,7 @@ This module contains a comprehensive MCP (Model Context Protocol) server impleme
## Conformance Test Results
**Status: 37 out of 40 tests passing (92.5%)**
**Status: 40 out of 40 tests passing (100%)**
The server has been validated against the official [MCP conformance test suite](https://github.com/modelcontextprotocol/conformance). See [VALIDATION_RESULTS.md](../VALIDATION_RESULTS.md) for detailed results.
@ -22,9 +22,8 @@ The server has been validated against the official [MCP conformance test suite](
- SEP-1034: Default values for all primitive types
- SEP-1330: All enum schema variants
✅ **Resources** (4/6)
- List, read text/binary, templates
- ⚠️ Subscribe/unsubscribe (SDK limitation)
✅ **Resources** (6/6)
- List, read text/binary, templates, subscribe, unsubscribe
✅ **Prompts** (4/4)
- Simple, parameterized, embedded resources, images
@ -191,12 +190,7 @@ curl -X POST http://localhost:8080/mcp \
## Known Limitations
See [VALIDATION_RESULTS.md](../VALIDATION_RESULTS.md) for details on:
1. **Resource Subscriptions** - Not implemented in Java SDK
2. **DNS Rebinding Protection** - Missing Host/Origin validation
These are SDK-level limitations that require fixes in the core framework.
See [VALIDATION_RESULTS.md](../VALIDATION_RESULTS.md) for details on remaining client-side limitations.
## References