- Home
- MCP servers
- MCP CLI Exec
MCP CLI Exec
- typescript
9
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"jakenuts-mcp-cli-exec": {
"command": "npx",
"args": [
"-y",
"mcp-cli-exec"
]
}
}
}You can run shell commands through this MCP server and get structured results for stdout, stderr, exit codes, and timings. It’s useful when you need repeatable, programmatic command execution with clear feedback in an MCP workflow.
How to use
You interact with the MCP server through an MCP client. You specify a working directory and one or more commands to execute. The server runs commands in the given directory, returns a detailed result for each command, and stops on the first failure if you chain multiple commands. Each result includes the success status, exit code, stdout, stderr (with ANSI codes removed), execution duration, and the working directory used.
How to install
Prerequisites: ensure you have Node.js and a package manager available on your system.
Install the MCP server package globally using npm or pnpm.
Then you can run the server or use it via an MCP client as described in the usage sections.
# Install with npm
npm install -g mcp-cli-exec
# Or install with pnpm
pnpm add -g mcp-cli-exec
Configuration and important notes
Two common ways to configure this MCP server in your environment are shown for local usage and integration with tools that manage MCP servers.
Using a local MCP client (example configurations) can be provided as JSON blocks for your environment. The examples assume the MCP client will invoke the server via a standard in-process command runner like npx.
{
"mcpServers": {
"mcp_cli_exec": {
"command": "npx",
"args": ["-y", "mcp-cli-exec"]
}
}
}
Troubleshooting and tips
If you run into issues, check that the Node.js and package manager versions you’re using are compatible with the MCP server. Ensure the global install completed successfully and that the MCP client can locate the mcp-cli-exec binary in your PATH.
If you encounter environmental differences between operating systems, remember to use appropriate shell commands for your platform (for example, dir on Windows vs ls on Unix-like systems).
Notes
This server focuses specifically on executing CLI commands and returning structured results. It uses a text-based interface to run commands and provides clear, machine-readable feedback suitable for automation and scripting workflows.
Available tools
cli-exec-raw
Execute a raw CLI command and return structured output including stdout, stderr, and exit code with an optional timeout.
cli-exec
Execute one or more CLI commands in a specified working directory, supporting single commands, chained commands, or an array of commands. Returns per-command results with status, exit code, stdout, stderr, duration, and working directory.