Skip to content

feat(mcp)!: support acknowledged notification subscriptions - #34

Merged
danielkov merged 3 commits into
mainfrom
feat/mcp-subscriptions
Oct 15, 2026
Merged

danielkov merged 3 commits into
mainfrom
feat/mcp-subscriptions

Conversation

@danielkov

Copy link
Copy Markdown
Owner

Summary

Support MCP 2026-07-28 acknowledged notification subscriptions while retaining legacy initialization and resource subscription behavior. Upgrade RMCP to 3.5.1 and bundle the agentkit-mcp and umbrella agentkit 0.11.0 versions in this change.

Motivation

Modern subscription notifications bypass RMCP's legacy client callbacks, so opening a stream alone does not update Agentkit's event or discovery surfaces. Hosts also need to fetch changed catalogs without holding a shared manager lock across network requests.

Impact

McpConnection::capabilities() now returns an owned snapshot rather than a reference, allowing callers to observe refreshed capabilities after authentication reconnect. Hosts continue to schedule catalog reconciliation explicitly; notification delivery does not automatically mutate their tool registries.

Technical details

Connection-owned notification streams

Use the dual-era Auto lifecycle, wait for subscription acknowledgment, and expose requested and accepted filters through watchable status. Serialize resource filter replacements, retain the authoritative stream after rejected updates, restore committed URIs after authentication reconnect, and bound fresh-listen recovery with exponential backoff and jitter. Retiring or staging a transport fences its event delivery, and shutdown initiates transport cancellation before awaiting cleanup.

Fenced catalog publication

Add owned prepare/fetch/publish work and wake sources. Connection identity, transport epoch, notification revision, and publication generation fence obsolete results; failed or canceled work remains dirty. Batch refresh isolates server failures, and connection installation and removal publish catalog changes before asynchronous cleanup.

Dependency scope

Pin RMCP and its macros to 3.5.1, selecting process-wrap 10.0.1 transitively while preserving enabled features. The dependency audit reconciled published sources and checksums with upstream revisions; the existing advisory set is unchanged.

Add dual-era connection lifecycle, owned subscription filters and resource restoration, and fenced catalog refresh APIs. Upgrade rmcp to 3.5.1 and bundle MCP and umbrella crate 0.11.0 versions.

BREAKING CHANGE: McpConnection::capabilities now returns an owned snapshot so callers observe current capabilities after authentication reconnect.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two subscription lifecycle issues can silently lose resource updates or leave recovered catalogs stale.

Comment thread crates/agentkit-mcp/src/subscriptions.rs
Comment thread crates/agentkit-mcp/src/subscriptions.rs
Reject partial resource replay acknowledgments before replacing the authoritative connection, and invalidate catalogs after stream recovery. Add HTTP-boundary regressions and explicit legacy/modern reference interop modes without weakening legacy session and resumption checks.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

Comment thread book/src/ch17-mcp.md Outdated
Comment thread docs/mcp.md Outdated
Comment thread book/src/ch17-mcp.md Outdated
@danielkov
danielkov enabled auto-merge (squash) October 15, 2026 12:03
@danielkov
danielkov merged commit fd14cb7 into main Oct 15, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant