Skip to main content

Module mcp

Module mcp 

Source
Expand description

MCP servers’ tools, under speccoder’s policy.

[mcp.<name>] in speccoder.toml names a stdio server (command) and, optionally, tools to allow without approval or to deny. For each run speccoder starts the servers in the worktree with a scrubbed environment, lists their tools and offers them to the model as mcp__<server>__<tool> with strict schemas. speccoder cannot know what an MCP tool does, so a call needs approval unless allowed — and whatever it writes in the worktree is still seen by the diff, the integrity audit and the verifier. The discovered tools ride in the attempt’s journaled input.

Structs§

Connected
Running servers and their tools.
McpTool
A tool as offered to the model (journaled with each attempt).
ServerConfig
One configured server.

Constants§

PREFIX
The prefix of an MCP tool’s name as the model sees it.
REVIEWED
Where the digests of reviewed tools are kept, in the project’s state directory.

Functions§

connect
Starts every configured server in cwd and lists its tools; a server that fails is reported, not fatal.
mark_reviewed
Records that a person approved a call of tool (re-reviewed as it is now).
parse
Reads [mcp.<name>] sections.
pin_reviewed
Holds allowed tools to what a person reviewed: the first time an allowed tool is seen its digest is recorded; when a server later changes it — description, schema or annotations — the tool needs approval again and a notice says so. approved are the tools a person approved for this task since (speccoder task approve), which re-reviews them.