SpecForge — Claude Code MCP server: what it does, how to install
Converts team rules into deterministic compiler checks for AI coding agents, preventing skipped invariants and broken references.
Open on GitHubWhat SpecForge does
Agents often overlook instructions buried in Markdown documents or PRDs. SpecForge replaces loose text files with structured .spec definitions. The coding assistant drafts models, behaviors, and invariants, which the engine evaluates just like a code compiler.
Verification runs without any neural network, ensuring identical output on every execution. The CLI flags broken links, missing guarantees, and orphan events using distinct diagnostic codes like E003 or W007. Every diagnostic points directly to the offending line with an actionable suggestion.
After defining expectations, the workflow links test execution to stated contracts through specforge collect. You inspect proven criteria instead of auditing thousands of generated lines.
What it helps with
- validate references and events across
.specdefinitions - catch contract omissions and typos before code generation
- map automated unit tests directly to architectural rules
- block agent progress when mandatory invariant fields are missing
Example prompts for the agent
- Draft the payment logic in
spec/refund.specand runspecforge check - Resolve error E003 reported in
spec/hello.specbased on the validator tip - Collect contract verification results from unit tests with
specforge collect
How to install SpecForge
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about SpecForge
How to install SpecForge in Claude Code?
Run curl -fsSL https://raw.githubusercontent.com/leaderiop/SpecForge/main/install.sh | sh in your terminal, then set up the workspace via specforge init --extensions @specforge/software.
What does SpecForge do?
It acts as a deterministic type checker for system requirements written in .spec files. The tool checks that every invariant, behavior, and emitted event remains linked and verified.
How does SpecForge differ from Markdown specs?
Natural language prompts can be skipped or misconstrued during long coding sessions. SpecForge fails the check deterministically if an invariant lacks enforcement or references an invalid event.