⏳ MCP Chronoshell
A state-reverting terminal MCP that gives AI agents an "undo button" for local file operations.
🚀 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
stdoutandstderrspecifically 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:
-
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. -
revert_workspace()Reverts the local directory to the exact state it was in before the lastrun_safe_commandwas executed. The agent is instructed to call this immediately if a command caused unintended side effects. -
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.copytreewithdirs_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_snapshotsdirectory. - A hardcoded blocklist ensures that $I/O$ bottlenecks (like
__pycache__ornode_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:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2e54474a270899be8ae0782403b25cea357849850ccb100f8fca7973f9f4da2
|
|
| MD5 |
b567e0174c9009195554ac65732e8588
|
|
| BLAKE2b-256 |
93c4ca930393d829247b0b8cc738cda8f5545d5e03854163040bff9a395dc0de
|
Provenance
The following attestation bundles were made for mcp_chronoshell-0.1.1.tar.gz:
Publisher:
publish.yml on ANSHUMANSINGH987/mcp-chronoshell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_chronoshell-0.1.1.tar.gz -
Subject digest:
c2e54474a270899be8ae0782403b25cea357849850ccb100f8fca7973f9f4da2 - Sigstore transparency entry: 2569747765
- Sigstore integration time:
-
Permalink:
ANSHUMANSINGH987/mcp-chronoshell@87b13a5559b6b6dc047f1e8684fa495df7952a59 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ANSHUMANSINGH987
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@87b13a5559b6b6dc047f1e8684fa495df7952a59 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_chronoshell-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_chronoshell-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65303b22f31e8d1c7e580b265f921e0962c9d403c5c8d891873f60061cadf356
|
|
| MD5 |
24a019cfee55c3bbc74e4e942a26a786
|
|
| BLAKE2b-256 |
97e347677484585f2e2bf703f4ae85594309488fb86bc5e884e13b1a7a662cc8
|
Provenance
The following attestation bundles were made for mcp_chronoshell-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on ANSHUMANSINGH987/mcp-chronoshell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_chronoshell-0.1.1-py3-none-any.whl -
Subject digest:
65303b22f31e8d1c7e580b265f921e0962c9d403c5c8d891873f60061cadf356 - Sigstore transparency entry: 2569747766
- Sigstore integration time:
-
Permalink:
ANSHUMANSINGH987/mcp-chronoshell@87b13a5559b6b6dc047f1e8684fa495df7952a59 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ANSHUMANSINGH987
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@87b13a5559b6b6dc047f1e8684fa495df7952a59 -
Trigger Event:
release
-
Statement type: