Enforces mechanical write gates, evidence requirements, and adversarial red-teaming for AI coding agents to prevent premature workspace writes.
Also known as REX-codebase/fable-mode, fable-mode, fable-engine
- Stars
- 26
- Tools
- —
- Downloads, 30 days
- 1,182
- Latest version
- 1.3.5
- Last commit
- Sep 18, 2026
- License
- MIT
What is Fable Mode MCP?
Fable Mode enforces mechanical write gates, evidence requirements, and adversarial red-teaming for AI coding agents to prevent premature workspace writes.
Summary generated from the project's README
About Fable Mode MCP server
Fable Mode acts as a control plane for AI coding agents to prevent them from making premature changes to a workspace. Instead of relying on prompt instructions, it uses mechanical gates to ensure an agent deliberates, provides evidence, and survives adversarial testing before gaining write access. This system is designed for developers using MCP clients like Claude Code or Cursor, or for those working in shell sandboxes via JSON transport.
Users can set up the server using uvx or pip to install the fable-engine package. Once active, a session begins in a locked state where the agent must follow a specific workflow: Think, Prove, Attack, and Write. The agent must respect a defined time budget and provide tool receipts or invariants to satisfy proof requirements. A five-vector red-team swarm then attempts to break the proposed code. The server can also optionally use an external reviewer model to audit evidence through a single HTTPS call, though the mechanical gates remain the primary authority.
What you can do with it
- 1Prevent premature workspace writesForce an AI agent to undergo a time-locked deliberation period before it can modify any files.
- 2Verify agent claims with evidenceRequire the agent to produce tool receipts and invariants to prove its reasoning is correct.
- 3Audit agent evidence with AIUse an external model to review the evidence provided by the agent during a session.
Written from the project's README. Every use case is checked against a quote from it.
How to install Fable Mode MCP
Formats verified 10 Nov 2026Install Fable Mode MCP in Claude Code
$ claude mcp add fable-mode -- uvx fable-engineInstall Fable Mode MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"fable-mode": {
"command": "uvx",
"args": [
"fable-engine"
]
}
}
}Install Fable Mode MCP in VS Code
.vscode/mcp.json
{
"servers": {
"fable-mode": {
"type": "stdio",
"command": "uvx",
"args": [
"fable-engine"
]
}
}
}Install Fable Mode MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"fable-mode": {
"command": "uvx",
"args": [
"fable-engine"
]
}
}
}Install Fable Mode MCP in Codex
~/.codex/config.toml
[mcp_servers.fable-mode] command = "uvx" args = ["fable-engine"]
Install Fable Mode MCP in Gemini CLI
~/.gemini/settings.json
{
"mcpServers": {
"fable-mode": {
"command": "uvx",
"args": [
"fable-engine"
]
}
}
}Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablerex-codebase/fable-mode is public and reachablegithub.com/rex-codebase/fable-mode ↗Pass
- Package names this repository as its sourcefable-engine names rex-codebase/fable-mode as sourcepypi.org/project/fable-engine/ ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for fable-enginepypi.org/project/fable-engine/ ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-09-18github.com/rex-codebase/fable-mode ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from fable-enginePass
- No critical advisory in the package or its dependencies1 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubFable Mode
Agents that think before they write.
Fable Mode is an open-source control plane for AI coding agents.
It makes an agent deliberate, produce evidence, and survive adversarial review before it earns permission to write to your workspace. The gates are mechanical, not prompt advice: no timer, no proof, no write access.
Demo
KERR // ORRERY
One self-contained HTML file. Raw WebGL, zero libraries, zero external assets, and zero build step.
https://github.com/user-attachments/assets/8287bbfe-e3ee-4dcf-ba0f-f9ff22ae79bd
7 renders rejected before final · 2 bugs caught · 10/10 red-team probes passed
Fable Mode overview
https://github.com/user-attachments/assets/27f4f8a2-b1bb-4398-a08c-bc9fd93d69d7
Quick start
A session starts locked. Confidence does not unlock it.
- Install the MCP server using one of the options below.
- Add the optional Agent Skill if you want the full workflow.
- Ask your agent to use Fable Mode for a concrete coding task and choose a time budget.
A new session starts with execution locked:
{
"action": "create_session",
"session_name": "demo-refactor",
"objective": "Refactor the parser without changing public behavior",
"time_budget_minutes": 2
}
The agent then records evidence and an invariant. An early unlock_execution
request is rejected until the authority timer and proof prerequisites pass.
Use get_status at any point to see the active phase, remaining time, evidence
counts, and lock state.
The same gates guard every phase: evidence receipts for claims, a five-vector red-team swarm for code, and a sealed record of what was verified.
One package, two agent environments
Fable ships as one PyPI package. The same package contains the runtime, stdio MCP server, and complete Agent Skill. Setup is explicit so installing an MCP server never silently activates workspace instructions.
Run setup from the project the agent will work in:
uvx --from fable-engine==1.3.9 fable-mode setup --yes
This resolves the pinned package in an isolated uv environment and copies the
bundled skill to .agents/skills/fable-mode. Use --dry-run to preview or
--target <dir> for another skill directory. For a persistent install, use:
python -m pip install fable-engine
fable-mode setup --yes
Then choose only the invocation that matches the agent environment.
Native MCP client
Run fable-engine as the stdio server. For example:
// Claude Code: claude mcp add fable-engine -- uvx --from fable-engine==1.3.9 fable-engine
// Cursor or another JSON-configured client:
{
"mcpServers": {
"fable-engine": {
"command": "uvx",
"args": ["--from", "fable-engine==1.3.9", "fable-engine"]
}
}
}
Shell sandbox with internet, no MCP host
The same package exposes a direct JSON transport. Pipe one fable_session
argument object to fable-mode call:
printf '%s\n' '{"action":"create_session","session_name":"demo","objective":"Verify this change","time_budget_minutes":2}' \
| uvx --from fable-engine==1.3.9 fable-mode call
The command uses JSON Lines: one fable_session argument object per input line
and one JSON result per output line. Keep that process open for a full workflow so
the authority timer and session stay in the same trusted runtime. A one-line pipe
is useful for a single inspection call. Each uvx command can resolve an
isolated environment; pip install is better when the sandbox keeps a Python
environment between calls. Session data persists outside that environment in
Fable's data directory (FABLE_DATA_DIR can override it).
Python 3.10+, zero runtime dependencies. Published on PyPI as fable-engine.
Skill activation remains explicit
setup is the unified path. The older install-skill command remains as a
compatible alias for skill-only installation. Neither fable-engine nor
pip install fable-engine writes instructions into a workspace on its own.
How it works
- Think — Time-locked deliberation. The agent cannot write until the timer ends.
- Prove — Claims need real evidence (tool receipts, hashes, invariants).
- Attack — A red-team swarm tries to break the code.
- Write — Only then is the workspace unlocked.
Optional: AI evidence adjudicator
The evidence in a session is written by an AI agent, so Fable can optionally ask an external reviewer model to audit that evidence before the workspace unlocks. Stdlib-only, one bounded HTTPS call, no local model, no extra RAM to speak of. Off by default; fail-closed when enforcing. It raises the cost of fabricated proof - it cannot guarantee deception is impossible, and the mechanical gates stay the primary authority. Setup and honest limits: AI evidence adjudicator.
What it is not
- Not a claim of flawless code. It is a checkable workflow, not a guarantee.
- Not a bigger prompt. The locks are enforced by the engine, not by wording.
- Not a framework lock-in. It speaks MCP and runs beside your current agent.
Docs
- Start here: practical guide
- Agent Skill reference
- V1 → V2 migration
- V2 architecture
- System 3 (experimental)
- AI evidence adjudicator (optional)
Contributing
Issues and pull requests are welcome. See CONTRIBUTING.md.
MIT License · Built by REX
Fable Mode MCP questions
How do I add Fable Mode MCP to Claude Code?
Run claude mcp add fable-mode -- uvx fable-engine in your terminal. Add --scope user to make it available in every project.
How do I add Fable Mode MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How does Fable Mode prevent agents from writing too early?
It uses mechanical gates rather than prompt advice, including time-locked deliberation and proof prerequisites that must be met before the workspace is unlocked.
Does Fable Mode require extra RAM or local models for evidence auditing?
No, the optional AI evidence adjudicator uses a single bounded HTTPS call to an external reviewer model and requires no extra local RAM.
Is Fable Mode a guarantee of flawless code?
No, it is a checkable workflow designed to make agents more deliberate, but it does not claim to produce perfect code.
Can I use Fable Mode with my existing agent?
Yes, it is not a framework lock-in and works alongside your current agent via the Model Context Protocol.