dismocle-windows
# Dismocle MCP (`dismocle-mcp-winos`)
Lightweight, high-speed Windows disk analyzer, cache cleaner, and installed app manager for AI agents via the Model Context Protocol (MCP) and as an Antigravity plugin.
**Repository:** <https://github.com/Automate-with-Sanjay/Dismocle_mcp_winos>
**Requirements:** Windows · Python `>=3.13` · [`uv`](https://docs.astral.sh/uv/) (recommended)
---
## What It Includes
This repository packages three integrated pieces:
- **`dismocle-mcp-winos` MCP Server** (`src/dismocle_mcp/`): 11 fast Windows storage, cache, and app management tools exposed over `stdio` (`mcp>=2.3.0`).
- **Antigravity Plugin** ([`plugin.json`](plugin.json), [`mcp_config.json`](mcp_config.json)): Pre-configured plugin bundle with suggested prompts.
- **Cleanup Workflow & Safety Guardrails** ([`skills/windows-cleanup/SKILL.md`](skills/windows-cleanup/SKILL.md), [`rules/AGENTS.md`](rules/AGENTS.md)): Guided triage-to-confirmation workflow and strict agent safety rules.
---
## Features & MCP Tools
### Read-Only Inspection Tools (7)
| Tool | Purpose |
| --- | --- |
| `get_drives_overview` | Instant total, used, free space, and filesystem info for all mounted drives. |
| `analyze_directory` | Parallel `os.scandir` size breakdown and largest files without following NTFS junctions or symlinks. |
| `find_large_files` | Find large or stale files filtered by minimum MB, extensions (`.iso`, `.zip`, `.mp4`, etc.), and age in days. |
| `scan_caches` | Scan Windows, browser, Recycle Bin, and developer package caches grouped by `safe`, `moderate`, and `caution` tiers. |
| `find_dev_artifacts` | Locate regenerable project build/dependency folders (`node_modules`, `.venv`, `venv`, `target`, `dist`, `build`, `__pycache__`, `.next`, `.turbo`, etc.). |
| `list_installed_apps` | Fast (`<50 ms`) Registry app inventory with optional Microsoft Store / AppX apps and on-disk `InstallLocation` size measurement. |
| `get_system_storage_insights` | Inspect `hiberfil.sys`, `pagefile.sys`, `swapfile.sys`, `MEMORY.DMP`, `Windows.old`, `Package Cache`, and WSL2/Docker `.vhdx` virtual disks with cleanup advice. |
### Mutating Tools (4 — all default to `dry_run=True`)
| Tool | Purpose & Default Safety |
| --- | --- |
| `clean_caches` | Preview or clean scanned cache IDs (`dry_run=True`, `allow_caution=False`). |
| `delete_paths` | Preview, recycle, or remove specific user-approved files/folders (`dry_run=True`, `move_to_trash=True`). |
| `empty_recycle_bin` | Preview or empty the Windows Recycle Bin (`dry_run=True`, optional validated `drive` letter). |
| `uninstall_app` | Preview or launch the native Windows/Store uninstaller (`dry_run=True`, excludes system components/updates). |
---
## Supported Cache Targets (`scan_caches` / `clean_caches`)
- **Safe (`safety="safe"`)**: User & Windows Temp, Windows Update download cache, Delivery Optimization cache, Crash Dumps & WER logs, DirectX/NVIDIA/AMD GPU shader caches, Explorer thumbnails (`thumbcache_*.db`), Chrome/Edge/Brave/Firefox disk caches (preserves bookmarks, history, cookies, and logins), `uv`, `pip`, `npm`, and VS Code caches.
- **Moderate (`safety="moderate"`)**: Windows Recycle Bin, Windows Prefetch, `pnpm`/`Yarn`, NuGet, Cargo, and Gradle caches.
- **Caution (`safety="caution"`)**: HuggingFace, PyTorch, and Ollama downloaded model caches (blocked unless `allow_caution=True` is explicitly passed).
---
## Safety & Protection Guardrails
Dismocle is designed so an AI agent cannot accidentally wipe Windows or personal user files:
- **Dry-run by default**: Every mutating tool defaults to `dry_run=True` to preview targets and sizes before any changes occur.
- **Recycle Bin first**: `delete_paths` defaults to `move_to_trash=True` via `send2trash`.
- **Hard-blocked protected paths**:
- Any drive root (`C:\`, `D:\`, etc.) and critical root files/folders (`hiberfil.sys`, `pagefile.sys`, `swapfile.sys`, `bootmgr`, `$Recycle.Bin`, `System Volume Information`, `Recovery`, `Boot`, `EFI`).
- `C:\Windows` (`SystemRoot`) and all its descendants (`System32`, `SysWOW64`, `WinSxS`, etc.), plus `Program Files` system directories and `ProgramData\Package Cache`.
- User profile roots (`C:\Users`, other users' profiles, `Desktop`, `Documents`, `Downloads`, `Pictures`, `Videos`, `Music`, `OneDrive`, `AppData`, browser `User Data` / Firefox `Profiles`), user registry hives (`NTUSER.DAT`, `UsrClass.dat*`), and credential/key directories (`.ssh`, `.gnupg`, `.aws`, `.kube`, `.azure`, `.docker`, `.gemini`, `.config\gcloud`, Windows `Credentials`/`Protect`/`Vault`).
- **Bypass & traversal defense**:
- Blocks UNC paths (`\\server\share`), Windows device paths (`\\.\`), wildcards, null bytes, and reserved device names.
- Validates both lexical (`abspath`) and resolved (`realpath`) paths to block **8.3 short-name aliases** (e.g., `PROGRA~1`), `\\?\` prefix tricks, and **symlink/NTFS junction traversal**.
- `clean_caches` verifies every resolved cache path against `is_protected_path` and skips symlinks/junctions so misconfigured environment variables (e.g., `%TEMP%`) cannot touch user data.
- **Safe uninstaller execution**: Uses Win32 `CommandLineToArgvW` with `shell=False` and validates Microsoft Store package IDs via environment variables to prevent PowerShell command injection.
---
## Installation
### Option 1: Antigravity Plugin
1. Install [`uv`](https://docs.astral.sh/uv/) so `uvx` is available on `PATH`.
2. Clone this repository and install the plugin with the Antigravity CLI:
```powershell
git clone https://github.com/Automate-with-Sanjay/Dismocle_mcp_winos.git
agy plugin install .\Dismocle_mcp_winos
```
### Option 2: PyPI (`dismocle-mcp-winos`)
Add to your `mcp_config.json` (Antigravity, Claude Desktop, or Cursor):
```json
{
"mcpServers": {
"dismocle-windows": {
"command": "uvx",
"args": ["dismocle-mcp-winos"]
}
}
}
```
### Option 3: Directly from GitHub (No PyPI required)
```json
{
"mcpServers": {
"dismocle-windows": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/Automate-with-Sanjay/Dismocle_mcp_winos",
"dismocle-mcp-winos"
]
}
}
}
```
### Option 4: Local / Development
```powershell
git clone https://github.com/Automate-with-Sanjay/Dismocle_mcp_winos.git
cd Dismocle_mcp_winos
uv sync
$env:PYTHONPATH = "src"
.\.venv\Scripts\python.exe -m unittest discover -s tests -v
.\.venv\Scripts\dismocle-mcp-winos.exe
```
---
## Project Structure
```text
Dismocle_mcp_winos/
├── src/dismocle_mcp/
│ ├── server.py # FastMCP server & tool definitions
│ ├── scanner.py # Drive overview, parallel directory & large-file scanner
│ ├── caches.py # Windows/browser/dev cache specs & dev artifact finder
│ ├── cleaner.py # Dry-run/safe cache cleaning, delete_paths & Recycle Bin
│ ├── apps.py # Registry/Store app inventory & safe uninstaller
│ ├── system_info.py # hiberfil/pagefile/Windows.old/WSL2 & Docker insights
│ └── utils.py # Path normalization, protected-path & junction guards
├── skills/windows-cleanup/SKILL.md
├── rules/AGENTS.md
├── tests/test_dismocle.py
├── plugin.json
├── mcp_config.json
└── pyproject.toml
```
---
## License
MIT — see [LICENSE](LICENSE).
TDQS
Scored across 11 tools
Most tools target clearly distinct resources and actions: drive overview, directory analysis, cache scanning, app listing, cleanup, deletion, and uninstall. There is minor potential overlap between analyze_directory and find_large_files, and between scan_caches and find_dev_artifacts, but descriptions make the boundaries reasonably clear.
All tool names follow a consistent snake_case verb_noun convention (get_drives_overview, scan_caches, delete_paths, uninstall_app). Verb choices vary only to reflect distinct actions, not inconsistent naming style.
The 11 tools form a well-scoped set for Windows disk analysis and cleanup, with each tool covering a distinct part of the workflow. The count is neither thin nor bloated.
The surface covers the full lifecycle: drive overview, deep directory analysis, large-file discovery, cache/dev artifact scanning, installed app inspection, system storage insights, safe cleanup, deletion, recycling, and uninstall. No critical dead ends are apparent for the stated disk-cleanup purpose.