CLI Exec
About
Provides powerful CLI command execution capabilities, enabling structured output for shell commands with features like timeout handling, ANSI code stripping, and error management for system administration and DevOps workflows.
Details
- Author
- jakenuts
- Repository
- jakenuts/mcp-cli-exec
- GitHub stars
- 7
- Downloads
- 1,573
- Categories
- Developer Tools, Infrastructure, Other, Productivity, Design, AI, Automation, Frontend
Jump to
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
CLI ExecCommand (node, npx, python, etc.)npxArguments-
Argument 1
-y -
Argument 2
mcp-cli-exec
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
Argument 1
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
cli-exec-raw
Execute a raw CLI command and return structured output. Takes a command string and optional timeout (default: 5 minutes). Returns detailed execution results including stdout, stderr, exit code, and handles errors gracefully.
cli-exec
Execute one or more CLI commands in a specific working directory. Supports single commands, && chained commands, or an array of commands. Returns detailed results for each command including success/failure status, exit code, stdout and stderr (ANSI codes stripped), execution duration, and working directory. Stops on first command failure and has an optional timeout per command (default: 5 minutes).
cli-exec-raw
Execute a raw CLI command and return structured output - Takes a command string and optional timeout (default: 5 minutes) - Returns detailed execution results including stdout, stderr, exit code - Handles errors gracefully with structured error responsescli-exec
Execute one or more CLI commands in a specific working directory - Supports single commands, && chained commands, or array of commands - All commands execute in the specified working directory - Returns detailed results for each command: - Success/failure status - Exit code - stdout and stderr (ANSI codes stripped) - Execution duration - Working directory - Stops on first command failure - Optional timeout per command (default: 5 minutes)Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"cli exec": {
"cwd": "~/Library/Application Support/Claude",
"env": {},
"args": [
"-y",
"mcp-cli-exec"
],
"command": "npx"
}
}
}
Linux
{
"env": [],
"args": [
"-y",
"mcp-cli-exec"
],
"command": "npx"
}
Macos
{
"cwd": "~/Library/Application Support/Claude",
"env": [],
"args": [
"-y",
"mcp-cli-exec"
],
"command": "npx"
}
Windows
{
"cwd": "%APPDATA%/Claude",
"env": [],
"args": [
"C:\\Users\\jim\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npx-cli.js",
"-y",
"mcp-cli-exec"
],
"command": "C:\\Users\\jim\\AppData\\Roaming\\nvm\\v22.1.0\\node.exe"
}
A powerful CLI command execution MCP server that enables running shell commands with structured output. This package focuses specifically on command execution functionality, differentiating it from other MCP CLI tools.
Execute a raw CLI command and return structured output
- Takes a command string and optional timeout (default: 5 minutes)
- Returns detailed execution results including stdout, stderr, exit code
- Handles errors gracefully with structured error responses
Execute one or more CLI commands in a specific working directory
- Supports single commands, && chained commands, or array of commands
- All commands execute in the specified working directory
- Returns detailed results for each command:
- Success/failure status
- Exit code
- stdout and stderr (ANSI codes stripped)
- Execution duration
- Working directory
Note: Due to execution context limitations, each command runs independently. Directory changes (cd) within commands do not affect subsequent commands. All commands execute in the initially specified working directory.
Commands return structured results including:
- Success/failure status
- Exit code
- stdout and stderr (with ANSI codes stripped)
- Execution duration
- Working directory
- Detailed error information if applicable
{ "command": "echo Hello World" }
{ "command": "long-running-script.sh", "timeout": 300000 }
{ "workingDirectory": "/path/to/project", "commands": "npm install" }
Multiple commands (all run in the same working directory):
{ "workingDirectory": "C:\\project", "commands": [ "dir /b", "npm run build" ] }
npm install -g mcp-cli-exec # or with pnpm pnpm add -g mcp-cli-exec
Add to%APPDATA%/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json:
{ "mcpServers": { "mcp-cli-exec": { "command": "npx", "args": ["-y", "mcp-cli-exec"] } } }
Windows:%APPDATA%/Claude/claude_desktop_config.jsonMacOS:~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "mcp-cli-exec": { "command": "npx", "args": ["-y", "mcp-cli-exec"] } } }
If you encounter the ENOENT spawn npx issue on Windows, use this alternative configuration that specifies the full paths:
{ "mcpServers": { "mcp-cli-exec": { "command": "C:\\Users\\jim\\AppData\\Roaming\\nvm\\v22.1.0\\node.exe", "args": [ "C:\\Users\\jim\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npx-cli.js", "-y", "mcp-cli-exec" ] } } }
Since MCP servers communicate over stdio, debugging can be challenging. The MCP Inspector provides helpful debugging tools:
This will provide a URL to access the inspector in your browser, where you can:
- View all MCP messages
- Inspect request/response payloads
- Test tools interactively
- Monitor server state
The server includes comprehensive error handling:
- Input validation for all tool parameters
- Structured error responses
- Command timeout handling
- Working directory validation
- ANSI code stripping for clean output
- Built with TypeScript and the MCP SDK
- Uses execa for reliable command execution
- Default command timeout: 5 minutes
- Supports Windows and Unix-like systems (use appropriate commands for your OS, e.g., 'dir' vs 'ls')
- Executes commands sequentially, stopping on first failure
- Each command runs independently in the specified working directory
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Execute shell commands without permission prompts.
Execute bash commands on the host machine.
A secure MCP server for executing controlled command-line operations with comprehensive security features.
MCP server for controlling cmux (Ghostty-based terminal) via native CLI. Send commands, read output, send control characters — all in background via Unix socket.
Execute pre-approved shell commands securely on a server.
A secure MCP server for executing terminal commands with controlled directory access and command permissions.
A shell command / terminal executor with async support
A high-performance MCP server for the headless terminal (ht), implemented in Rust.
Execute terminal commands through a secure shell interface using an AI assistant.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





