# mcp-shell

> mcp-shell is an open-source MCP server for developer tools. MCP server giving an LLM policy-controlled access to typed shell and git tools. It is available on CLI, Self-hosted, Linux, macOS and Windows.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, Linux, macOS, Windows
- **Website:** https://sonirico.dev/posts/the-allowlist-that-runs-anything/
- **Repository:** https://github.com/sonirico/mcp-shell
- **GitHub stars:** 115
- **License:** GPL-3.0
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

Most MCP shell servers hand a model a raw command line and hope a filter catches the bad ones. mcp-shell takes a different route: in its default secure mode the client never supplies a shell string, and the server builds a fixed argument list for each typed tool it exposes. Paths are confined to a working directory, and git calls are hardened against repository-level config tricks.

Operators pick what the model can do through a YAML file. Read-only tools are always on, while file and git write tools and named scripts stay off until enabled. An unrestricted mode exists, but it has to be turned on explicitly through an environment variable and then exposes a single unvalidated bash tool.

The project suits developers who want an assistant to inspect a repository, search files or run pre-approved test and lint commands without giving it open-ended terminal access. The maintainer's write-up on earlier allowlist bypasses is also useful reading for anyone building similar tooling.

## Features

- **Typed tools only:** Secure mode registers fixed tools for file reads, search and git inspection instead of a free-form command line.
- **Working directory confinement:** Every path parameter is resolved against a configured directory, following symlinks, and anything outside is rejected.
- **Opt-in write tools:** File edits, moves, deletes and git commits are only exposed when writes_enabled is set in the config.
- **Operator-defined scripts:** Named scripts can be whitelisted so the client chooses a name while the underlying command stays fixed.
- **Hardened git calls:** Git runs without system or global config, with fsmonitor, pager and hooks neutralised and external diff disabled on history commands.
- **Minimal child environment:** Spawned processes receive only PATH, HOME and LANG rather than the server's full environment.

## Good for

- Letting an assistant review git history, blame and diffs in a local repository
- Searching and reading project files with glob and grep without granting a shell
- Running approved test or lint scripts on request from an MCP client
- Giving a coding assistant controlled file edits inside a sandboxed workspace

## FAQ

### Does mcp-shell run in Docker?

Yes. An official image is available, and the README recommends pairing it with an OS sandbox such as a read-only filesystem and dropped capabilities.

### Can the model push or fetch from remote repositories?

No. The README states that there are no network tools and that push, fetch and clone are not offered.

### What happens if no config file is provided?

The server starts in secure mode with typed read-oriented tools only, and write tools and scripts remain disabled.

### Is mcp-shell free?

Yes. mcp-shell is open source, so you can use and self-host it for free.

### What are the best alternatives to mcp-shell?

The closest alternatives to mcp-shell are cmdshellmcp, mcp-shell-server, cli-mcp-server, Ssh Client MCP Server and SSH MCP Server.

## Where this comes from

- Description: written from the project's README and the project's website.

## Alternatives

- [cmdshellmcp](https://ai-powered.com/mcp/cmdshellmcp): cmdshellmcp is an open-source MCP server for developer tools.
- [mcp-shell-server](https://ai-powered.com/mcp/mcp-shell-server): mcp-shell-server is an open-source MCP server for developer tools.
- [cli-mcp-server](https://ai-powered.com/mcp/cli-mcp-server): cli-mcp-server is an open-source MCP server for developer tools.
- [Ssh Client MCP Server](https://ai-powered.com/mcp/ssh-client-mcp-server-2): Ssh Client MCP Server is an open-source MCP server for developer tools.
- [SSH MCP Server](https://ai-powered.com/mcp/ssh-mcp-server): SSH MCP Server is an open-source MCP server for developer tools.
- [MCP Console Automation](https://ai-powered.com/mcp/mcp-console-automation): MCP Console Automation is an open-source MCP server for browser automation.
- [mcp-server-commands](https://ai-powered.com/mcp/mcp-server-commands-2): mcp-server-commands is an open-source MCP server for developer tools.
- [Git MCP](https://ai-powered.com/mcp/git-mcp): Git MCP is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/mcp-shell
