Skip to main content
Glama
mcp-local-sandbox-cleaner

mcp-local-sandbox-cleaner

by 571242

mcp-local-sandbox-cleaner

An MCP server that finds the junk coding agents leave behind in a workspace: scratch directories, test caches, and dev ports that may no longer be serving anything. It can delete the files; it only reports the ports.

Not published to npm — build it from source.

Install

pnpm install
pnpm build

Point your MCP client at dist/index.js:

{
  "mcpServers": {
    "sandbox-cleaner": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-local-sandbox-cleaner/dist/index.js"]
    }
  }
}

Related MCP server: DevGuard-MCP

Tools

scan_sandbox_artifacts

Lists matching paths and how long ago each was modified.

Argument

Type

Meaning

workspacePath

string

Workspace root.

minAgeMinutes

number

Skip anything modified more recently than this. Defaults to 0.

Looks for these names directly under the workspace root, no recursion: .scratch, .agent-tmp, tmp_test_output, .pytest_cache, .coverage, coverage, .turbo, .tsbuildinfo.

.tsbuildinfo is matched as that exact filename, so it will not catch the tsconfig.tsbuildinfo files the TypeScript compiler actually writes. The list is a plain array at the top of src/index.ts; edit it to suit your workspace.

clean_sandbox_artifacts

Deletes what scan_sandbox_artifacts would list.

Argument

Type

Meaning

workspacePath

string

Workspace root.

dryRun

boolean

Report without deleting. Defaults to false.

minAgeMinutes

number

Skip recently modified paths. Defaults to 0.

Two things to know before running this without dryRun:

  • It does not consult git. A tracked file inside .scratch/ is deleted like anything else. Run with dryRun: true first if that matters.

  • coverage is matched by name at the workspace root. If you keep real source in a directory called coverage, it goes.

minAgeMinutes is the guard against deleting a directory an agent is still writing to. Set it to something like 15 to leave in-flight work alone.

inspect_dangling_dev_ports

Reports which of the given ports are in use. Defaults to 3000, 3001, 5173, 5174, 8000, 8080, 8888.

It does not identify the owning process and does not kill anything. Despite the name, the check is just "is this port occupied" — a healthy dev server and a zombie one look the same.

On Windows the match goes through findstr, which is a substring test: probing 3000 also reports listeners on 13000 and 30000. On Linux it uses lsof -i, which matches the port exactly.

License

MIT. See LICENSE.

Available Tools

3 tools
clean_sandbox_artifactsC

Safely sweep verified transient files and directories to recover disk space and maintain repository cleanliness.

Inputs: workspacePath (required), dryRun, minAgeMinutes.

inspect_dangling_dev_portsA

Detect orphaned local development ports (e.g. 3000, 5173, 8000, 8080) left behind by stopped agent runs.

Inputs: ports.

scan_sandbox_artifactsC

Scan a target workspace for dangling temporary test outputs, agent scratches, and bloated caches, with optional file age threshold.

Inputs: workspacePath (required), minAgeMinutes.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct role: scan detects artifacts, clean removes them, and inspect targets orphaned development ports. There is no meaningful overlap between artifact detection, artifact cleanup, and port inspection.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern: scan_sandbox_artifacts, clean_sandbox_artifacts, and inspect_dangling_dev_ports. The convention is predictable and readable.

    Tool Count5/5

    Three tools are well-scoped for a focused sandbox cleaner, with each operation earning its place. The surface covers detection, cleanup, and a related diagnostics check without bloat.

    Completeness4/5

    The core artifact lifecycle is covered by scan and clean, and port inspection adds useful diagnostics. However, dangling ports can only be detected, not terminated or reclaimed, leaving a minor operational gap.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLM agents to safely reclaim disk space by deleting build artifact directories like node_modules, .venv, and target, with strong guardrails to prevent accidental or malicious deletion.
      70 PyPI
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to audit and clean development workspaces safely by detecting reclaimable artifacts, exposed .env files, and potential secret leaks.
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to scan a developer machine for disk space hogs, audit git worktrees for stale or orphaned ones, re-check individual findings, and run allowlisted cleanup actions as dry runs unless explicitly confirmed. Risky items are reported with warnings and refused by default.
      1,042 npm
      2
      MIT