Uses Jinja2 templating engine to auto-generate 13+ specialized documentation templates including architecture guides, phase plans, checklists, and research reports with security sandboxing.
Supports PostgreSQL as an enterprise storage backend for team deployments, enabling multi-user access to documentation and audit trails with bulletproof crash recovery.
Includes comprehensive test suite with 69+ functional tests covering all core functionality, performance benchmarks, and integration testing.
Built as a Python 3.11+ MCP server providing CLI tools and programmatic APIs for documentation management, template generation, and audit trail logging.
Provides zero-config SQLite storage backend for documentation and logging with atomic operations, write-ahead logging, and automatic corruption detection.
π Scribe MCP Server
Enterprise-grade documentation governance for AI-powered development β by Corta Labs
Drop-in ready β’ 13+ specialized templates β’ Zero-config SQLite β’ Production-tested
β¨ Update v2.1.1 (Diff Editor, Readable Output & ANSI Colors)
Scribe MCP 2.1.1 introduces foundational document lifecycle upgrades, including a fully automated YAML frontmatter engine with round-trip safety, canonical metadata defaults, and extensible schema support. Frontmatter is created on first edit if missing, auto-updates last_updated, and supports explicit overrides without breaking existing fields. These changes establish a metadata plane separate from document body content, enabling safe diff operations, deterministic header/TOC tooling, and template-driven document creation.
New: Enhanced Readable Output (Phase 1.5/1.6)
ANSI Color Support: Tool output now renders with colors in Claude Code/Codex - cyan boxes, green line numbers, bold titles
Green Line Numbers: Clean
1. contentformat with dot separator, matching Claude's native Read tool styleCallToolResult Fix: Workaround for Issue #9962 - returns TextContent-only for proper newline rendering
Config-Driven Colors: Enable/disable via
use_ansi_colors: truein.scribe/config/scribe.yaml5-Char Line Padding: Consistent line number width for improved readability
Structured edits are now the default path: agents express intent, the server compiles and applies deterministic mutations, and diagnostics remain explicit. Structural actions no longer auto-heal doc targets; if a doc key is not registered, the action fails with DOC_NOT_FOUND rather than redirecting the write.
manage_docsnow supports apply_patch (structured by default) and replace_range for precise edits.apply_patchsupportseditpayloads in structured mode;patch_mode="unified"opts into raw unified diffs.patch_source_hashenforces stale-source protection for patches.Reminder system teaches scaffold-only
replace_section, preferring structured/line edits.New doc lifecycle actions:
normalize_headers,generate_toc,create_doc,validate_crosslinks.create_docbuilds documents from content/body/snippets/sections; users do not supply Jinja. Multiline bodies are preserved. Usemetadata.register_doc=trueonly when you want the new doc added to the project registry.validate_crosslinksis read-only diagnostics (no write, no doc_updates log).normalize_headerssupports ATX headers with or without space and Setext (====/----), skipping fenced code blocks. Output is canonical ATX.generate_tocuses GitHub-style anchors (NFKD normalization, ASCII folding, emoji removal, punctuation collapse, de-duped suffixes).Structural actions validate doc keys against the registry and fail hard on unknown docs (no silent redirects).
read_filetool provides repo-scoped file reads with scan/chunk/page/search modes and provenance logging.scribe_doctorreports repo root, config, plugin status, and vector readiness for faster diagnostics.manage_docsnow supports semantic search viaaction="search"withsearch_mode="semantic", including doc/log separation anddoc_k/log_koverrides.Vector indexing now prefers registry-managed docs only; log/rotated-log files are excluded from doc indexing.
Reindex supports
--rebuild(clear index),--safe(low-thread fallback), and--wait-for-drainto block until embeddings are written.
Example (structured default):
Example (unified diff mode, compiler output only):
π Why Scribe MCP?
Scribe transforms how AI agents and developers maintain project documentation. Instead of scattered notes and outdated docs, Scribe provides bulletproof audit trails, automated template generation, and cross-project intelligence that keeps your entire development ecosystem in sync.
Perfect for:
π€ AI Agent Teams - Structured workflows and quality grading
π’ Enterprise Teams - Audit trails and compliance documentation
π¨βπ» Solo Developers - Automatic documentation that actually works
π Research Projects - Structured logs and reproducible reports
Immediate Value:
β 30-second setup - Drop into any repository and start logging
π― 18+ specialized templates - From architecture guides to bug reports
π Cross-project search - Find patterns across your entire codebase
π Agent report cards - Performance grading for AI workflows
π‘οΈ Bulletproof storage - Atomic operations with crash recovery
β‘ Quick Start
Get Scribe running in under 60 seconds (MCP-first, CLI optional):
1οΈβ£ Install Dependencies
2οΈβ£ Add Scribe MCP Server to Claude Code, Codex
Codex CLI registration example:
codex mcp add scribe \ --env SCRIBE_STORAGE_BACKEND=sqlite \ -- bash -lc 'cd /home/path/to/scribe_mcp && exec python -m server'Claude Code registration example:
claude mcp add scribe \ --env SCRIBE_STORAGE_BACKEND=sqlite \ -- bash -lc 'cd /home/path/to/scribe_mcp && exec python -m server'For Global MCP
claude mcp add scribe --scope user --env SCRIBE_STORAGE_BACKEND=sqlite -- bash -lc 'cd /home/path/to/scribe_mcp && exec python -m server'
Once connected from Claude / Codex MCP:
Use
set_projectto register/select a project and bootstrap dev_plan docs (passroot=/abs/path/to/repoto work in any repo).Use
append_entryfor all logging (single/bulk).Use
manage_docsfor architecture/phase/checklist updates. 2.1.1 introduces diff edits.Use
read_filefor safe, auditable file reads (scan/chunk/page/search).Use
scribe_doctorfor readiness checks (repo root, config, vector index status).Use
read_recentto resume context after compaction.
Automatic log routing (BUG / SECURITY)
status=bug(or a bug emoji) will also write toBUG_LOG.mdwhen required meta is present (severity,component,status).Security events can also tee to
SECURITY_LOG.md(example: use a security emoji, or--meta security_event=true,impact=...,status=...).If required meta is missing, Scribe returns a teaching reminder instead of inventing data.
3οΈβ£ (Optional) Manual CLI Logging
For shell workflows or quick one-off logs, you can call the MCP-aligned CLI:
Under the hood this uses set_project + append_entry, so manual usage stays in sync with the registry, SQLite mirror, and reminder system.
π― Try These Examples
Project Management:
Research Workflows:
Team Collaboration:
π οΈ Installation Options
Prerequisites
Python 3.11+ - Modern Python with async support
pip - Standard Python package manager
Optional: PostgreSQL for team deployments (SQLite works out of the box)
Storage Backends
ποΈ SQLite (Default - Zero Config)
Perfect for solo developers and small teams
No setup required - just run and go
Automatic database creation and management
π PostgreSQL (Enterprise)
Ideal for large teams and production deployments
Set environment variables before starting:
export SCRIBE_STORAGE_BACKEND=postgres export SCRIBE_DB_URL=postgresql://user:pass@host:port/database
MCP Integration
In all examples below, REPO_ROOT means the directory that contains the
scribe_mcp package (i.e., where scribe_mcp/server.py lives). In your
personal setup this might be .../MCP_SPINE, but in the public repo it will
typically just be the cloned scribe_mcp directory.
For Claude Desktop (JSON config):
For Codex / Claude Code CLI:
Notes:
We intentionally do not bake a per-repo root into the MCP config. Scribe is multi-repo: switch repos by calling
set_project(name=..., root=/abs/path/to/repo)(no MCP re-register needed).The same
bash -lc "cd REPO_ROOT && python -m scribe_mcp.server"pattern works for any MCP client that expects a stdio server command.
π Using Scribe Outside This Repo
You can run Scribe from any codebase (not just MCP_SPINE) by pointing it at that projectβs root:
Start the MCP server from the Scribe codebase (once), then use
set_project(..., root=/abs/path/to/your/repo)to target any repository.Optional env vars:
SCRIBE_STATE_PATH=/abs/path/to/state.json(per-user; must be writable)SCRIBE_STORAGE_BACKEND=postgresandSCRIBE_DB_URL=postgresql://...if you want Postgres.
Ensure
PYTHONPATHincludes the parent ofscribe_mcpso imports work when launched from elsewhere.
π§ Project Registry & Lifecycle (High-Level)
Scribe includes a SQLite-backed Project Registry that tracks every projectβs lifecycle and documentation state:
Lifecycle states:
planning,in_progress,blocked,complete,archived,abandoned.Core hooks:
set_projectβ bootstraps docs (ARCHITECTURE_GUIDE,PHASE_PLAN,CHECKLIST,PROGRESS_LOG) and ensures a registry row exists.append_entryβ writes progress logs, updates activity metrics, and can autoβpromoteplanningβin_progressonce docs + first entry exist.manage_docsβ applies atomic doc updates and records baseline/current hashes and docβhygiene flags in the registry.list_projectsβ surfaces registry data (status, timestamps, counts, tags,meta.activity,meta.docs.flags) with filters likestatus,tags, andorder_by.
At a glance, you can:
See which projects are fresh, stale, or long inactive.
Detect when architecture/phase/checklist docs are still at template state.
Spot drift between implementation logs and documentation.
For full technical details, see docs/whitepapers/scribe_mcp_whitepaper.md.
π License & Commercial Use
Scribe MCP is source-available and free to use for:
Individual developers
Open-source contributors
Researchers and educational use
Small teams and small businesses that:
Have fewer than 25 employees, and
Generate less than $1,000,000 USD in annual revenue, and
Are not selling, hosting, or packaging Scribe MCP (or derivatives) as part of a paid product or service.
You may not use Scribe MCP under the community license if:
Your organization exceeds the employee or revenue limits above, or
You embed Scribe MCP into a paid SaaS, internal platform, or commercial agent/orchestration product.
For enterprise or large-scale commercial use, contact licensing@cortalabs.com to obtain a commercial license.
Details:
Current code is licensed under the Scribe MCP License (Community + Small Business License) in
LICENSE.Earlier snapshots were MIT-licensed; see
LICENSE_HISTORY.mdfor historical licensing context.
Notes:
.envis auto-loaded on startup when present (via python-dotenv); shell exports/direnv still work the same.Overlap checks only block true path collisions (same progress_log/docs_dir). Sharing one repo root with many dev_plan folders is supported.
π¨ Template System Showcase
Scribe includes 13+ specialized templates that auto-generate professional documentation:
π Document Templates
π Architecture Guides - System design and technical blueprints
π Phase Plans - Development roadmaps with milestones
β Checklists - Verification ledgers with acceptance criteria
π¬ Research Reports - Structured investigation documentation
π Bug Reports - Automated issue tracking with indexing
π Agent Report Cards - Performance grading and quality metrics
π Progress Logs - Append-only audit trails with UTC timestamps
π Security Logs - Compliance and security event tracking
π Template Features
π Security Sandboxing - Jinja2 templates run in restricted environments
π Template Inheritance - Create custom template families
π― Smart Discovery - Project β Repository β Built-in template hierarchy (precedence:
.scribe/templatesβ repo custom β project templates β packs β built-ins)β‘ Atomic Generation - Bulletproof template creation with integrity verification
For a deeper dive into available variables and expected metadata per template, see docs/TEMPLATE_VARIABLES.md.
Example: Generate Architecture Guide
π» CLI Power Tools
Scribe's command-line interface (386 lines of pure functionality) gives you complete control:
π― Core Commands
π¨ Rich Features
π Emoji Support - Built-in emoji mapping for all status types
π Metadata Tracking - Rich key=value metadata for organization
π Multiple Log Types - Progress, bugs, security, and custom logs
π Timestamp Control - Override timestamps for bulk imports
π― Project Discovery - Automatic project configuration detection
Status Types & Emojis
infoβΉοΈ - General information and updatessuccessβ - Completed tasks and achievementswarnβ οΈ - Warning messages and cautionserrorβ - Errors and failuresbugπ - Bug reports and issuesplanπ - Planning and roadmap entries
π Enterprise Features
π Agent Report Cards
Performance grading infrastructure for AI workflows:
Quality metrics tracking and trend analysis
Performance levels with UPSERT operations
Automated agent evaluation and reporting
π Security & Compliance
π‘οΈ Security Sandboxing - Restricted Jinja2 environments with 22+ built-in controls
π Audit Trails - Complete change tracking with metadata
π Access Control - Path validation and input sanitization
π Compliance Reporting - Structured logs for regulatory requirements
β‘ Advanced Search
Phase 4 Enhanced Search capabilities:
π Cross-Project Validation - Find patterns across your entire codebase
π Relevance Scoring - 0.0-1.0 quality filtering
π― Code Reference Verification - Validate referenced code exists
π Temporal Filtering - Search by time ranges ("last_30d", "last_7d")
πΎ Bulletproof Storage
ποΈ Multi-Backend Support - SQLite (zero-config) + PostgreSQL (enterprise)
β‘ Atomic Operations - Temp-file-then-rename with fsync guarantees
π Write-Ahead Logging - Bulletproof crash recovery with journaling
β Integrity Verification - Automatic corruption detection and recovery
π§ Intelligent Reminders
Scribe keeps your documentation in sync with intelligent context awareness:
π Smart Reminders
Every MCP tool response includes contextual reminders about:
π Stale Documentation - When architecture docs need updates
β° Overdue Logs - Gentle nudges to maintain progress tracking
π― Project Context - Active project status and recent activity
π Drift Detection - When implementation deviates from plans
Reminders are throttled with a short cooldown per (repo_root, agent_id) so you see what matters without constant repetition. If an agent gets confused, you can clear cooldowns with set_project(reset_reminders=true).
If you call a project-bound tool without selecting a project, Scribe returns a βlast known projectβ hint (including last access time) to help you recover quickly.
βοΈ Customization
π Environment Variables
SCRIBE_REMINDER_IDLE_MINUTES- Work session reset timeout (default: 45)SCRIBE_REMINDER_WARMUP_MINUTES- Grace period after resuming (default: 5)SCRIBE_REMINDER_DEFAULTS- JSON configuration for all projectsSCRIBE_REMINDER_CACHE_PATH- Optional path for reminder cooldown cache (default:data/reminder_cooldowns.json)
ποΈ Project Structure
Per-repo output location (dev plans + logs)
Default:
<repo>/.scribe/docs/dev_plans/<project_slug>/...Back-compat: if
<repo>/docs/dev_plans/<project_slug>exists, Scribe keeps using it.Override: set
SCRIBE_DEV_PLANS_BASE(example:docs/dev_plans) to force a different base.
π§ͺ Testing & Quality
Comprehensive testing infrastructure with 79+ test files:
π§ͺ Run Tests
β Quality Assurance
π¬ Functional Testing - 69 comprehensive tests covering all core functionality
β‘ Performance Testing - Optimized benchmarks for file operations
π‘οΈ Security Testing - Template sandboxing and access control validation
π Integration Testing - MCP server protocol compliance verification
π Smoke Test
π‘ Real-World Use Cases
π€ AI Agent Teams
Structured workflows for AI development:
π’ Enterprise Documentation
Compliance and audit trails:
π Research Projects
Structured research documentation:
π§ Troubleshooting
Common Issues & Solutions
π¨ MCP SDK Missing
π§ No Tools Returned
ποΈ SQLite Permission Issues
π Python Path Issues
β‘ Server Not Starting
Getting Help
π Documentation: Check
docs/whitepapers/scribe_mcp_whitepaper.mdfor comprehensive technical detailsπ§ͺ Test Suite: Run
pytestto verify system functionalityπ Project Templates: Use
--list-projectsto see available configurationsπ Smoke Test: Run
python scripts/test_mcp_server.pyfor MCP validation
π€ Contributing
We welcome contributions! Here's how to get started:
π§ͺ Development Workflow
π Development Guidelines
β Test Coverage: All new features must include tests
π Documentation: Update relevant documentation sections
π§ Integration: Ensure MCP server compatibility
π‘οΈ Security: Follow security best practices for templates and inputs
π Quality Standards
π§ͺ 69+ functional tests must pass
β‘ Performance benchmarks for file operations
π Security validation for template sandboxing
π MCP protocol compliance verification
π Further Reading
π Technical Documentation
π Whitepaper v2.1 - Comprehensive technical architecture
π§ API Reference - Complete MCP tool documentation
π¨ Template Guide - Custom template development
ποΈ Architecture Patterns - System design and integration
π Advanced Features
π€ Claude Code Integration - Structured workflows and subagent coordination
π Agent Report Cards - Performance grading and quality metrics
π Vector Search - FAISS integration for semantic search
π Security Framework - Comprehensive access control and audit trails
π Production Deployment
π PostgreSQL Setup - Enterprise-scale deployment guide
π Monitoring - Performance tracking and alerting
π Backup & Recovery - Data protection strategies
π Multi-tenant - Organizational deployment patterns
π Acknowledgments
Built with passion for better documentation and AI-human collaboration. Special thanks to:
The MCP protocol team for the standardized AI tool interface
Jinja2 for the powerful and secure templating system
Our early adopters for invaluable feedback and feature suggestions
π Ready to transform your documentation?
Start Logging β’ Explore Templates β’ Read Whitepaper
Join thousands of developers and AI teams using Scribe for bulletproof documentation governance