Skip to main content
Glama
mcp-shell-server

mcp-shell-server

by tumf

shell_execute

Execute allowlisted commands as argv arrays on the MCP server host, passing stdin and setting working directory, timeout, and output limits.

Instructions

Execute an allowed command as an argv array on the MCP server host. Allowed commands run with the server process's OS authority; the allowlist controls executable names, not what an allowed program does. Allowed commands: pwd, ls, wc, grep, cat Allowed patterns: Default timeout: 30s; maximum timeout: 300s; output cap: 1048576 bytes

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "command": "<command>"
    },
    "name": "shell_execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
stdinNoInput to be passed to the command via stdin
commandYesCommand and its arguments as array
timeoutNoMaximum execution time in seconds; clamped to server maximum
directoryNoOptional working directory. Omit to use the MCP server process current working directory; relative paths are resolved from that same server process CWD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.1.0
    • changedInput schema / properties / directory / description
      Previous value: -"Absolute path to a working directory where the command will be executed"New value: +"Optional working directory. Omit to use the MCP server process current working directory; relative paths are resolved from that same server process CWD."
    • changedInput schema / properties / timeout / description
      Previous value: -"Maximum execution time in seconds"New value: +"Maximum execution time in seconds; clamped to server maximum"
    • changedInput schema / properties / timeout / minimum
      Previous value: -0New value: +1
    • changedInput schema / required
      Previous value: -[
      -  "command",
      -  "directory"
      -]New value: +[
      +  "command"
      +]
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full disclosure burden and does well: it warns that commands run with the server process's OS authority and that the allowlist does not constrain what an allowed program actually does, alongside concrete operational limits (30s default timeout, 300s max, 1048576-byte output cap). What it omits is what happens on timeout or when the output cap is hit (truncation vs. error) and how exit status is surfaced.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Information is front-loaded: purpose and the authority warning come first, then the allowlist, then limits. The only wasted element is the dangling 'Allowed patterns:' label followed by an empty value, which adds noise without content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a shell-execution tool with no output schema and no annotations, the description covers authority, allowlist, and limits well but says nothing about the shape of the response (stdout/stderr separation, exit code, truncation behavior). That is the main remaining gap an agent would need before relying on the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond it by giving the concrete default timeout of 30s and the 300s server maximum that the schema only refers to abstractly as a 'server maximum', plus the output byte cap. It also reinforces the argv-array calling convention for the required command parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (execute) and resource (an allowed command as an argv array) and pins down the execution context as the MCP server host. The allowlist of permitted executables (pwd, ls, wc, grep, cat) makes the tool's scope concrete rather than leaving it as a generic shell wrapper.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The explicit allowlist effectively communicates when the tool can be used and, by omission, which commands are out of bounds, and the note that the allowlist governs executable names rather than program behavior tells the agent not to assume safety from being on the list. There is no explicit statement of when to prefer an alternative route, but no alternatives are presented to differentiate against.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools