Skip to main content

⏳ MCP Chronoshell

A state-reverting terminal MCP that gives AI agents an "undo button" for local file operations.

PyPI version Python Versions License: MIT Powered by FastMCP


🚀 The Problem

Giving an autonomous agent access to your local terminal is risky. One hallucinated rm -rf, a malformed sed command, or a botched configuration change can break your workspace. While Docker-based sandboxes provide security isolation, they prevent the agent from actually helping you build software on your local host (like running uv add, modifying settings.py, or refactoring your repository).

💡 The Solution

MCP Chronoshell acts as a wrapper around standard terminal execution. Before executing any command, it takes a hyper-fast snapshot of your current working directory (intelligently ignoring heavy folders like node_modules, .venv, and .git).

If the agent makes a mistake, it can invoke a revert_workspace tool to instantly time-travel back to the pre-execution state.

It provides productivity with a safety net.


⚡ Features

  • Safe Execution (run_safe_command): Wraps every command in a pre-execution snapshot.
  • Instant Rollbacks (revert_workspace): Undoes accidental deletions, broken code edits, or bad package installs.
  • Context-Aware Outputs: Structures stdout and stderr specifically for LLM consumption.
  • Hyper-Fast I/O Engine: Utilizes $O(1)$ set lookups to ignore heavy, reproducible directories so snapshots take milliseconds.
  • Cross-Platform: Works flawlessly on Windows, macOS, Linux, and WSL environments.

📦 Installation

Since MCP Chronoshell is published on PyPI, installation is trivial. It is highly recommended to use uv for lightning-fast installation, but standard pip works perfectly as well.

# Using uv (Recommended)
uv tool install mcp-chronoshell

# Using pip
pip install mcp-chronoshell

🛠️ Configuration (Claude Desktop)

To use Chronoshell with Claude Desktop, you need to add it to your MCP client configuration.

Open your Claude Desktop configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Add the following JSON block. Make sure to update the command path to point to where Python or uv is installed on your machine.

{
  "mcpServers": {
    "chronoshell": {
      "command": "mcp-chronoshell",
      "args": []
    }
  }
}

Note: If mcp-chronoshell is not in your global system PATH, provide the absolute path to your python executable or uv binary, and pass ["-m", "mcp_chronoshell.server"] as the arguments.


🧰 Available Agent Tools

Once connected, your AI agent will have access to the following native tools:

  1. run_safe_command(command: str) Executes a shell command safely. Automatically creates a state-revert snapshot before execution. It prevents hanging by enforcing a 120-second timeout.

  2. revert_workspace() Reverts the local directory to the exact state it was in before the last run_safe_command was executed. The agent is instructed to call this immediately if a command caused unintended side effects.

  3. commit_workspace() Clears the snapshot cache (.chronoshell_snapshots/) to save disk space. Called when the agent verifies the previous commands succeeded.


🏗️ Architecture Under the Hood

Chronoshell is built entirely in Python using FastMCP, meaning it requires zero external dependencies like Docker or Redis.

  • It uses Python's shutil.copytree with dirs_exist_ok=True (introduced in Python 3.8) to act as a highly efficient overwrite/merge mechanism.
  • Snapshots are stored locally in a hidden .chronoshell_snapshots directory.
  • A hardcoded blocklist ensures that $I/O$ bottlenecks (like __pycache__ or node_modules) are strictly ignored during the snapshot phase, preserving terminal speed.

🤝 Contributing

Contributions are welcome! If you want to optimize the snapshot engine (e.g., implementing an optional Git-based snapshot mode) or add new terminal capabilities:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License & Author

Author: Anshuman Singh
License: Distributed under the MIT License. See LICENSE for more information.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_chronoshell-0.1.1.tar.gz (121.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_chronoshell-0.1.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_chronoshell-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_chronoshell-0.1.1.tar.gz
  • Upload date:
  • Size: 121.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcp_chronoshell-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c2e54474a270899be8ae0782403b25cea357849850ccb100f8fca7973f9f4da2
MD5 b567e0174c9009195554ac65732e8588
BLAKE2b-256 93c4ca930393d829247b0b8cc738cda8f5545d5e03854163040bff9a395dc0de

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_chronoshell-0.1.1.tar.gz:

Publisher: publish.yml on ANSHUMANSINGH987/mcp-chronoshell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_chronoshell-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_chronoshell-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65303b22f31e8d1c7e580b265f921e0962c9d403c5c8d891873f60061cadf356
MD5 24a019cfee55c3bbc74e4e942a26a786
BLAKE2b-256 97e347677484585f2e2bf703f4ae85594309488fb86bc5e884e13b1a7a662cc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_chronoshell-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ANSHUMANSINGH987/mcp-chronoshell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page