local_exec

Run a shell command on the local machine where this MCP server is running. On Windows the command goes to cmd.exe; on Linux/Mac to /bin/sh. Use for git, npm, file edits, pm2 control, etc.

Server Self-hosted MCP server for Claude leszczynskikarol/mcp-server
Category Execute
Risk class High
Parameters 00 required

What local_exec does on Self-hosted MCP server for Claude

AI agents invoke local_exec to trigger actions in Self-hosted MCP server for Claude. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call — builds kicked off, notifications sent, workflows started.

Why local_exec needs a policy

This tool triggers arbitrary shell command execution (via cmd.exe on Windows or /bin/sh on Linux/Mac) whose effects are entirely argument-dependent. While not inherently destructive, the tool enables potentially dangerous operations like file deletion, credential exposure, lateral movement, or system compromise.

From the tool's definition Tool name 'local_exec' combined with description 'Run a shell command on the local machine' explicitly indicates arbitrary code execution capability.

Questions about local_exec

What does the local_exec tool do? +

Run a shell command on the local machine where this MCP server is running. On Windows the command goes to cmd.exe; on Linux/Mac to /bin/sh. Use for git, npm, file edits, pm2 control, etc. It is categorised as a Execute tool in the Self-hosted MCP server for Claude MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.

How do I enforce a policy on local_exec? +

Register the Self-hosted MCP server for Claude MCP server in PolicyLayer and add a rule for local_exec: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Self-hosted MCP server for Claude. Nothing to install.

What risk level is local_exec? +

local_exec is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.

Can I rate-limit local_exec? +

Yes. Add a rate_limit block to the local_exec rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block local_exec completely? +

Set action: deny in the PolicyLayer policy for local_exec. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides local_exec? +

local_exec is provided by the Self-hosted MCP server for Claude MCP server (leszczynskikarol/mcp-server). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.