run_terminal_command

Runs a shell command on the user's Mac and returns its output. OFF by default — the user must turn it on in the LMCP menu-bar app (it stays off until they opt in). Also disabled when LMCP is in read-only mode. Dangerous commands (sudo, recursive deletes of system/home paths, disk formatting, shut...

SERVERLocal SOURCElocal-mcp
High RISK CLASS
Category Execute
Parameters 41 required
Recommended Rate-limitedsee the rule below
Registry record Grade F, identity unverified Pull the record →

This record as markdown: /tools/com-local-mcp-local-mcp/run-terminal-command.md

What run_terminal_command does on Local

AI agents invoke run_terminal_command to trigger actions in Local. 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.

ParameterTypeRequiredDescription
command string Yes The shell command to run (a single command line, executed with /bin/zsh -lc).
confirm boolean Must be true to actually run. Without it, a preview of the command is returned.
working_dir string Optional absolute working directory. Defaults to the user's home directory.
timeout_seconds integer Max seconds to run before it is terminated (default 20, max 60).

Parameters from the server's own tool schema.

Why run_terminal_command is rated High

While the tool has safeguards (user opt-in, read-only mode disabling, dangerous command blocking, preview-before-execute flow), it remains fundamentally an Execute category tool because it runs arbitrary shell commands whose effects depend on the arguments provided. It is not Destructive because the dangerous destructive operations are explicitly refused.

From the tool's definition Tool description states it 'Runs a shell command on the user's Mac and returns its output' and explicitly blocks 'Dangerous commands (sudo, recursive deletes of system/home paths, disk formatting, shutdown/reboot, piping a downloaded script into a shell, fork…

Questions about run_terminal_command

What does the run_terminal_command tool do? +

Runs a shell command on the user's Mac and returns its output. OFF by default — the user must turn it on in the LMCP menu-bar app (it stays off until they opt in). Also disabled when LMCP is in read-only mode. Dangerous commands (sudo, recursive deletes of system/home paths, disk formatting, shutdown/reboot, piping a downloaded script into a shell, fork bombs, daemon control) are refused. Destructive: it previews the command first — pass confirm:true to actually run it. Output and runtime are capped. It is categorised as a Execute tool in the Local MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.

What parameters does run_terminal_command accept? +

run_terminal_command accepts 4 parameters: command, confirm, working_dir, timeout_seconds. Required: command. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on run_terminal_command? +

Register the Local MCP server in PolicyLayer and add a rule for run_terminal_command: 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 Local. Nothing to install.

What risk level is run_terminal_command? +

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

Can I rate-limit run_terminal_command? +

Yes. Add a rate_limit block to the run_terminal_command 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 run_terminal_command completely? +

Set action: deny in the PolicyLayer policy for run_terminal_command. 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 run_terminal_command? +

run_terminal_command is provided by the Local MCP server (local-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

More on Local, and thousands of servers like it.

// THE MCP REGISTRY

PolicyLayer tracks 44,603 MCP servers and 515,000+ tools.

Every server has a live record: who publishes it, whether it answers without auth, its risk grade, every tool classified, the recommended policy. This page is one line of Local's. Pull the full record:

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.