greentic-mcp-client
Client for MCP servers over JSON-RPC 2.0 (protocol 2025-06-18), via two
native transports:
- HTTP — remote servers over Streamable HTTP / SSE (
McpHttpClient). - stdio — local subprocess servers over newline-delimited JSON-RPC on the
child's stdin/stdout (
McpStdioClient).
Not to be confused with
greentic-mcp(greentic-mcp-exec), which loads and executeswasix:mcpWASM components locally. This crate is the network-client side.
Layout
proto— sans-io protocol core: request builders, SSE-aware response parsing, tool mapping. Compiles forwasm32-wasip2(default-features = false).client— native transports (featurenative, default), both exposing the sharedMcpClientshape (initialize/list_tools/call_tool):McpHttpClient— reqwest transport,Mcp-Session-Idthreading, configurable auth header.McpStdioClient— tokio-process transport; spawns a local MCP server and frames messages as line-delimited JSON. The child is killed on drop.
Usage (native, HTTP)
use ;
use Url;
let mut client = new?;
let info = client.initialize.await?;
let tools = client.list_tools.await?;
let out = client.call_tool.await?;
Usage (native, stdio)
use ;
let mut client = spawn?;
let info = client.initialize.await?;
let tools = client.list_tools.await?;
let out = client.call_tool.await?;
Usage (wasm extension)
= { = "1.2", = false }
Use the proto builders/parsers with your host's HTTP imports.
Consumers
greentic-designer-admin— tenant MCP-server test-connection endpointgreentic-designer— flow-prompt MCP tool source (planned)greentic-aw-runtime— agentic-worker MCP tool dispatch (planned)component-github-mcp-ext— proto layer inside the WASM extension (planned refactor)