mcp shell
A Node.js implementation of the Model Context Protocol that provides secure shell command execution capabilities, allowing AI models like Claude to run shell commands in a controlled environment with built-in security measures.
A Node.js implementation of the Model Context Protocol that provides secure shell command execution capabilities, allowing AI models like Claude to run shell commands in a controlled environment with built-in security measures.
A Node.js implementation of the Model Context Protocol (MCP) that provides secure shell command execution capabilities. This server allows AI models to execute shell commands in a controlled environment with built-in security measures. Easily integrates with Claude Desktop for connecting Claude with your shell.
Run npx mcp-shell
.
To add it to Claude Desktop, run npx mcp-shell config
. Or add npx -y mcp-shell
to your config manually.
Start (or restart) Claude Desktop and you should see the MCP tool listed on the landing page.
The server implements several security measures:
Command Blacklisting
Prevents execution of dangerous system commands
Prevents privilege escalation
Command Validation
The server provides one tool:
Executes a shell command and returns its output.
Input Schema:
{
"type": "object",
"properties": {
"command": { "type": "string" }
}
}
Response:
The following command categories are blocked for security:
The server includes comprehensive error handling:
The server is built using:
To modify the security settings, you can:
BLACKLISTED_COMMANDS
set to adjust blocked commandsvalidateCommand
function to add additional validation rulesCallToolRequestSchema
handler[
{
"description": "Run a shell command",
"inputSchema": {
"properties": {
"command": {
"type": "string"
}
},
"type": "object"
},
"name": "run_command"
}
]