Expand description
Read-only Model Context Protocol (MCP) server for git paw mcp.
Exposes this repository’s deterministic read-only state — coordination
intents/conflicts, governance docs, specs and tasks, session status and
learnings, agent skills, and git context — over the standard MCP protocol
on stdio, so any MCP-aware client (Claude Desktop, Cursor, ChatGPT
Desktop, Windsurf, VS Code MCP) can query it.
§Module layout & dependency rule (design D2)
mcp/
├── mod.rs entry: cmd_mcp(), RepoContext + repo resolution
├── server.rs stdio transport setup, tool registry wiring, lifecycle
├── tools/ MCP tool definitions (one file per category)
└── query/ data-layer reads (no MCP types here)The dependency direction is strict and one-way:
queryknows nothing about MCP — it returns plain Rust / serde types built from broker HTTP state, files on disk, and git output.toolsknows about MCP andquery, but not aboutserver.serveronly wirestoolsonto a transport.
This keeps the future v2.0.0 HTTP transport additive: drop in a new
server.rs variant and reuse tools + query unchanged.
§Guardrails
- No agent CLI is ever spawned as an inference backend. Every tool result is derived from deterministic data sources only.
- stdout is reserved for JSON-RPC frames. All logging goes to stderr
(see
crate::mcp::server); there are noprint!/println!calls in this module tree (enforced by a unit test in this file).
Modules§
- logging
- Minimal stderr logger for the MCP server (design D5).
- query
- Data-layer reads for the MCP server.
- server
- stdio transport setup, tool-registry wiring, and lifecycle for the MCP
server. This module only wires things together (design D2): it owns no
tool logic (that lives in
crate::mcp::tools) and no data reads (those live incrate::mcp::query). - tools
- MCP tool definitions, one file per category (design D2).
Structs§
- Repo
Context - Resolved context for a single
git paw mcpinvocation, constructed once at startup and shared (read-only) by every tool.
Functions§
- cmd_mcp
- Entry point for the
git paw mcpsubcommand. - resolve_
repo - Resolves the target repository root per design D3.