Open Code Review (OCR) — MCP client

docs / modules / mcp

← all docs

Open Code Review (OCR) — MCP client

flowchart LR IN["Input\nuser-configured MCP server definitions"] --> ACT["MCP client\nLets a review extend its available tools with external MCP servers, without the model ever seeing a difference from a built-in tool."] ACT --> OUT["Output\ntool.Provider adapters registered into the same Registry as built-in tools"]

Lets a review extend its available tools with external MCP servers, without the model ever seeing a difference from a built-in tool. Package: internal/mcp/.

What flows through it

flowchart LR IN["user-configured MCP server definitions"] --> MOD["MCP client"] MOD --> OUT["tool.Provider adapters registered into the same Registry as built-in tools"]

Technical details

Package: internal/mcp/ Depends on: llm, tool Depended on by: CLI, LLM transport

What actually happens here

client.go manages the MCP session (stdio transport, per client_test.go/stdio_test.go). provider.go's RegisterAll copies each MCP tool into the shared tool.Registry as a Provider whose Execute calls client.CallTool, after checking two collision rules: a tool name can't shadow a built-in (tool.IsReserved) and can't shadow an already-registered tool — either logs a warning and skips rather than silently overriding.

How the LLM / model version is chosen

No model calls in this package — it is pure protocol/adapter plumbing between MCP servers and the tool.Registry.

Deterministic (non-LLM) work in this module

Tool-name collision resolution and JSON-schema-to-llm.ToolDef conversion (ToToolDef) are fully deterministic.


Part of the module docs index. Full interactive version, with every module side by side: architecture.html §7. Cross-cutting mechanisms this module participates in (retry, compression, manifest, resume, hashing): LLD.