Run a shell command and return its output. Can execute any command available to the user running the server, such as 'ls -al', 'hostname', or 'echo "hello world"'. Returns both STDOUT and STDERR as text. Optionally accepts stdin input for passing to commands like bash, python, or for creating files.
Command Runner is a Model Context Protocol server that allows AI assistants to execute shell commands on your system. It provides a secure way for LLMs to interact with your command line, enabling them to run commands like file operations, system information queries, or even execute scripts in languages like Python, Bash, or Fish. With Command Runner, your AI assistant can help with tasks that require command line access, such as checking system status, managing files, or running code snippets. The server returns both standard output and standard error from commands, and supports passing input through stdin, making it versatile for a wide range of command line operations.
Command Runner enables AI assistants to execute shell commands on your system, providing a bridge between natural language interactions and command line operations. This tool is particularly useful for developers, system administrators, and power users who want their AI assistant to help with tasks that require command line access.
You can install Command Runner using npm:
npm install mcp-server-commands
To use Command Runner with Claude Desktop, you need to add the server configuration to your Claude Desktop config file:
On macOS:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows:
Edit %APPDATA%/Claude/claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"mcp-server-commands": {
"command": "npx",
"args": ["mcp-server-commands"]
}
}
}
For Groq Desktop (beta, macOS), edit ~/Library/Application Support/groq-desktop-app/settings.json
with similar configuration.
If you prefer to use a local build from a repository checkout:
npm install
to install dependenciesnpm run build
to build the server{
"mcpServers": {
"mcp-server-commands": {
"command": "/path/to/mcp-server-commands/build/index.js"
}
}
}
Once installed and configured, your AI assistant can run commands on your system. For security reasons, it's recommended to use the "Approve Once" option in Claude Desktop to review each command before execution.
sudo
)Command Runner logs important messages (such as errors) by default. For more detailed logging, add --verbose
to the args
in your configuration:
{
"mcpServers": {
"mcp-server-commands": {
"command": "npx",
"args": ["mcp-server-commands", "--verbose"]
}
}
}
Claude Desktop writes logs to ~/Library/Logs/Claude/mcp-server-mcp-server-commands.log
.
For debugging purposes, you can use the MCP Inspector:
npm run inspector
This will provide a URL to access debugging tools in your browser, which can help troubleshoot any issues with the server.