Skip to main content

Module mcp

Module mcp 

Source
Expand description

The kintsugi-exec MCP server.

Tool-calling agents (Cursor CLI, Codex CLI, Qwen Code, Gemini CLI, and any custom MCP client) that speak the Model Context Protocol can call the kintsugi-exec tool to run a shell command through Kintsugi instead of shelling out raw. Each call is normalized to a ProposedCommand, sent to the daemon, and — on allow — executed, with the command’s output returned to the agent. Every call is recorded.

Transport: newline-delimited JSON-RPC 2.0 over stdio (the MCP stdio transport). Implemented by hand to avoid pulling an MCP framework dependency.

Constants§

TOOL_NAME
Tool name agents call.

Functions§

handle_message
Handle one JSON-RPC message line. Returns the response line, or None for notifications (which get no reply).
run
Run the MCP server: read JSON-RPC lines from stdin, write responses to stdout.
run_io
The server loop over arbitrary reader/writer (testable).