MCP Shell logo

MCP Shell

by @laragear

Restricts agent-run shell commands to an approved YAML or JSON configuration.

Install MCP Shell

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "laragear-mcp-shell": {
      "command": "npx",
      "args": [
        "-y",
        "@laragear/mcp-shell"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 5 tools correctly ().

Overview

@laragear/mcp-shell turns commands declared in a project configuration file into individual MCP tools. Agents receive command output, error output, and exit codes, but cannot open an unrestricted shell or add arguments unless the configuration permits them. Use it when an agent needs controlled access to tasks such as testing, linting, building, or other project commands. The server communicates through a standard MCP client and can reload configuration changes on each tool call.

Use cases

  • Run approved test suites
  • Build and lint a project
  • Expose selected deployment or container commands
  • Restrict agent-supplied command arguments
  • Review and approve agent-proposed commands

Key features

  • YAML or JSON command allowlists
  • Fixed and parameterized shell commands
  • Per-group environment values
  • Command output and exit-code reporting
  • Agent proposal approval workflow
  • Configuration templates and JSON Schema

Tools5

What MCP Shell lets your agent do. Expand a tool for its parameters.

Verified live~1.2k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

4/4 checks healthy over the last 14d

What it can do

From the 5 tools this server returned when we ran it; 5 declare their own safety hints.

Runs commands · 1Can delete or modify data · 1Read-only tools · 3
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceSigned build
Package age36 days
Maintainers1

Observed 2026-11-16 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · @laragear/mcp-shell (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads124Package downloads in the last 30 days.
Last commit16d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed5Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Shell works

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:

config.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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Shell

@laragear/mcp-shell is an MCP server that connects AI agents to approved project shell commands defined in YAML or JSON. It exposes each command as an MCP tool and includes tools for saving proposed commands, listing the effective configuration, generating templates, and retrieving the configuration schema.

Install it by registering `npx -y @laragear/mcp-shell` in your MCP client, or add the package to a project with `npm install @laragear/mcp-shell`. Node.js 22 or later is required, and the client configuration uses the standard `mcpServers` command and arguments format.

Define command groups in a project `shell-runner.yaml` or JSON configuration. Each command can specify a label, command line, environment values, argument rules, and output checks. The `config_template` and `config_schema` tools help create configurations with supported keys.

Yes, it works with MCP clients that can run a standard server, including Cursor. Register the server using the `npx` command configuration, then define the commands the agent is allowed to invoke.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Shell AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/laragear-mcp-shell?style=directory)](https://allmcps.com/mcp/laragear-mcp-shell)
HTML Embed
<a href="https://allmcps.com/mcp/laragear-mcp-shell"><img src="https://allmcps.com/api/badge/laragear-mcp-shell?style=directory" alt="MCP Shell on AllMCPs" /></a>