feat: replace hand-rolled MCP transport with rmcp SDK#778
Open
skymoore wants to merge 3 commits intoRightNow-AI:mainfrom
Open
feat: replace hand-rolled MCP transport with rmcp SDK#778skymoore wants to merge 3 commits intoRightNow-AI:mainfrom
skymoore wants to merge 3 commits intoRightNow-AI:mainfrom
Conversation
Replace the custom JSON-RPC + stdio/SSE transport layer with the rmcp SDK (crate 'rmcp'). This gives us spec-compliant Streamable-HTTP transport, automatic Mcp-Session-Id tracking, SSE stream parsing, and content-type negotiation out of the box while deleting ~300 lines of hand-rolled plumbing. Key changes: - Add rmcp dependency with transport feature - Replace McpTransportHandle enum with rmcp RunningService - Replace manual JSON-RPC send_request/send_notification with rmcp client calls - Add custom HTTP headers support for authenticated remote MCP servers - Simplify tool discovery and invocation through rmcp's typed API
… positive on Linux CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mcp-Session-Idtracking, SSE stream parsing, and content-type negotiation out of the boxAuthorization, API keys, etc.)Changes
Cargo.toml/Cargo.lockrmcpdependency withtransportfeaturecrates/openfang-runtime/src/mcp.rsMcpTransportHandleenum and manual JSON-RPCsend_request/send_notificationwith rmcpRunningService<RoleClient>crates/openfang-runtime/Cargo.tomlrmcpandhttpdepscrates/openfang-types/src/config.rsheadersfield toMcpServerConfigEntrycrates/openfang-kernel/src/kernel.rsheadersthrough toMcpServerConfigin all 3 connection pathscrates/openfang-extensions/src/registry.rsheadersfor extension-generated MCP configscrates/openfang-extensions/src/bundled.rsHttptransport variant in test matchcrates/openfang-api/src/routes.rsHttptransport variant in APIcrates/openfang-extensions/src/lib.rsHttpvariant toMcpTransportTemplatecrates/openfang-cli/src/main.rsHttptransport in CLITesting
cargo build --workspace --lib- compiles cleancargo test --workspace- all tests pass (1700+)cargo clippy --workspace --all-targets -- -D warnings- zero warnings