Skip to content

[FEATURE] Adopt rmcp 3.3.0 for MCP initialize negotiation - #93

Merged
puretensor merged 1 commit into
mainfrom
grok/review/rmcp-3-3-0
Sep 11, 2026
Merged

puretensor merged 1 commit into
mainfrom
grok/review/rmcp-3-3-0

Conversation

@puretensor

Copy link
Copy Markdown
Owner

Seat: grok-4.6 / xhigh (adversarial review wave 5, 2026-09-11)
Category: [FEATURE]

Problem / Opportunity: pTask's MCP server (/mcp and pt mcp) is every HAL session's task surface. It pins rmcp 3.2.0 (2026-08-31). rmcp 3.3.0 shipped 2026-09-10 and extracted protocol-version negotiation out of the default initialize body into ServerHandler::negotiate_initialize (modelcontextprotocol/rust-sdk#1247). The default initialize now calls that method. Staying on 3.2.0 means pTask's handshake does not take the path the SDK now documents as the negotiation rule.

Evidence:

crates.io (fetched 2026-09-11):

id rmcp
max_version 3.3.0
newest 3.3.0
updated 2026-09-10T15:32:23.420168Z
3.3.0 2026-09-10T15:32:23.420168Z yanked=False
3.2.0 2026-08-31T23:16:49.374902Z yanked=False

Changelog (https://github.com/modelcontextprotocol/rust-sdk/blob/rmcp-v3.3.0/crates/rmcp/CHANGELOG.md):

## 3.3.0 - 2026-09-10
### Added
- add ServerHandler::negotiate_initialize (#1247)

SDK source on the 3.3.0 tag (https://raw.githubusercontent.com/modelcontextprotocol/rust-sdk/rmcp-v3.3.0/crates/rmcp/src/handler/server.rs): the default initialize is now set_peer_info plus self.negotiate_initialize(&request). Quote from the method docs: "This is the whole body of the default initialize minus its set_peer_info side effect, so a server that overrides initialize to add its own can call this instead of restating the negotiation rule."

RED — same test injected on an origin/main worktree still pinned to rmcp 3.2.0:

error[E0599]: no method named `negotiate_initialize` found for struct `mcp::PtaskMcp` in the current scope
   --> crates/ptask-server/src/mcp.rs:626:14
help: there is a method `initialize` with a similar name
   --> rmcp-3.2.0/src/handler/server.rs:318:9
error: could not compile `ptask-server` (lib test) due to 1 previous error

Change: Pin rmcp = "3.3.0" (workspace dep; lockfile also moves rmcp-macros 3.2.0 → 3.3.0). Workspace SemVer 3.28.1 → 3.29.0 (MINOR; Lane 1). Add negotiate_initialize_advertises_tools_on_a_supported_protocol so the new API is called on PtaskMcp and the tools capability plus negotiated protocol version are asserted. Lockfile churn is 22 lines (rmcp + macros + workspace crate stamps). No hmac/sha2/reqwest major bumps — those stay optional behind rmcp features we do not enable.

Verification:

$ cargo test --locked --offline -p ptask-server negotiate_initialize_advertises_tools -- --nocapture
test mcp::tests::negotiate_initialize_advertises_tools_on_a_supported_protocol ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 59 filtered out

$ bash scripts/ci-version-check.sh
version-check: workspace, lockfile, internal requirements, and manpage agree on 3.29.0

$ bash scripts/generated-artifacts.sh --check
generated-artifacts: checked-in files match the CLI

$ cargo fmt --all -- --check   # clean
$ cargo clippy --workspace --all-targets --locked -- -D warnings   # Finished
$ bash scripts/ci-production-build-check.sh
production-build-check: release and fallback builds enable native-ml

$ cargo test --workspace --locked --offline
ptask_bot     14 passed
pt             31 passed
ptask_core    262 passed
ptask_distill  26 passed + 7 integration
ptask_notify    3 passed
ptask_server   60 passed
ptask_tui       2 passed

Risk & rollback: pTask does not override initialize; it picks up the 3.3.0 default (initialize → negotiate_initialize). The new test locks the tools advertisement and that the negotiated version is in supported_protocol_versions(). Revert is a clean single-commit revert. Reviewer restacks SemVer from main (3.28.1).

rmcp 3.3.0 (2026-09-10) extracts protocol-version negotiation into
ServerHandler::negotiate_initialize and the default initialize now
calls it. Pin the MCP server on that line and cover the new path.
@puretensor
puretensor force-pushed the grok/review/rmcp-3-3-0 branch from c819c7d to 776e671 Compare September 11, 2026 20:51
@puretensor
puretensor merged commit 6ca90b5 into main Sep 11, 2026
@puretensor
puretensor deleted the grok/review/rmcp-3-3-0 branch September 11, 2026 20:51
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