Skip to content
MCP server

cmdshellmcp

Allowlist-restricted command-shell MCP server for giving AI agents limited local file

Actively maintained

The repository was last updated 5 days ago and is published under MIT.

cmdshellmcp is an open-source MCP server for developer tools. It is available on CLI, API, Self-hosted and Linux.

Pricing
Open source
Platforms
CLI, API, Self-hosted
What it can do
Can delete data (1 tool)
GitHub stars
4
Last commit

Similar MCP servers

About cmdshellmcp

cmdshellmcp lets an MCP client run a curated set of Unix commands and perform file reads, writes, copies and deletions within a chosen working directory, without handing the agent a full terminal. Commands are passed as a name plus an argument list, and every command must appear on an allowlist defined in a JSON config file. Piping and redirection are not supported.

Beyond shell commands, the server exposes tools for scripted text edits with GNU sed that leave numbered backups and return unified diffs, unified diff patch application through GNU patch, and HTTP fetching with optional HTML prettification. Bearer token authentication is on by default, and audit logging can go to stdout or a file.

The project is aimed at developers who want an AI coding agent to inspect a project, make reviewable changes and fetch documentation in a contained setup, typically inside a disposable container. The README repeatedly warns that allowlisted interpreters or file-writing commands can defeat the restrictions, so it is not a general-purpose hardened sandbox.

Tools this server provides (12)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 1 of 12 tools deletes data and 4 change data; 4 names don't say.

From the server's own tool labels and tool names; not verified by us.

cmdshell
Runs one configured Unix command with arguments.
writeFileName suggests: changes
Writes text to a file beneath the current working directory.
readFileName suggests: reads
Reads a UTF-8 text file beneath the current working directory.
listFilesName suggests: reads
Lists the entries in a directory beneath the configured working directory.
copyFile
Copies a regular file beneath the configured working directory.
moveRenameFileName suggests: changes
Moves or renames a regular file.
deleteFileName suggests: deletes
Deletes a regular file.
mkdir
Creates one directory.
rmdir
Removes one empty directory.
editFileName suggests: changes
Edits an existing text file using GNU sed with numbered backups.
applyPatchName suggests: changes
Applies a unified diff to one named file using GNU patch.
fetchName suggests: reads
Fetches a URL, optionally prettifying HTML.

What it does

Allowlisted command execution
Runs only commands named in a config allowlist, passed as an argument array rather than a raw shell string.
Scoped file operations
Reads, writes, lists, copies, moves and deletes files under a configured working directory using lexical path checks.
Reviewable sed edits
Applies sed scripts in sandbox mode with numbered backups and returns a unified diff for each edit.
Patch application
Applies unified diffs to a named file via GNU patch while blocking path-changing options.
Token authentication and audit logs
Generates a bearer token by default and records audit events to stdout or a log file.
Docker sandbox setup
Includes a Dockerfile, setup scripts and a systemd unit for running the server in a Debian container.

Good for

  • Letting a coding agent inspect repository and log files in a project folder
  • Making small, reviewable text substitutions with automatic backups
  • Applying small patches proposed by an AI model
  • Fetching documentation pages for an agent during a local task
  • Running a limited set of diagnostic commands on a disposable machine

Pricing

Open source

Free, MIT licensed, self-hosted

cmdshellmcp FAQ

How does the server decide which commands can run?

Only commands listed in the allowed_commands config key, or passed with --allow, can be executed. Command names are checked before execution.

Are pipes or redirects supported?

No. Piping and redirects are not allowed, and arguments are passed as a list instead of a shell string.

Does cmdshellmcp require authentication?

Yes, bearer token authentication is enabled by default. A random token is generated at startup unless a fixed token is configured, and --noauth disables it.

What transports does cmdshellmcp support?

It runs over streamable HTTP by default on 127.0.0.1:8003, with an --sse option for SSE transport and a --stdio mode.

Is cmdshellmcp free?

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

What are the best alternatives to cmdshellmcp?

The closest alternatives to cmdshellmcp are mcp-shell-server, mcp-shell, cli-mcp-server, Sandbox Env MCP and mcp-linux-tools.

Where this comes from

  • Description: written from the project's README.

How AIPoweredBot checks servers