Shell MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Shell MCP Serverlist all files in the current directory including hidden ones"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Shell MCP Server
MCP (Model Context Protocol) server for safe shell command execution.
Features
π Security - Restricted to workspace directory
β±οΈ Timeout enforcement - Prevents hanging commands
π Command history - Track all executed commands
π¦ Environment isolation - Controlled env vars
π Output limits - Prevent memory issues
Tools
execute
Execute a shell command with safety controls.
{
"command": "ls -la",
"cwd": "/root/.openclaw/workspace",
"timeout": 30000,
"env": { "MY_VAR": "value" }
}Parameters:
command(required) - Command to executecwd- Working directory (default: /root/.openclaw/workspace)timeout- Timeout in ms (default: 30000, max: 120000)env- Environment variables object
history
Get command execution history.
{
"limit": 50
}clearHistory
Clear command history.
{}Usage
Direct
cd /root/.openclaw/workspace/shell-mcp-server
npm startWith MCP config (mcporter)
{
"type": "stdio",
"command": "node",
"args": ["/root/.openclaw/workspace/shell-mcp-server/index.js"]
}With Claude Code CLI
claude --mcp-config shell-mcp-server.jsonInstall
cd /root/.openclaw/workspace/shell-mcp-server
npm installTest
npm testSecurity Notes
Commands are restricted to
/root/.openclaw/workspaceand subdirectoriesOutput is limited to 1MB per command
Maximum timeout is 2 minutes
History is saved to
.shell-history.json
Related MCP Connectors
Execute PowerShell commands securely with controlled timeouts and input validation. Retrieve systeβ¦
Execute code in 8 languages (Python, JS, TS, Go, Java, C++, C, Bash) in gVisor sandboxes.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials