mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-03 15:24:47 +08:00
Establish stdio JSON-RPC framing for MCP initialization
The runtime already knew how to spawn stdio MCP processes, but it still needed transport primitives for framed JSON-RPC exchange. This change adds minimal request/response types, line and frame helpers on the stdio wrapper, and an initialize roundtrip helper so later MCP client slices can build on a real transport foundation instead of raw byte plumbing. Constraint: Keep the slice small and limited to stdio transport foundations Constraint: Must verify framed request write and typed response parsing with a fake MCP process Rejected: Introduce a broader MCP session layer now | would expand the slice beyond transport framing Rejected: Leave JSON-RPC as untyped serde_json::Value only | weakens initialize roundtrip guarantees Confidence: high Scope-risk: narrow Reversibility: clean Directive: Preserve the camelCase MCP initialize field mapping when layering richer protocol support on top Tested: cargo fmt --all --manifest-path rust/Cargo.toml Tested: cargo clippy -p runtime --all-targets --manifest-path rust/Cargo.toml -- -D warnings Tested: cargo test -p runtime --manifest-path rust/Cargo.toml Not-tested: Integration against a real external MCP server process
This commit is contained in:
@@ -44,6 +44,11 @@ pub use mcp_client::{
|
||||
McpClaudeAiProxyTransport, McpClientAuth, McpClientBootstrap, McpClientTransport,
|
||||
McpRemoteTransport, McpSdkTransport, McpStdioTransport,
|
||||
};
|
||||
pub use mcp_stdio::{
|
||||
spawn_mcp_stdio_process, JsonRpcError, JsonRpcId, JsonRpcRequest, JsonRpcResponse,
|
||||
McpInitializeClientInfo, McpInitializeParams, McpInitializeResult, McpInitializeServerInfo,
|
||||
McpStdioProcess,
|
||||
};
|
||||
pub use oauth::{
|
||||
code_challenge_s256, generate_pkce_pair, generate_state, loopback_redirect_uri,
|
||||
OAuthAuthorizationRequest, OAuthRefreshRequest, OAuthTokenExchangeRequest, OAuthTokenSet,
|
||||
|
||||
Reference in New Issue
Block a user