About shell-command-mcp
shell-command-mcp is an MCP server for executing shell commands, launched with npx. It uses an environment variable to restrict which commands can run, making it suitable for letting an assistant run local commands under controlled limits.
Key features
- 01stdio server launched with npx
- 02ALLOWED_COMMANDS variable controls permitted commands
- 03Wildcard option to allow any command
Use cases
- 01Letting Claude run a restricted set of shell commands
- 02Setting an allowlist of read-only commands such as cat, ls and echo
MCP support
This is an MCP server that exposes shell command execution to MCP clients, with the allowed commands set through configuration.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
1Saved tool list · updated 3w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| command | string | Yes | The shell command to execute |
Details
From the project READMEshell-command-mcp
MCP server for executing shell commands.
This project is sponsored by ChatWise, an all-in-one LLM chatbot with first-class MCP support.
Usage
Configure manually
# stdio server
npx -y shell-command-mcp
JSON config
{
"mcpServers": {
"shell-command": {
"command": "npx",
"args": ["-y", "shell-command-mcp"],
"env": {
"ALLOWED_COMMANDS": "cat,ls,echo"
}
}
}
}
Allowed commands
Use ALLOWED_COMMANDS environment variable to explictly allow the commands that this server can run, separate each command by ,. You can use * to allow any command, but this is potentially dangerous.
License
MIT.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.