Skip to main content

Crate grex_mcp

Crate grex_mcp 

Source
Expand description

grex-mcp — MCP-native server for grex (M7).

Stage 5 wires the rmcp framework: the server speaks the MCP 2025-06-18 wire protocol over any rmcp::transport (stdio in production, tokio::io::duplex in tests). The handshake + tools/list (returning empty) + transport-close shutdown are live; the 11 tool handlers land in Stage 6, and cancellation in Stage 7.

§Stdout discipline

The MCP stdio transport multiplexes only JSON-RPC bytes on stdout. All diagnostics MUST go to stderr. GrexMcpServer::run installs a tracing_subscriber::fmt writer pinned to stderr — idempotently, so test reuse and serve-from-CLI both work. The no_println_lint.rs integration test enforces zero println! / print! macros under src/ to prevent regressions.

Re-exports§

pub use error::CancelledExt;
pub use error::REQUEST_CANCELLED;
pub use tools::VERBS_EXPOSED;

Modules§

error
Error mapping from grex-core failure types to MCP error envelopes.
tools
Tool registry surface for the grex MCP server.

Structs§

GrexMcpServer
The grex MCP server. One instance per grex serve invocation; one instance per integration test. Cheap to construct; all state behind Arc so ServerHandler impls can clone onto handler tasks for free.
ServerState
Shared, immutable-after-build state every tool handler reads.