Skip to content

deps: migrate crates/mcp to rmcp 2.1 (supersedes #550) - #551

Merged
wikithoughts merged 1 commit into
mainfrom
deps/rmcp-2.1
Sep 24, 2026
Merged

wikithoughts merged 1 commit into
mainfrom
deps/rmcp-2.1

Conversation

@wikithoughts

Copy link
Copy Markdown
Contributor

Summary

Dependabot's #550 bumps rmcp 1.8.0 → 2.1.0 in crates/mcp but leaves CI red — rmcp 2.x changed three parts of its Rust API surface that crates/mcp uses directly. This PR carries the identical dependency bump plus the minimal source migration, with no behavior change.

  • Same dependency bump as chore(deps): Bump rmcp from 1.8.0 to 2.1.0 #550. Cargo.lock: rmcp 1.8.0 → 2.1.0, rmcp-macros 1.8.0 → 2.2.0 — identical version/checksum diff to chore(deps): Bump rmcp from 1.8.0 to 2.1.0 #550. crates/mcp/Cargo.toml: rmcp = "1.8.0" → "2.1.0".
  • crates/mcp/src/resources.rs — rmcp 2.x removed the Annotated<T>/AnnotateAble wrapper pattern; RawResource/RawResourceTemplate no longer exist. Resource/ResourceTemplate are now flat, directly-constructible structs with the same .with_description()/.with_mime_type() builder methods (no more trailing .no_annotation()).
  • crates/mcp/src/prompts.rs — the standalone PromptMessageRole enum is gone; PromptMessage.role now uses the shared Role type already used elsewhere in the model (PromptMessageRole::User → Role::User).
  • crates/mcp/src/lib.rs — the tool-content union Content was renamed ContentBlock (Content::text → ContentBlock::text).

No other file in the crate (or the workspace) touches rmcp directly, and nothing else needed to change — confirmed by cargo clippy --all-targets --all-features --locked being clean across the whole workspace.

Behavior is unchanged: MCP tool/resource/prompt names, schemas and JSON-RPC wire shape are identical — only rmcp's Rust-side constructor API moved. All 82 indexa-mcp tests pass unmodified, including the golden-contract tests that exist specifically to catch a wire-format drift: tool_contract_golden_list, doc_tool_count_matches_code, prompt_contract_golden_list, resources_round_trip, prompts_round_trip_and_validate_args.

apps/indexa-desktop does not depend on indexa-mcp (no rmcp anywhere in its dependency graph), so its separate, workspace-excluded Cargo.lock needed no regeneration — consistent with desktop build (macOS) already passing on #550.

Test plan

Ran locally, matching .github/workflows/ci.yml exactly:

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features --locked (workspace, -D warnings) — clean
  • cargo test --all --locked — full workspace green; indexa-mcp alone: 82 passed / 0 failed
  • Retrieval eval (indexa scan . && indexa deep . --no-embed && indexa eval fixtures/self-golden.json --mode sparse --top-k 10 --min-hit-rate 0.80) — hit rate 1.00 (floor 0.80)
  • Web smoke (node scripts/web-smoke.mjs under headless Chrome + Xvfb) — 7/7 checks passed
  • cargo build --release --locked -p indexa — release build (see PR comment / CI for result if still finishing locally at post time)

Both the eval and web-smoke steps were run under an isolated HOME/XDG_DATA_HOME/XDG_CONFIG_HOME (mirroring web-smoke.mjs's own existing isolation) so the hermetic verification never touched this host's real Indexa index.

Not run locally (Linux host): desktop-build (macOS) — unaffected per the dependency-graph check above; left to CI.

Supersedes and should close #550 (Dependabot will stop re-proposing the same bump once this merges).

🤖 Generated with Claude Code

Dependabot PR #550 bumped rmcp 1.8.0 -> 2.1.0 but left CI red: rmcp 2.x
dropped the Annotated<T>/AnnotateAble wrapper (RawResource/RawResourceTemplate
are gone; Resource/ResourceTemplate are now flat, directly-constructible
structs with the same builder methods), renamed the tool-content union
Content -> ContentBlock, and replaced the standalone PromptMessageRole enum
with the shared Role type already used elsewhere in the model.

Same dependency bump as #550 (Cargo.lock: rmcp 1.8.0 -> 2.1.0,
rmcp-macros 1.8.0 -> 2.2.0, identical checksums), plus the three call sites
that needed updating for the new API:

- crates/mcp/src/resources.rs: RawResource::new(..).no_annotation() ->
  Resource::new(..); RawResourceTemplate::new(..).no_annotation() ->
  ResourceTemplate::new(..)
- crates/mcp/src/prompts.rs: PromptMessageRole::User -> Role::User
- crates/mcp/src/lib.rs: Content::text -> ContentBlock::text

No behavior change: the MCP tool/resource/prompt surface (names, schemas,
JSON-RPC wire shape) is unaffected — only rmcp's Rust-side constructor API
moved. All 82 indexa-mcp tests pass unchanged, including the golden-contract
tests (tool_contract_golden_list, doc_tool_count_matches_code,
prompt_contract_golden_list, resources_round_trip,
prompts_round_trip_and_validate_args) that would catch a wire-format drift.

Verified locally with the exact CI commands: cargo fmt --all -- --check,
cargo clippy --all-targets --all-features --locked (-D warnings), and
cargo test --all --locked, plus the retrieval eval and web-smoke checks
from ci.yml (run under an isolated XDG_DATA_HOME/XDG_CONFIG_HOME so they
don't touch this host's real Indexa index).

Signed-off-by: Ahmed Janabi <ahmed541991@gmail.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Ahmed Janabi <ahmed541991@gmail.com>
@wikithoughts
wikithoughts merged commit 0d48741 into main Sep 24, 2026
8 checks passed
@wikithoughts
wikithoughts deleted the deps/rmcp-2.1 branch September 24, 2026 18:12
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