# cli-mcp-server

> cli-mcp-server is an open-source MCP server for developer tools. MCP server that lets AI clients run whitelisted command-line operations inside a locked. It is available on CLI, API and Self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted
- **Repository:** https://github.com/mladensu/cli-mcp-server
- **GitHub stars:** 177
- **License:** MIT
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This server gives AI clients controlled access to a shell-style command runner. Operators decide which commands and flags are permitted, and every path is checked against a single base directory before anything runs, so an assistant can inspect files or run approved tools without open-ended system access.

Each request is validated before execution: command and flag whitelists are enforced, shell operators such as pipes and redirects are blocked unless explicitly enabled, symlinks are resolved, and runs are cut off by a configurable timeout and maximum command length. A separate tool reports the active security configuration so the client can see what it is allowed to do.

It suits developers wiring Claude Desktop or other MCP-compatible clients to a project folder who want read-only style access to tools like ls, cat or pwd, with settings adjusted through environment variables.

## Features

- **Command whitelisting:** Only commands listed in the allowed set can run, with an option to permit everything.
- **Flag validation:** Each command's flags are checked against a configurable allow list before execution.
- **Directory confinement:** All paths are normalised and resolved, including symlinks, and must stay inside the configured base directory.
- **Shell operator blocking:** Pipes, redirects and chaining operators are rejected unless turned on through an environment setting.
- **Execution limits:** Commands are bounded by a maximum length and a timeout that can be set in seconds.
- **Security rules inspection:** A dedicated tool shows the current working directory, allowed commands, flags and limits.

## Good for

- Letting an AI assistant list and read files inside a project folder
- Giving an LLM client limited access to git or other approved CLI tools
- Testing MCP client integrations against a sandboxed command runner
- Auditing which commands an AI assistant is permitted to execute

## Tools

From the tool list in its README, going by the names, 1 of 2 tools changes data. From the server's own tool labels and tool names; not verified by us.

- `run_command` (name suggests: changes): Executes whitelisted CLI commands within allowed directories.
- `show_security_rules` (name suggests: reads): Displays current security configuration and restrictions.

## FAQ

### How is the server installed?

It can be added to Claude Desktop's configuration file using uvx or a local uv project path, or installed automatically through Smithery.

### Are shell operators allowed by default?

No. Operators such as &&, | and > are blocked unless ALLOW_SHELL_OPERATORS is set to true.

### Which commands are available out of the box?

By default the whitelist includes ls, cat and pwd, with -l, -a and --help as allowed flags.

### What license does cli-mcp-server use?

The project is released under the MIT License.

### Is cli-mcp-server free?

Yes. cli-mcp-server is open source, so you can use and self-host it for free.

### What are the best alternatives to cli-mcp-server?

The closest alternatives to cli-mcp-server are cmdshellmcp, mcp-shell-server, mcp-shell, mcp-linux-tools and mcp-server-commands.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [cmdshellmcp](https://ai-powered.com/mcp/cmdshellmcp): cmdshellmcp is an open-source MCP server for developer tools.
- [mcp-shell-server](https://ai-powered.com/mcp/mcp-shell-server): mcp-shell-server is an open-source MCP server for developer tools.
- [mcp-shell](https://ai-powered.com/mcp/mcp-shell): mcp-shell is an open-source MCP server for developer tools.
- [mcp-linux-tools](https://ai-powered.com/mcp/mcp-linux-tools): mcp-linux-tools is an open-source MCP server for developer tools.
- [mcp-server-commands](https://ai-powered.com/mcp/mcp-server-commands-2): mcp-server-commands is an open-source MCP server for developer tools.
- [MCP Console Automation](https://ai-powered.com/mcp/mcp-console-automation): MCP Console Automation is an open-source MCP server for browser automation.
- [Imali Commander](https://ai-powered.com/mcp/imali-commander): Imali Commander is a freemium MCP server for developer tools.
- [Cygnus Ssh MCP](https://ai-powered.com/mcp/cygnus-ssh-mcp): Cygnus Ssh MCP is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/cli-mcp-server
