Skip to content

feat: replace hand-rolled MCP transport with rmcp SDK#778

Open
skymoore wants to merge 3 commits intoRightNow-AI:mainfrom
BaseDatum:feat/rmcp-protocol
Open

feat: replace hand-rolled MCP transport with rmcp SDK#778
skymoore wants to merge 3 commits intoRightNow-AI:mainfrom
BaseDatum:feat/rmcp-protocol

Conversation

@skymoore
Copy link
Contributor

Summary

  • Replace the custom JSON-RPC + stdio/SSE transport layer with the rmcp SDK, deleting ~300 lines of hand-rolled plumbing
  • Adds spec-compliant Streamable HTTP transport with automatic Mcp-Session-Id tracking, SSE stream parsing, and content-type negotiation out of the box
  • Adds configurable custom HTTP headers for authenticated remote MCP servers (Authorization, API keys, etc.)

Changes

File Change
Cargo.toml / Cargo.lock Add rmcp dependency with transport feature
crates/openfang-runtime/src/mcp.rs Replace McpTransportHandle enum and manual JSON-RPC send_request/send_notification with rmcp RunningService<RoleClient>
crates/openfang-runtime/Cargo.toml Add rmcp and http deps
crates/openfang-types/src/config.rs Add headers field to McpServerConfigEntry
crates/openfang-kernel/src/kernel.rs Wire headers through to McpServerConfig in all 3 connection paths
crates/openfang-extensions/src/registry.rs Default headers for extension-generated MCP configs
crates/openfang-extensions/src/bundled.rs Handle Http transport variant in test match
crates/openfang-api/src/routes.rs Expose new Http transport variant in API
crates/openfang-extensions/src/lib.rs Add Http variant to McpTransportTemplate
crates/openfang-cli/src/main.rs Handle Http transport in CLI

Testing

  • cargo build --workspace --lib - compiles clean
  • cargo test --workspace - all tests pass (1700+)
  • cargo clippy --workspace --all-targets -- -D warnings - zero warnings

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
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