Shell Command MCP Server
Execute pre-configured and secure shell commands via a Go-based MCP server.
Shell Command MCP Server
Go server implementing Model Context Protocol (MCP) for executing shell commands.
Features
- Execute shell commands using bash or zsh
- List previous command executions
- Safety features to limit allowed commands
- Configure allowed command set for security
Note: The server will only allow execution of commands specified via the allowedCommands parameter or all commands if configured with "*".
API
Tools
-
execute_command
- Execute a shell command
- Input:
command(string): The command to executeshell(string, optional): The shell to use (bash or zsh, defaults to bash)
- Output:
- Command output with both stdout and stderr
- Exit code
- Execution time
-
list_recent_commands
- List recently executed commands
- Input:
limit(integer, optional): Number of commands to return (defaults to 10)
- Output:
- List of recently executed commands with timestamps and status
-
list_allowed_commands
- List all commands that the server is allowed to execute
- No input required
- Returns:
- List of allowed commands or "*" if all commands are allowed
Usage with Claude Desktop
Install the server
go install github.com/gamunu/mcp-unix-shell
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"shell": {
"command": "mcp-unix-shell",
"args": [
"--allowed-commands=ls,cat,echo,find"
]
}
}
}
To allow all commands (use with caution):
{
"mcpServers": {
"shell": {
"command": "mcp-unix-shell",
"args": [
"--allowed-commands=*"
]
}
}
}
Security Considerations
When using this MCP server, please consider:
- Only allow commands you trust - a restrictive allowlist is recommended
- Avoid allowing commands that could modify system settings or access sensitive data
- The server runs with the permissions of the user running Claude Desktop
- Command output is sent back to the LLM, so be mindful of sensitive information
License
This MCP server is licensed under the Apache License 2.0.
Related Servers
AgentOps MCP
An MCP server for AgentOps, providing observability and evaluation tools for AI agents.
XcodeBuildMCP
Popular MCP server that enables AI agents to scaffold, build, run and test iOS, macOS, visionOS and watchOS apps or simulators and wired and wireless devices. It has powerful UI-automation capabilities like controlling the simulator, capturing run-time logs, as well as taking screenshots and viewing the accessibility hierarchy.
MCP Code Sandbox Server
Execute code securely in isolated sandbox environments using the E2B API.
mcp-sync
Sync MCP server configurations across various AI coding tools.
Agent Engineering Bootcamp MCP
A server providing setup guidance for students learning agent development, with support for both Python and TypeScript.
DDEV MCP Server
Manage DDEV projects, enabling LLM applications to interact with local development environments through the MCP protocol.
Deno Gemini Grounding MCP Server
A Model Context Protocol server that provides access to the connpass users API v2, utilizing Gemini for grounding.
CodeRabbit
Integrate with CodeRabbit AI for automated code reviews, pull request analysis, and report generation.
Kontxt
Indexes local code repositories to provide codebase context to AI clients.
kintone
An MCP server for integrating with the kintone REST API. Supports CRUD operations, file management, comments, and status updates.