Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

  • Upgrade tower-mcp from 0.2.3 to 0.3.4
  • Migrate all 68 MCP tools to new axum-inspired extractor API (State<T> + Json<T>)
  • Update prompts/resources to use .build() pattern
  • Fix integration tests for new CallToolResult API

Changes

The new tower-mcp 0.3.4 introduces a breaking change to the tool handler API:

Before:

.handler_with_state(state, |state, input: T| async move {...})

After:

.extractor_handler_typed::<_, _, _, T>(
    state,
    |State(state): State<Arc<AppState>>, Json(input): Json<T>| async move {...},
)

Files changed

  • crates/redisctl-mcp/Cargo.toml - version bump
  • crates/redisctl-mcp/src/tools/cloud.rs - 18 tools migrated
  • crates/redisctl-mcp/src/tools/enterprise.rs - 25 tools migrated
  • crates/redisctl-mcp/src/tools/redis.rs - 18 tools migrated
  • crates/redisctl-mcp/src/tools/profile.rs - 7 tools migrated
  • crates/redisctl-mcp/src/prompts.rs - added .build() calls
  • crates/redisctl-mcp/src/resources.rs - added .build() calls
  • crates/redisctl-mcp/src/state.rs - test helper visibility fix
  • Integration tests updated for new API

Test plan

  • cargo fmt --all -- --check
  • cargo clippy -p redisctl-mcp --all-targets --all-features -- -D warnings
  • cargo test -p redisctl-mcp --lib (27 tests)
  • cargo test -p redisctl-mcp --all-targets (75 tests total)

@joshrotenberg joshrotenberg force-pushed the feat/tower-mcp-0.3.4-upgrade branch from 07ba4ee to 9a37549 Compare February 3, 2026 22:22
Migrate all 68 MCP tools from the deprecated `handler_with_state` pattern
to the new axum-inspired extractor pattern using `State<T>` and `Json<T>`.

Changes:
- Update tower-mcp dependency from 0.2.3 to 0.3.4
- Migrate all tool handlers to use `extractor_handler_typed`
- Add `.build()` calls to PromptBuilder and ResourceBuilder chains
- Update integration test helpers for new CallToolResult API
- Remove cfg guard from AppState test helpers for better test ergonomics

Tool migration pattern:
  Before: .handler_with_state(state, |state, input: T| async move {...})
  After:  .extractor_handler_typed::<_, _, _, T>(
            state,
            |State(state): State<Arc<AppState>>, Json(input): Json<T>| async move {...},
          )
@joshrotenberg joshrotenberg force-pushed the feat/tower-mcp-0.3.4-upgrade branch 3 times, most recently from c30b146 to ea0c534 Compare February 3, 2026 22:34
@joshrotenberg joshrotenberg force-pushed the feat/tower-mcp-0.3.4-upgrade branch from ea0c534 to 38e9ae7 Compare February 3, 2026 22:34
Same fix as for cargo-audit - the install-action is failing with
"requires bash" error.
Fix integer overflow vulnerability in BytesMut::reserve.
@joshrotenberg joshrotenberg merged commit 3b09f8c into main Feb 3, 2026
19 checks passed
@joshrotenberg joshrotenberg deleted the feat/tower-mcp-0.3.4-upgrade branch February 3, 2026 23:14
@joshrotenberg joshrotenberg mentioned this pull request Feb 3, 2026
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