State replay and self-debugging for AI agents. Track, replay, undo, checkpoint.
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.
Give AI agents the ability to remember, replay, and undo their actions.
Agent Infrastructure | Memory Layer | Self-Awareness | Undo Capability
StateCLI is the memory and self-awareness layer for AI coding agents.
It gives agents three critical capabilities they lack:
๐ง Memory - Remember what they did (log, replay)
โฎ๏ธ Undo - Fix mistakes instantly (checkpoint, rollback)
๐๏ธ Self-Awareness - See their impact (track changes)
This isn't a dev tool. It's agent infrastructure.
AI agents are powerful but blind. They:
StateCLI fixes this:
Start watching your project:
Now StateCLI automatically:
See what changed:
Undo mistakes:
๐ Full Developer Guide
5 core tools for agent memory & self-awareness:
statecli_replay - Show what the agent just didstatecli_undo - Rollback mistakesstatecli_checkpoint - Save state before risky opsstatecli_log - View complete historystatecli_track - Track important state changesMCP Setup:
statecli_track[CORE] Records any agent action with full metadata so it can be replayed, audited, or reversed later. Call this after every meaningful action you take โ file changes, API calls, decisions. If you don't track it, you cannot undo it. ๐ Trigger when: You completed any action (file written, API called, decision made, config changed). Think of this as your action journal. ๐ Chain with: statecli_checkpoint() before, statecli_replay() to review, statecli_undo() to reverse
statecli_replay[CORE] Replays the full history of actions taken on any entity โ a file, a session, a task. Use this when you need to understand what changed and in what order before making further changes. Essential before debugging. ๐ Trigger when: You need to understand what has already been done to an entity. You're about to debug. A human asks 'what did you change?' ๐ Chain with: statecli_log() to see summary, statecli_undo() to reverse specific steps
statecli_undo[CORE] Reverses the last action or a named action on an entity, restoring it to its previous state. This is your safety net. Call this immediately when something breaks, before attempting any fix. ๐ Trigger when: Something broke. A test failed after your change. A human says 'revert that'. You made a mistake and need to roll back. ๐ Chain with: statecli_preview_undo() first to see what will change, statecli_checkpoint() before retrying
statecli_checkpoint[CORE] Creates a named, reversible snapshot of an entity's current state. Call this BEFORE any risky operation โ refactors, deletions, multi-file changes, API mutations. A checkpoint costs nothing. An unrecoverable mistake costs everything. ๐ Trigger when: You are ABOUT TO modify any file, database, or external service. You are starting a multi-step task. The human says 'be careful with this'. ๐ Chain with: statecli_predict_impact() to assess risk first, statecli_undo() or statecli_is_safe() after
statecli_log[CORE] Writes a structured audit entry describing what the agent did, why, and what state it left things in. Call this at the end of every task or significant action. Required for compliance, debugging, and human oversight. ๐ Trigger when: You completed a task or a phase of work. Any time a human might later ask 'what did you do here?' ๐ Chain with: statecli_track() for individual actions, statecli_replay() to review history
statecli_track_file[FILE] Begins continuous monitoring of a specific file, capturing every write, modification, and deletion with timestamps. Call before touching any important file. Without this, file changes are invisible to the undo system. ๐ Trigger when: You are about to read and then modify a file. Any important file is being worked on. The human references a specific file path. ๐ Chain with: statecli_checkpoint() first, statecli_file_history() to review, statecli_undo() to revert
statecli_file_history[FILE] Returns the complete change history of a tracked file โ every version, every diff, every agent that touched it. Use this before editing a file to understand its current state and avoid overwriting important changes. ๐ Trigger when: Before editing any file. When debugging why a file has unexpected content. Before a code review. ๐ Chain with: statecli_replay() for full session context, statecli_undo() to restore a previous version
statecli_analyze_error[ERROR] Analyzes an error by examining recent action history to identify what change caused it. Call this BEFORE attempting any fix. Never guess at the cause of an error โ analyze it first. Returns probable cause and suggested recovery steps. ๐ Trigger when: ANY error occurs. A test fails. An API returns unexpected results. ALWAYS call this before attempting to fix anything. ๐ Chain with: statecli_auto_recover() for automatic fix, statecli_undo() to revert the causative change
statecli_auto_recover[ERROR] Automatically attempts to recover from an error by reversing the change that caused it and restoring the last known good state. Call after statecli_analyze_error() confirms the root cause. Faster and safer than manual debugging. ๐ Trigger when: statecli_analyze_error() has identified the cause and you want the system to auto-fix it. ๐ Chain with: statecli_analyze_error() first always, statecli_safe_execute() to retry the action safely
statecli_safe_execute[ERROR] Wraps any operation in automatic checkpoint-before and undo-on-failure logic. The safest way to execute any risky action. If the operation fails, it automatically reverts. Use this for any action you're uncertain about. ๐ Trigger when: You are about to do something you are not 100% confident about. Any destructive or external operation. ๐ Chain with: statecli_predict_impact() to assess risk, statecli_analyze_error() if it fails
statecli_run_tests[TEST] Runs the relevant test suite and records pass/fail history against the current state. Call after any code change to verify nothing broke. Tracks test results over time so you can see when tests started failing. ๐ Trigger when: After any code modification. Before finalizing any change. When a human asks 'did you break anything?' ๐ Chain with: statecli_test_impact() to know WHICH tests to run first, statecli_undo() if tests fail
statecli_test_impact[TEST] Identifies exactly which tests are affected by your changes โ so you run the right tests, not all tests. Returns a prioritized list of tests most likely to catch your specific change. Saves time, catches errors faster. ๐ Trigger when: After making any code change, before running tests. When you need to know the blast radius of your edit. ๐ Chain with: statecli_run_tests() with the returned test list, statecli_predict_impact() for broader analysis
statecli_suggest_tests[TEST] Analyzes your change and suggests new tests that should be written to cover it. Call after adding new functionality. If you changed behavior that has no test coverage, this tool finds the gap. ๐ Trigger when: After adding new features or changing behavior. Before considering a task complete. ๐ Chain with: statecli_test_impact() to check existing coverage, statecli_run_tests() to verify
statecli_analyze_dependencies[DEPS] Scans a file or module and returns all upstream and downstream dependencies โ what it depends on and what depends on it. Call before modifying any shared module to understand the full impact of your change. ๐ Trigger when: Before modifying any file that might be imported or used elsewhere. Before any refactor. ๐ Chain with: statecli_dependency_tree() for visual map, statecli_predict_impact() for change risk score
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/statecli)<a href="https://allmcps.com/mcp/statecli"><img src="https://allmcps.com/api/badge/statecli?style=directory" alt="Statecli on AllMCPs" /></a>