Visitar URL original
[Feature]: Path allowlist for execute_code destructive file ops (e.g. Builds/) instead of a blanket File.Delete block · Issue #1438 · CoplayDev/unity-mcp · GitHub
Skip to content

[Feature]: Path allowlist for execute_code destructive file ops (e.g. Builds/) instead of a blanket File.Delete block #1438

Open

Description

@HivemindMinion

What problem are you trying to solve?

execute_code's safety check blocks System.IO.File.Delete outright (Blocked pattern detected: Code contains blocked pattern: 'System.IO.File.Delete'). That's a sensible default, but it also blocks routine, low-risk build housekeeping, e.g. deleting a stale APK from the project's Builds/ folder before a rebuild so a file watcher can't pick up the old one. The agent then shells out to do the same delete, which is no safer and bypasses the guard entirely.

What would you like to see?

  • A small path allowlist for destructive file operations: paths under the project's Builds/, Temp/ and Library/ by default (or a configurable list in the MCP settings window), still blocked everywhere else, especially Assets/ and anything outside the project.
  • Or, when a pattern is blocked, a more actionable message: which pattern matched, and a pointer to safety_checks=false and the allowlist setting, so the agent can make an informed choice instead of routing around the guard.

Prior art / how do you work around this today?

safety_checks=false (all-or-nothing), or deleting via the shell outside MCP.

Scope hint

Small: path normalisation plus an allowlist check before the existing pattern block.

Environment

  • Unity: 6000.3.8f1 (URP) · MCP for Unity: 10.2.1-beta.6 · Client: Claude Code · Transport: stdio · OS: Windows 11 Pro

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions