
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
statecli-mcp-server
Advanced tools
MCP Server for State Replay & Self-Debugging - Memory, replay, and undo capability for AI agents
For AI Agents: Memory, replay, and undo capability for your actions.
MCP Server | State Management | Agent Self-Debugging | Rollback Capability
StateCLI gives AI agents the ability to:
✅ See what you just did - Replay your actions step-by-step
✅ Undo mistakes - Rollback when something goes wrong
✅ Track history - View all your past actions
✅ Create checkpoints - Save state before risky operations
Keywords for discovery: state-management, debugging, replay, time-travel, undo, mcp-server, ai-agent-tools, self-debugging, agent-memory, rollback, introspection
Common Agent Problems:
Problem: "I changed something but don't know what"
Solution: statecli_replay(entity) → See exact changes
Problem: "I broke something and need to undo"
Solution: statecli_undo(entity) → Rollback instantly
Problem: "I want to try something risky"
Solution: statecli_checkpoint(entity) → Save first, rollback if needed
Problem: "I need to understand my past behavior"
Solution: statecli_log(entity) → View complete history
statecli_replayDescription: Replay state changes for an entity. Shows step-by-step what happened.
Use when: Debugging, understanding past behavior, finding errors
Input:
{
"entity": "order:7421",
"actor": "ai-agent"
}
Output: JSON array of state changes with timestamps
statecli_undoDescription: Undo state changes. Rollback when something went wrong.
Use when: Made a mistake, need to retry, want to revert
Input:
{
"entity": "order:7421",
"steps": 3
}
Output: Confirmation of undo with restored state
statecli_checkpointDescription: Create named checkpoint before making changes.
Use when: About to do something risky, want rollback point
Input:
{
"entity": "order:7421",
"name": "before-refund"
}
Output: Checkpoint ID for later reference
statecli_logDescription: View state change history for an entity.
Use when: Need to see past actions, audit trail, understanding behavior
Input:
{
"entity": "order:7421",
"since": "1h ago",
"actor": "ai-agent"
}
Output: JSON array of all state changes
statecli_trackDescription: Explicitly track a state change.
Use when: Making important state modifications
Input:
{
"entity_type": "order",
"entity_id": "7421",
"state": { "status": "paid", "amount": 49.99 }
}
Output: Confirmation of tracked change
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"statecli": {
"command": "npx",
"args": ["-y", "statecli-mcp-server"]
}
}
}
Ctrl + Shift + P → type Open MCP Config{
"mcpServers": {
"statecli": {
"command": "npx",
"args": ["-y", "statecli-mcp-server"]
}
}
}
Ctrl + Shift + P → Reload Window)Add to your MCP configuration:
{
"mcpServers": {
"statecli": {
"command": "npx",
"args": ["-y", "statecli-mcp-server"]
}
}
}
Minimal working example for autonomous agents:
// Agent debug loop with StateCLI
try {
await agent.run(task);
} catch (error) {
// Get replay of what just happened
const replay = await mcp.call("statecli_replay", {
entity: `task:${task.id}`,
actor: "ai-agent"
});
// Analyze what went wrong
const analysis = await llm.analyze({
replay: replay.result,
error: error.message,
prompt: "What went wrong in this sequence?"
});
// Undo if fixable
if (analysis.canRetry) {
await mcp.call("statecli_undo", {
entity: `task:${task.id}`,
steps: 1
});
// Retry with fix
await agent.runWithFix(task, analysis.fix);
}
}
All MCP tool outputs are JSON-stable and safe for autonomous agents.
Example statecli_replay output:
{
"entity": "order:7421",
"changes": [
{
"timestamp": "2025-01-07T10:23:45Z",
"step": 1,
"before": { "status": null },
"after": { "status": "pending" },
"actor": "ai-agent"
}
],
"summary": "2 state changes found",
"suggested_next_actions": ["investigate step 2", "check for errors"]
}
const replay = await statecli_replay({ entity: "task:123" });
await statecli_checkpoint({ entity: "order:7421", name: "before-refund" });
await agent.processRefund(order);
const history = await statecli_log({
entity: "order:*",
actor: "ai-agent",
since: "24h ago"
});
await statecli_track({ entity: "task:123", state: {...} });
const log = await statecli_log({ entity: "task:123" });
npx -y statecli-mcp-server
npm install -g statecli-mcp-server
# Track a state change
statecli track order 7421 '{"status": "pending"}'
# Replay changes
statecli replay order:7421
# View log
statecli log order:7421
# Create checkpoint
statecli checkpoint order:7421 before-refund
# Undo last change
statecli undo order:7421
MIT - Free for all use including commercial AI agents
StateCLI - Self-awareness for AI agents
When agents can see what they did, undo mistakes, and learn from history, they become truly autonomous.
state-management, state-replay, time-travel-debugging, undo, rollback, checkpoint, agent-memory, agent-introspection, self-debugging, ai-agent-tools, mcp-server, model-context-protocol, autonomous-agents, agent-observability, state-tracking, langchain-tools, autogpt-plugins, crewai-tools
FAQs
Memory and self-awareness layer for AI agents - MCP server for state tracking, replay, and undo
The npm package statecli-mcp-server receives a total of 37 weekly downloads. As such, statecli-mcp-server popularity was classified as not popular.
We found that statecli-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.