Skip to content

feat(turbomcp): full rmcp parity with TurboMcpClientHandler, auto-updating tools, and integration tests#1463

Closed
nicholasjpaterno wants to merge 3 commits into0xPlaygrounds:mainfrom
nicholasjpaterno:feat/turbomcp-v3
Closed

feat(turbomcp): full rmcp parity with TurboMcpClientHandler, auto-updating tools, and integration tests#1463
nicholasjpaterno wants to merge 3 commits into0xPlaygrounds:mainfrom
nicholasjpaterno:feat/turbomcp-v3

Conversation

@nicholasjpaterno
Copy link
Copy Markdown

@nicholasjpaterno nicholasjpaterno commented Mar 5, 2026

Summary

  • Adds TurboMcpClientHandler<T> for automatic tool registration with ToolServer, including notifications/tools/list_changed auto-refresh (matching rmcp's McpClientHandler)
  • Extracts turbomcp integration from inline module to tool/turbomcp.rs with full module documentation
  • Fixes resource content rendering to include MIME type and content body (was discarding both)
  • Adds TurboMcpClientError with 3 typed variants preserving original errors
  • Expands example to full lifecycle: in-process server + ToolServer + auto-updating handler
  • Bumps turbomcp dependency to 3.0.11 (adds notify_client(), trigger_tool_list_changed(), has_tool_list_changed_handler())
  • 23 total tests: 19 unit (mock-based) + 4 integration (channel transport, real protocol path)

Changes

File Description
Cargo.toml Add [patch.crates-io] for local turbomcp development
rig-core/Cargo.toml Bump turbomcp deps to 3.0.11, add channel feature to server dev-dep
rig-core/src/tool/turbomcp.rs New fileTurboMcpClientHandler, ToolRefreshHandler, TurboMcpClientError, TurboMcpTool, TurboMcpToolCaller, 23 tests
rig-core/src/tool/mod.rs Replace inline module with file module reference, remove old tests
rig-core/examples/turbomcp.rs Full lifecycle example with in-process server and auto-updating tools

Parity with rmcp

Capability rmcp turbomcp
McpTool / TurboMcpTool (ToolDyn adapter) Yes Yes
McpClientHandler / TurboMcpClientHandler (auto-updating) Yes Yes
McpClientError / TurboMcpClientError (typed errors) Yes Yes
ToolServer integration Yes Yes
AgentBuilder methods Yes Yes
Content types: text, image, audio, resource, resource link Yes Yes + ToolUse, ToolResult
Resource rendering with MIME type Yes Yes
Integration tests with in-process server Yes (duplex) Yes (channel)
Type-erased client (TurboMcpToolCaller trait) N/A (rmcp uses ServerSink) Yes

Test plan

  • cargo test -p rig-core --lib --features turbomcp — 23 turbomcp tests pass (19 unit + 4 integration)
  • cargo check -p rig-core --features turbomcp --example turbomcp — compiles clean
  • CI validation

@nicholasjpaterno
Copy link
Copy Markdown
Author

Addresses #750 finally 😅

@nicholasjpaterno nicholasjpaterno force-pushed the feat/turbomcp-v3 branch 2 times, most recently from 3fcdfa7 to 5d27860 Compare March 6, 2026 12:46
@nicholasjpaterno
Copy link
Copy Markdown
Author

nicholasjpaterno commented Mar 6, 2026

TurboMCP is now the fastest MCP library available! https://x.com/RealEpistates/status/2029559190587396451

@nicholasjpaterno nicholasjpaterno mentioned this pull request Mar 9, 2026
1 task
Add TurboMCP as a feature-gated MCP client integration, matching
the existing rmcp integration pattern with full feature parity.

- TurboMcpTool and TurboMcpToolCaller trait for type-erased transport
- Content block handling (text, image, audio, resource, tool use/result)
- AgentBuilder methods: turbomcp_tool(), turbomcp_tools()
- ToolServer::turbomcp_tool() method
- 17 comprehensive tests with MockToolCaller
- Example demonstrating OpenAI agent with TurboMCP tools
… full rmcp parity

- Extract inline turbomcp module to tool/turbomcp.rs with module docs
- Add TurboMcpClientHandler<T> for ToolServer auto-registration with
  notifications/tools/list_changed support via ToolRefreshHandler
- Add TurboMcpClientError with ConnectionError, ToolFetchError,
  ToolServerError variants preserving original error types
- Fix resource content rendering to include MIME type and content body
- Add partial-registration rollback in connect() on failure
- Expand example to full lifecycle: in-process server + ToolServer +
  TurboMcpClientHandler auto-updating pattern
- Add 4 integration tests using channel transport (real protocol path)
- Add 2 new resource rendering tests (with/without MIME type)
- Bump turbomcp dependency to 3.0.11
- Add [patch.crates-io] for local development
@nicholasjpaterno nicholasjpaterno changed the title feat: add TurboMCP v3 integration as alternative to rmcp feat(turbomcp): full rmcp parity with TurboMcpClientHandler, auto-updating tools, and integration tests Apr 2, 2026
@gold-silver-copper
Copy link
Copy Markdown
Contributor

Hey there, we appreciate your effort in this contribution, but after further discussion with the team, we have decided that at the moment, adding turbomcp as a dependency is not something we want for rig. In the future we might abstract the mcp layer so as to make it easier to plug in different mcp backends, but that is low priority right now, as we are focusing on other things.

We appreciate your understanding, and sorry for any time wasted on your part 🙏

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.

2 participants