mcpField
F
Fable Mode

Fable Mode

Local
github.com/REX-codebaseAI & Agents24Updated 6w ago

About Fable Mode

Fable Mode is an open-source control plane for AI coding agents that gates workspace writes behind timed deliberation, evidence, and adversarial review. It provides an MCP server and an optional Agent Skill, with the same package also supporting direct JSON transport.

Key features

  1. 01Time-locked deliberation before writing
  2. 02Evidence receipts and invariants
  3. 03Five-vector red-team review
  4. 04Sealed record of verification
  5. 05Optional AI evidence adjudication

Use cases

  1. 01Gate workspace writes during a coding task
  2. 02Require evidence for an agent's claims
  3. 03Red-team code before allowing changes

MCP support

Its stdio MCP server lets clients manage sessions and inspect status through tools such as `fable_session`. The package also supports direct JSON transport without an MCP host.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"rex-codebase-fable-mode": {
"command": "uvx",
"args": [
"fable-engine"
]
}
}
}
Run commanduvx fable-engine

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypifable-engine1.3.5

Tools

14

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
tagenumNoEpistemic classification tag for truth calibration.PROVEN | HYPOTHESIS | UNKNOWN
codestringNoSource code content (HTML, JSX, CSS, or TSX) to audit or validate against anti-slop gates.
namestringNoName identifier for automation pipeline spec.
treeobject|array|stringNoTree hierarchy adjacency list or nested dict for hyperbolic embedding.
claimstringNoFact, hypothesis statement, or unknown parameter to track in epistemic ledger.
edgesarray|stringNoList of directed edge dictionaries for Causal DAG construction.
gammanumberNoPolicy precision inverse temperature gamma for Active Inference softmax (default 16.0).
labelstringNoOptional label or description for compressed CAS node.
nodesarray|stringNoList of node dictionaries for Causal DAG construction.
actionenumYesThe Fable session action to perform.create_session | set_timer | get_status | telemetry | advance_phase | log_epistemic_item | record_invariant | log_refinement_cycle | unlock_execution | checkpoint_session | restore_session | list_sessions | compile_delegation_contract | compress_payload | decompress_payload | view_slice | accumulate_payload | flush_accumulator | get_compression_stats | system3_dialectical_synthesis | system3_causal_simulate | system3_evolve_paradigms | system3_induce_axioms | system3_meta_reflect | system3_tri_level_orchestrate | system3_hyperbolic_embed | system3_kripke_verify | system3_active_inference | system3_proof_oracle | track_file_change | get_session_lineage | inspect_plan | verify_proof | record_visual_mockups | validate_event_history | set_goal_rubric | evaluate_goal_rubric | get_goal_rubric | register_automation_pipeline | red_team_code_review | record_breakage_report | verify_red_team_remediation | cortical_define_lobe | cortical_list_lobes | check_auto_update | apply_auto_update | evolve_cortex | audit_anti_slop | infer_design_brief | generate_design_tokens | generate_awwwards_scaffold | validate_preflight_design | list_design_archetypes | scrape_web | scrape_youtube | scrape_reddit | scrape_x | scrape_github | scrape_arxiv
axiomsarray|stringNoList of reference axiom names or strings for proof oracle.
domainstringNoDomain boundary for the invariant or cortical plasticity consolidation.
statesarray|stringNoList of hidden state identifiers for Active Inference POMDP.
targetstringNoTarget URL, ID, subreddit, repo, paper ID, handle, or search query string for research scraping actions.
worldsarray|stringNoList of world/state definitions for Kripke structure.
actionsarray|stringNoList of control action identifiers for Active Inference POMDP.
cas_refstringNoCAS reference URI (cas://<sha256_hex>) or 64-char hash.
contentstringNoRaw text content or payload to store/compress into Content-Addressed Storage (CAS).
contextobject|stringNoHypothesis typing context dictionary {name: type} for proof oracle.
d_priorarray|stringNoPrior initial state belief distribution D for Active Inference.
formulastringNoCTL / modal formula string to verify against Kripke structure (e.g. 'AG(safe)', 'EF(goal)').
mockupsarray|stringNoList of concept dictionaries for visual mockup recording.
payloadstringNoMicro-payload text for adaptive batch accumulator or CAS storage.
root_idstringNoRoot node ID for hyperbolic tree embedding or initial world.
task_idstringNoTask identifier for cortical plasticity consolidation or session lineage.
a_matrixarray|stringNoObservation likelihood matrix A [O x S] for Active Inference.
criteriaarray|string|objectNoList of criteria pointers or JSON string of rubric items for goal score evaluation.
end_lineintegerNoEnding line number (1-indexed inclusive) for windowed line slice viewing.
evidencestringNoSource file, command output, line number, or URL supporting the claim.
metadataobjectNoOptional metadata dictionary attached to accumulated micro-payload.
policiesarray|stringNoList of candidate action sequence policies for Expected Free Energy evaluation.
archetypeenumNoHaute aesthetic archetype identifier for design tokens or scaffolding.cyber_obsidian_monolith | haute_editorial_modernism | swiss_precision_vignelli | kinetic_spatial_hud | neo_nordic_warmth | cold_chromatic_luxury
base_stepnumberNoBase geodesic step distance for hyperbolic tree embedding (default 1.0).
curvaturenumberNoSectional curvature c > 0 of Poincaré manifold (default 1.0).
dimensionintegerNoDimension of Poincaré ball manifold (default 2).
file_pathstringNoTarget file path for file change tracking or proof verification.
objectivestringNoHigh-level goal or problem statement for the reasoning session.
rationalestringNoJustification for unlocking code execution after satisfying cognitive gates.
rubric_idstringNoIdentifier of the goal rubric.
b_matricesobject|stringNoState transition matrices B [Action -> S x S] for Active Inference.
focus_areastringNoSpecific subsystem, component, algorithm, or interface being critically re-evaluated.
model_namestringNoName for the causal DAG model in System 3 simulation.
next_phaseenumNoTarget phase to advance the session into.Phase 1: Epistemic Grounding & Live Research | Phase 2: Invariant Specification & Blueprint | Phase 3: Adversarial Red-Teaming & Falsification | Phase 4: Subagent Fleet Delegation | Phase 5: Multi-Tier Verification & Gatekeeping | Phase 6: Final Walkthrough & Reporting
proof_typeenumNoDeterministic proof type.ast | receipt | file_sha256 | formal_logic | vector_coordinates
start_lineintegerNoStarting line number (1-indexed inclusive) for windowed line slice viewing.
change_typeenumNoClassification of file change.modified | created | deleted | slated
evaluationsarray|object|stringNoAlias for item_evaluations: list or dict of criterion evaluation updates.
force_flushbooleanNoForce flush buffered micro-payloads immediately into a composite frame.
generationsintegerNoNumber of evolutionary generations to run (default 3).
node_labelsobject|stringNoOptional mapping of node IDs to readable labels.
observationstringNoCurrent sensory observation for Active Inference belief updating.
target_codestringNoSource-code string input. Dynamic target execution from source-code strings is disabled and requires a separate sandboxed executor.
target_namestringNoIdentifier or name of the target module, class, or function for red-team review.
transitionsarray|object|stringNoList of transitions or adjacency dictionary for Kripke structure.
user_promptstringNoAlias for prompt: high-level design prompt describing desired web experience.
code_snippetstringNoAlternative alias for source-code string input. Dynamic target execution from source-code strings is disabled and requires a separate sandboxed executor.
diff_summarystringNoConcise summary of file changes, diff, or slated edits.
observationsarray|stringNoList of observation identifiers for Active Inference POMDP.
prior_reportobject|stringNoPrior red-team breakage report dictionary or JSON string to verify remediation against.
session_namestringNoUnique identifier / name for the Fable session.
target_scorenumberNoTarget composite goal score threshold (default 0.95, min 0.0, max 1.0).
thesis_titlestringNoTitle of the thesis paradigm for System 3 dialectical synthesis.
artifact_pathstringNoAbsolute filesystem path to blueprint artifact, proof, or benchmark script documenting the refinement.
c_preferencesarray|stringNoPrior preference distribution C over observations for Active Inference.
evaluator_cmdstringNoAlias for evaluator_command: shell command or tool invocation for candidate evaluator.
failure_countintegerNoHistorical failure count for tri-level cognitive gear arbitration.
failure_modesarray|stringNoList of adversarial failure modes identified in critique.
generator_cmdstringNoAlias for generator_command: shell command or tool invocation for candidate generator.
initial_worldstringNoInitial world ID for Kripke model checking.
interventionsobject|stringNoDictionary of Pearl's do-operator interventions: {node_id: value}.
mutation_ratenumberNoGenetic mutation rate probability (default 0.15).
phase_summarystringNoConcise summary of findings or deliverables completed in the previous phase.
pipeline_namestringNoAlternative alias for automation pipeline name.
pipeline_typestringNoType of autonomous pipeline (default 'closed_loop').
target_metricstringNoTarget KPI node ID for sensitivity and structural brittleness analysis.
contradictionsarray|stringNoList of parameter trade-offs / contradictions to resolve with TRIZ principles.
crossover_ratenumberNoGenetic crossover rate probability (default 0.80).
dials_overrideobjectNoOptional discrete dials override: variance (1-10), motion (1-10), density (1-10).
invariant_namestringNoIdentifier or title of the formal invariant (e.g., 'INV-01: Zero-Deadlock Ring Buffer').
max_iterationsintegerNoMaximum closed-loop iterations before halting (default 10).
seed_paradigmsarray|stringNoOptional list of initial paradigm definitions to seed the gene pool.
task_objectivestringNoTask objective or target outcome for goal scoring rubric.
population_sizeintegerNoPopulation size for evolutionary gene pool (default 12).
refinement_typestringNoType of rethink-refine cycle (e.g. 'archetype_exploration', 'triz_resolution', 'adversarial_falsification', 'benchmark_probe', 'failure_mode_analysis').
remediated_codestringNoRemediated source-code string input. Dynamic target execution from source-code strings is disabled and requires a separate sandboxed executor.
subagent_promptstringNoThe delegation prompt or contract text for the subagent to validate.
target_resourcestringNoTarget resource (file path, receipt ID) for proof verification.
task_complexitynumberNoTask complexity index [0.0, 1.0] for tri-level cognitive arbitration.
antithesis_titlestringNoTitle of the antithesis / adversarial critique.
broken_scenariosarray|stringNoList or JSON string of broken attack scenarios found during red-team review.
formal_statementstringNoMathematical or formal contract specification that must never be violated.
item_evaluationsarray|object|stringNoItem evaluations mapping, list, or JSON string with pointer_id, satisfied, score, evidence_receipt_id.
selected_conceptstringNoIdentifier of the selected visual concept archetype.
target_thresholdnumberNoTarget threshold score for pipeline iteration termination (default 0.95).
custom_hypothesesarray|stringNoList or JSON string of custom adversarial hypotheses / attack vectors.
evaluator_commandstringNoShell command or tool invocation for candidate evaluator.
generator_commandstringNoShell command or tool invocation for candidate generator.
max_debate_roundsintegerNoMaximum number of dialectical debate rounds for synthesis (default 4).
objective_weightsobject|stringNoOptional dictionary of weights across the 10 Pareto dimensions.
archetype_overridestringNoOptional override for Haute aesthetic archetype.
auto_log_epistemicbooleanNoWhether to automatically record retrieved research findings as a [HYPOTHESIS] candidate item in Fable Session's epistemic ledger for subsequent cross-verification.
proof_or_rationalestringNoProof sketch, rationale, or inductive argument establishing the invariant.
thesis_descriptionstringNoCore architecture description and assumptions for the thesis candidate.
affected_invariantsarray|stringNoList or string of invariant names affected by this file change.
time_budget_minutesnumberNoImmutable outer authority budget in minutes. set_timer can only change the internal pacing timer.
include_line_numbersbooleanNoWhether to format line slice with line numbers.
contradiction_densitynumberNoContradiction density index [0.0, 1.0] for cognitive gear shifting.
epistemic_uncertaintynumberNoEpistemic uncertainty index [0.0, 1.0] for arbitration.
critique_or_bottleneckstringNoCritical flaw, vulnerability, edge case, memory/latency bottleneck, or assumption scrutinized.
terminal_probe_resultsstringNoLive empirical probe output, benchmark figures, latency numbers, or profiling stats supporting the refinement.
architectural_refinementstringNoConcrete architectural evolution, optimization, or algorithm change derived from the critique.
target_residual_thresholdnumberNoTarget residual contradiction score threshold for convergence (default 0.15).

Details

From the project README

Fable Mode

Fable Mode

Agents that think before they write.


Python 3.10+   MIT   MCP   Zero Dependencies   490 tests passing





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.


Think → Prove → Attack → Write
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.

  1. Install the MCP server using one of the options below.
  2. Add the optional Agent Skill if you want the full workflow.
  3. 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"]
    }
  }
}

Install MCP server in VS Code

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
  1. Think — Time-locked deliberation. The agent cannot write until the timer ends.
  2. Prove — Claims need real evidence (tool receipts, hashes, invariants).
  3. Attack — A red-team swarm tries to break the code.
  4. 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

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md.



MIT License · Built by REX

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.