Catch spec drift before it catches you. Detect overlap, stale docs, and code drift.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Consistency governance for AI-native development.
Catch drifts before they catch you.
What It Catches Β· Quick Start Β· Agent Β· CI Β· Cheatsheet Β· Reference
For developers and teams where human+AI continuously produce specs, docs, and decisions that should agree β and silently stop agreeing.

Watch on asciinema for the interactive version.
Single binary. No Docker. No API keys required. One governance SQLite file plus one local Stroma snapshot.
The core shipped slice is local and CLI-first. The MCP server, CI wiring, and provider-backed semantic runtimes are optional wrappers around that same deterministic core.
You already know your docs drift. You fight it with LLM cleanup passes. The LLM says "all clean" β but it only covered what fit in the context window. The rest keeps rotting. Next PR introduces fresh contradictions on top of the ones that were never actually fixed. It's a treadmill that feels productive but never converges. Meanwhile the token costs pile up: false starts, misdirections, and wasted context directly caused by drifting issues, conflicting specs, and obsolete docs.
Pituitary replaces that treadmill with a structural guarantee: it indexes the entire corpus and checks all of it, every time. On a real repo with 11 specs and 29 docs, it found 90 deprecated-term violations across 22 artifacts and 7 semantic contradictions. The project direction was plagued by doc drifts, runtime contract contradictions, and deprecated terminology surfacing everywhere β Pituitary rescued it. Across multiple repos, it becomes the single point of truth where governance converges.
Overlapping decisions. A new spec covers ground an existing one already handles.
Stale docs. A spec changed, or a code diff implies docs likely went stale, but the CLAUDE.md, AGENTS.md, runbooks, and guides that reference it weren't updated.
Code that contradicts specs. Pipe your diff in before you merge:
Terminology drift. The team adopted new language but old terms persist across your docs and specs.
Pituitary starts as a drift detector. As your intent corpus grows, it becomes the consistency governance layer:
Temporal governance. Point-in-time queries against the governance graph. When a spec is superseded, historical governance links are preserved but excluded from current queries. Use --at DATE with check-compliance, check-doc-drift, or analyze-impact. Timestamps are derived from index build/update time.
Confidence-weighted edges. Governance links carry trust tiers β extracted (declared in spec), inferred (AST symbol matching), or ambiguous. Use --min-confidence with check-compliance and check-doc-drift to trade precision for recall.
Deliberate deviation vs accidental drift. When code contradicts a spec, Pituitary checks for rationale comments (// WHY:, // HACK:, decision language). Deliberate deviations get a different remediation path than unintentional drift.
Governance changelog. index --update --show-delta reports what changed: specs added/removed, edges created/severed, governance posture shifts. The feedback loop CI needs.
Spec families. Community detection on the dependency graph discovers natural governance clusters. Coverage gaps between families are the highest-risk ungoverned areas.
Governance protocol for AI. The optional MCP wrapper teaches your AI assistant when to check governance β before modifying files, before committing, after accepting specs, when writing docs β not just how.
| What you want to do | Command |
|---|---|
| First run on a repo | pituitary init --path . |
| Scaffold a new draft spec | pituitary new --title "Rate limiting policy" --domain api |
| Find stale docs | pituitary check-doc-drift --scope all |
| Find stale docs implicated by a diff | git diff origin/main...HEAD | pituitary check-doc-drift --diff-file - |
| Check a PR diff against specs | git diff origin/main...HEAD | pituitary check-compliance --diff-file - |
| Debug why a file is in or out of scope | pituitary explain-file PATH |
| Full spec review | pituitary review-spec --path specs/X |
| Auto-fix deterministic drift | pituitary fix --scope all --dry-run |
| Search specs by hybrid relevance | pituitary search-specs --query "rate limiting" |
| Trace impact of a spec change | pituitary analyze-impact --path specs/X |
| Compare two specs | pituitary compare-specs --path specs/A --path specs/B |
| Detect stale specs | pituitary check-spec-freshness --scope all |
| Inspect command contracts | pituitary schema review-spec --format json |
All commands output JSON with --format json. Agents can set PITUITARY_FORMAT=json, and redirected stdout defaults to JSON automatically. review-spec also supports --format markdown and --format html for shareable reports with full evidence chains.
When file selection looks wrong, start with pituitary explain-file PATH. It is the fastest way to confirm which source matched a file, which selectors fired, and why a path was rejected before you debug drift or compliance output.
One pituitary.toml can also span multiple repository roots. Bind a source to a named repo root with repo = "...", and Pituitary carries that repo identity through search, drift, impact, status, and index output so cross-repo results stay unambiguous.
pituitary status now also flags governance hotspots so you can triage the corpus quickly: specs with unusually broad applies_to fan-out, artifacts that are only weakly governed through inferred or ambiguous links, and artifacts currently governed by multiple specs.
For terminology migrations, you can keep running ad hoc audits with --term / --canonical-term, or declare reusable [[terminology.policies]] in config and run pituitary check-terminology directly. Results now separate actionable current-state violations from tolerated historical uses, support terminology-only exclude_paths for historical containers such as CHANGELOG.md, and include replacement suggestions in both text and JSON output.
analyze-impact, check-doc-drift, and review-spec now emit section-level evidence chains in JSON: source refs on both sides of the match, a classification, a link_reason, and likely edit targets or suggested bullets. That gives agents enough structure to explain the next manual edit without scraping prose or auto-editing speculative changes.
For agent integrations, use pituitary schema <command> --format json to inspect request/response contracts, and prefer --request-file PATH|- on analysis commands when shell escaping would be brittle. Results that include raw repo excerpts or evidence now carry result.content_trust metadata so callers can treat returned workspace text as untrusted input instead of executable instructions.
See the cheatsheet for every command, the full reference for configuration/runtime/spec details, the reusable multi-editor package at skills/pituitary-cli/README.md, and AGENTS.md for repo-native agent instructions.
macOS (Homebrew):
Linux / macOS (binary): download from GitHub Releases, then:
Windows: download pituitary_<version>_windows_amd64.zip from GitHub Releases, extract pituitary.exe, and add its location to your PATH.
Build from source (contributors): see docs/development/prerequisites.md.
Your agent writes specs, reviews PRs, and proposes changes β but it doesn't know what's already been decided. Pituitary gives it that context. The governance protocol teaches it when to check, not just how.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/pituitary)<a href="https://allmcps.com/mcp/pituitary"><img src="https://allmcps.com/api/badge/pituitary?style=directory" alt="Pituitary on AllMCPs" /></a>