cursor-before-mcp-execution-guard

Block destructive MCP tool calls (shell passthroughs, out-of-workspace deletes) before execution in Cursor.

hook BeforeMCPExecution cursor mode: enforce

Block destructive MCP tool calls (shell passthroughs, out-of-workspace deletes) before execution in Cursor.

FieldValue
idcursor-before-mcp-execution-guard
status_messageChecking MCP-execution safety
modeenforce
logical_eventBeforeMCPExecution
commandpython3 {repo_root}/hooks/wagents-hook.py cursor-before-mcp-execution-guard --harness {harness}
timeout5
harnesses["cursor"]
Full hook config + policy reference
config/hook-registry.json (entry)
{
"id": "cursor-before-mcp-execution-guard",
"description": "Block destructive MCP tool calls (shell passthroughs, out-of-workspace deletes) before execution in Cursor.",
"status_message": "Checking MCP-execution safety",
"mode": "enforce",
"logical_event": "BeforeMCPExecution",
"command": "python3 {repo_root}/hooks/wagents-hook.py cursor-before-mcp-execution-guard --harness {harness}",
"timeout": 5,
"harnesses": [
"cursor"
]
}
wagents/hooks/policies/before_mcp_execution.py (decision)
def evaluate_before_mcp_execution(tool_name: str, params: dict[str, Any] | None) -> str | None:
"""Return a deny reason for dangerous MCP calls, else None."""
# Blocks destructive commands passed through MCP shell tools and
# absolute / path-traversal deletes that escape the workspace.
...

Command: python3 .../wagents-hook.py cursor-before-mcp-execution-guard --harness cursor


View source on GitHub