Skip to main content

Module mcp

Module mcp 

Source
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:

  • query knows nothing about MCP — it returns plain Rust / serde types built from broker HTTP state, files on disk, and git output.
  • tools knows about MCP and query, but not about server.
  • server only wires tools onto 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 no print!/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 in crate::mcp::query).
tools
MCP tool definitions, one file per category (design D2).

Structs§

RepoContext
Resolved context for a single git paw mcp invocation, constructed once at startup and shared (read-only) by every tool.

Functions§

cmd_mcp
Entry point for the git paw mcp subcommand.
resolve_repo
Resolves the target repository root per design D3.