Sweep MCP
Let an agent clear node_modules and other junk folders, only inside roots you allow
- Pricing
- Open source
- Platforms
- CLI, self-hosted, Linux
- Runs
- Locally
- Version
- 0.1.1
- Listing updated
- 1 day ago
About Sweep MCP
Sweep MCP is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
Sweep MCP exposes the sweep cleanup utility to an agent so it can find and reclaim folders such as node_modules, .venv, target and pycache. The README spends most of its length on the guard rails: a root allowlist fixed at startup that the agent cannot change, with every request refused if no roots are configured; paths resolved before the containment check so ../ and symlink escapes fail; and deletion by random ticket id only, never by path.
Dry run is the default, and a real delete needs the exact confirmation string "delete". Each find is re-checked against the live filesystem just before deletion, confirming it is still contained, still a directory, not a link and still has its marker file. Tool descriptions are static strings so directory names cannot inject instructions.
The README is candid about limits: a root set to / will be honoured, a legitimate client gets what it asks for, an agent talked into deleting a real folder is not stopped, and a small race window remains between check and delete. It runs over stdio from a PyPI package.
Install
Run in a terminal
claude mcp add sweep-mcp -- uvx sweep-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"sweep-mcp": {
"command": "uvx",
"args": [
"sweep-mcp"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"sweep-mcp": {
"command": "uvx",
"args": [
"sweep-mcp"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"sweep-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"sweep-mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"sweep-mcp": {
"command": "uvx",
"args": [
"sweep-mcp"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"sweep-mcp": {
"command": "uvx",
"args": [
"sweep-mcp"
]
}
}
}Tools this server provides (1)
Taken from the project documentation; the running server may differ.
- reclaim
- Delete previously found directories by ticket id, as a dry run unless confirmed.
What it does
- Root allowlist
- Only folders you name at startup can be scanned or deleted.
- Delete by ticket id
- Reclaim accepts random ids from a scan, never raw paths.
- Dry run by default
- Deletion needs the exact confirmation string.
- Pre-delete revalidation
- Checks containment, type, symlinks and marker files again before removal.
- Static tool descriptions
- Filesystem content cannot reach the model as instructions.
- Documented limits
- The README lists what the guards do not cover.
Good for
- Reclaim disk space from old node_modules folders
- Clean virtual environments and build targets across projects
- Give an agent a bounded delete capability
- Study guard-rail patterns for destructive MCP tools
Pricing
Open source
Open-source Python package on PyPI
Prices change. Check les-k.github.io before you buy.
Sweep MCP FAQ
Can the agent delete any path?
No. It can only act on ids from its own scan inside the configured roots.
Does it delete immediately?
No, dry run is the default and deletion requires confirm="delete".
What if I set the root to /?
It will work through your filesystem; the allowlist is only as safe as your configuration.
Is there any known weakness?
Yes, a short race window between the final check and the delete remains, as the README states.
Is Sweep MCP free?
Yes. Sweep MCP is open source, so you can use and self-host it for free.
How do I add Sweep MCP to Claude Code?
Run this command in your terminal: claude mcp add sweep-mcp -- uvx sweep-mcp
What are the best alternatives to Sweep MCP?
The closest alternatives to Sweep MCP are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to Sweep MCP

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools