Cli MCP Server logo

Cli MCP Server

by MladenSU

Executes whitelisted CLI commands inside a restricted directory with configurable validation, timeouts, and shell protections.

Install Cli MCP Server

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for MladenSU/cli-mcp-server, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

MladenSU/cli-mcp-server MCP server lets an MCP client run approved command-line operations within a configured directory. It validates commands, flags, paths, shell operators, command length, and execution time before running them. The server exposes command execution and security-rule inspection over stdio, with configuration supplied through environment variables. Reach for it when an agent needs controlled local CLI access rather than unrestricted shell execution.

Use cases

  • Run approved file-inspection commands within a designated directory
  • Restrict agent CLI access with command and flag allowlists
  • Inspect active execution and security rules
  • Enforce command timeouts and maximum command lengths

Key features

  • Whitelisted command execution
  • Configurable flag validation
  • Restricted working-directory access
  • Path traversal and symlink checks
  • Shell operator blocking
  • Timeout and command-length limits

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

10/10 checks healthy over the last 79d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8/23/2026 via OSV.dev

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars177Stargazers on the source repository.
Last commit1y agoMost recent push to the default branch.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How Cli MCP Server works

What MladenSU/cli-mcp-server MCP server does

MladenSU/cli-mcp-server MCP server exposes a restricted command-line interface through MCP. It is intended for setups where an AI application needs to inspect files, query directories, or run other approved commands without granting unrestricted shell access. The server applies policy checks before execution and limits operations to a configured base directory.

The project targets Python 3.10 or newer and is distributed under the MIT License. It communicates over stdio, making it suitable for local MCP clients such as Claude Desktop.

How it works

The server reads its execution policy from environment variables. ALLOWED_DIR defines the directory boundary, while ALLOWED_COMMANDS and ALLOWED_FLAGS specify which commands and options may be used. Both allow the special value all, although using that value removes the corresponding whitelist restriction.

Each request is passed through validation before execution. Path normalization, traversal checks, and symlink resolution help keep file access within the permitted directory. Shell operators such as &&, pipes, and redirection are blocked by default and can be enabled explicitly with ALLOW_SHELL_OPERATORS=true.

Execution is also constrained by MAX_COMMAND_LENGTH and COMMAND_TIMEOUT. The default command length is 1024 characters and the default timeout is 30 seconds. Validation or execution failures are reported with specific error categories, including security, timeout, path, format, and command execution errors.

Setup and configuration

MladenSU/cli-mcp-server MCP server can be launched from its published package with uvx cli-mcp-server, or from a checked-out repository using the documented uv command. A working configuration must provide ALLOWED_DIR; the other settings have defaults.

For Claude Desktop, add an MCP server entry that uses uvx with cli-mcp-server as its argument. Put the policy variables in that entry’s env object. A typical policy might allow ls, cat, and pwd, permit selected flags, retain the 1024-character limit, use a 30-second timeout, and leave shell operators disabled.

Developers working from source can synchronize dependencies with uv sync and build distributions with uv build. The repository also documents publishing through uv publish, which requires a PyPI token.

Tools and capabilities

MladenSU/cli-mcp-server MCP server provides two documented tools:

  • run_command accepts one command string, such as ls -l or cat file.txt, and executes it after policy validation.
  • show_security_rules reports the active working directory, command and flag allowlists, maximum command length, and timeout.

The implementation supports asynchronous operations and returns detailed errors when requests violate the configured rules or when execution fails.

Limitations and notes

This server does not provide unrestricted shell access by default. Commands and flags must be allowed, paths must remain under ALLOWED_DIR, and shell operators remain unavailable unless explicitly enabled. Setting either whitelist to all broadens access and should be evaluated against the intended security boundary.

Because the server runs over stdio, client configuration must start the local process rather than connect to a hosted endpoint. The project recommends MCP Inspector for debugging stdio-based development configurations.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Cli MCP Server

Use the published package with `uvx cli-mcp-server`, or configure Claude Desktop to run `uvx` with `cli-mcp-server` as its argument.

Yes. The README provides Claude Desktop configuration examples for both a published package and a local development checkout.

`ALLOWED_DIR` is required. `ALLOWED_COMMANDS`, `ALLOWED_FLAGS`, `MAX_COMMAND_LENGTH`, `COMMAND_TIMEOUT`, and `ALLOW_SHELL_OPERATORS` configure command policy and execution limits.

It validates commands and flags against allowlists, confines paths to `ALLOWED_DIR`, blocks shell operators by default, and applies length and timeout limits.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCli MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mladensu-cli-mcp-server?style=directory)](https://allmcps.com/mcp/mladensu-cli-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/mladensu-cli-mcp-server"><img src="https://allmcps.com/api/badge/mladensu-cli-mcp-server?style=directory" alt="Cli MCP Server on AllMCPs" /></a>