Back to MCP Catalog

Command Runner MCP Server

Command LineTypeScript
Run shell commands directly from your AI assistant
Available Tools

run_command

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.

commandstdin

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.

Overview

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.

Installation

You can install Command Runner using npm:

npm install mcp-server-commands

Configuration

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.

Alternative: Local Build

If you prefer to use a local build from a repository checkout:

  1. Clone the repository
  2. Run npm install to install dependencies
  3. Run npm run build to build the server
  4. Configure your AI client to use the local build:
{
  "mcpServers": {
    "mcp-server-commands": {
      "command": "/path/to/mcp-server-commands/build/index.js"
    }
  }
}

Usage

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.

Security Considerations

  • Be careful what commands you allow the AI to run
  • Review each command before approving it
  • The server runs with the same permissions as the user running the AI client
  • Never run the server with elevated privileges (e.g., sudo)

Logging

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.

Debugging

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.

Related MCPs

iTerm Terminal Control
Command LineTypeScript

Execute and interact with commands in your active iTerm terminal session

CLI Command Executor
Command LinePython

Secure command-line interface with customizable security policies

Shell Command Executor
Command LinePython

A secure shell command execution server for running whitelisted commands

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.