# @laragear/mcp-shell [Health: Active]

**Category:** 🖥️ Command Line  
**Repository:** https://github.com/Laragear/mcp-shell  
**GitHub Stars:** 0  
**npm Downloads (last month):** 124  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/laragear-mcp-shell

## Description
MCP server that exposes only the shell commands you declare in a YAML or JSON config file.

## Tools
Capabilities this server exposes over MCP:

- **list_commands** — List every command this server exposes, from which config file, with the exact final command line of each tool, effective timeout/output limits, and any config warnings.
- **config_template** — Output a ready-to-fill YAML config template of the current configuration, with every supported key visible (optional ones commented out), or a starter template when no config is loaded. The reference for humans and agents alike. Read-only: to save a template, use the CLI (--template [--save agents|user] [--force]).
- **config_schema** — The bundled JSON Schema of the config file (commands.schema.json): every group and command key with its type and description. Feed it to whoever writes the config by hand, human or agent, so no key is guessed.
- **save_command** — Propose adding or updating one shell command. The human approves it in a dialog before anything is written to the agent config file; the new tool is available immediately after approval. Refused when the group already exists in a human config file.
- **remove_command** — Propose removing one command previously approved through save_command. The human approves it in a dialog before anything is written. Commands from human config files cannot be removed here.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-shell": {
    "command": "npx",
    "args": ["-y","@laragear/mcp-shell"]
  }
}
```

## Documentation

## What @laragear/mcp-shell does

@laragear/mcp-shell exposes an allowlist of project commands as MCP tools. You define command groups in YAML or JSON, including labels, descriptions, environment values, argument rules, and optional output checks. Each configured command becomes a separately named tool, so an agent can run approved operations without receiving general shell access.

A command with arguments disabled runs exactly as declared. For example, a configured test command can be invoked repeatedly while preventing the agent from changing its command line. Commands can instead accept free-form arguments or a declared set of named arguments. Named arguments may fill placeholders in the command or add controlled prefixes and suffixes.

## How it works

The server reads the configuration and creates MCP tools from its command definitions. When an agent calls one, the result includes the process exit code, standard output, and standard error. Configuration is read again for each tool call by default, allowing edits to take effect without restarting the server.

The project configuration can be written manually, commonly as `shell-runner.yaml`. Agents can also propose commands through `save_command`. The MCP client presents the exact proposed YAML for approval, and nothing is saved unless the user accepts it. Approved agent-created commands are stored separately under `~/.agents/mcp-shell/<project>/agent.yaml`; they merge beneath user-defined groups, while user-defined groups take precedence.

The `list_commands` tool provides a doctor report containing the active configuration file, detected problems, and the exact command line associated with each tool. `config_template` produces a commented configuration template, and `config_schema` returns the JSON Schema used to describe supported configuration keys.

## Setup and configuration

Node.js 22 or later is required. A no-install setup registers the server with an MCP client through `npx`:

```json
{
  "mcpServers": {
    "shell-runner": {
      "command": "npx",
      "args": ["-y", "@laragear/mcp-shell"]
    }
  }
}
```

The package can also be installed into a project with `npm install @laragear/mcp-shell`. Configuration may be kept in the project, or an explicit path can be supplied through `SHELL_RUNNER_CONFIG`. When that variable is set, the explicit configuration is used alone and agent proposals are refused.

For editor assistance, the package includes `commands.schema.json`. A generated template can reference the local package schema, a schema saved under `.agents`, or a pinned CDN copy. The CLI can save the schema with `--schema --save agents`; it can also generate a starter configuration with `--template --save agents`.

## Tools and capabilities

- Expose each approved command as an MCP tool.
- Run fixed commands without accepting arguments.
- Accept free-form arguments as quoted JSON string values when `args: true` is enabled.
- Define named, described, required, or defaulted arguments.
- Insert named arguments into command placeholders.
- Add optional argument prefixes or suffixes.
- Set environment values for a command group.
- Check command output using supported configuration checks such as `not_contains`.
- Propose, approve, or remove agent-created commands through `save_command`.
- Inspect commands and configuration problems with `list_commands`.
- Generate configuration guidance with `config_template` and `config_schema`.

## Limitations and notes

The server does not give the agent an unrestricted shell. Only commands present in the effective configuration can run, and arguments are constrained by each command's `args` setting. Approving an agent proposal is equivalent to approving the command line shown in the client dialog, so that line should be reviewed before acceptance.

Agent proposals use MCP elicitation. Clients without elicitation support receive an error directing the agent to request a manual configuration change; the server does not silently write the proposal. Agent-created files are separate from user-owned configuration, and an agent cannot modify commands declared by the user.

The package targets MCP clients and requires Node.js 22 or later. The schema and generated configuration files are intended to help editors and agents use valid configuration keys, but the executed command remains the responsibility of the configuration author.

_Full upstream README: https://allmcps.com/mcp/laragear-mcp-shell/readme_

