skillfed

cli-mcp-server

Command line interface for MCP clients with secure execution and customizable security policies

cli-mcp-server v0.2.5 82.1K downloads/30d#14,182 on PyPI177
License unclear AGING released

What it is and what it does

CLI MCP Server is a Python package that implements the Model Context Protocol (MCP) as a secure server for command-line execution. It bridges LLM applications (like Claude Desktop) and the shell by exposing two tools: run_command (to execute whitelisted CLI commands) and show_security_rules (to display current restrictions). The server enforces security through command and flag whitelisting, path validation to prevent traversal attacks, shell operator blocking, execution timeouts, and working directory restrictions—all configured via environment variables.

You use it by installing the package, configuring it with allowed commands and a base directory, and registering it as an MCP server in your LLM client (typically Claude Desktop). Once running, the LLM can invoke commands only within the whitelist and the allowed directory, making it safe to grant controlled shell access to AI agents without exposing the full system.

Use it for:

  • Give Claude Desktop controlled access to run file operations (ls, cat, pwd) on a specific project directory without exposing the entire filesystem.
  • Allow an LLM agent to execute build or test commands (e.g., pytest, make) within a sandbox directory as part of a development workflow.
  • Provide a secure interface for an AI application to query system information (e.g., echo, uname) without allowing arbitrary command execution.
  • Integrate with MCP-compatible LLM clients to enable auditable, whitelisted CLI automation while maintaining security boundaries.
  • Debug and test MCP server behavior using the MCP Inspector for local development and integration testing.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a secure Model Context Protocol (MCP) server that allows LLM applications to execute whitelisted command-line operations with configurable security policies, command validation, and execution controls.

Yes, with conditions. Install if you need to safely expose CLI access to an LLM application and are comfortable configuring environment variables and managing a whitelist. The low install friction and clear security model make it straightforward to set up. However, verify the actual license in the repository first (metadata is unclear), and be aware that maintenance is aging—last release was 406 days ago. No known vulnerabilities are recorded, but the security features (injection protection, path validation) should be reviewed for your threat model before use in production.

Install

cli-mcp-server on PyPI

pip

pip install cli-mcp-server

uv

uv add cli-mcp-server

poetry

poetry add cli-mcp-server

Installing cli-mcp-server

Before you install

Low install friction with a single runtime dependency (mcp). Maintenance status is aging—last release was 406 days ago, though the repository remains active with 177 stars and no archived status. Suitable for projects that can tolerate infrequent updates.

License in practice

License treatment is unclear: no SPDX identifier or raw license string is recorded in the package metadata, despite the description mentioning MIT licensing. Verify the actual license terms in the repository before use in proprietary or restricted contexts.

Quickstart

pip install cli-mcp-server

# Add to Claude Desktop config (~/Library/Application\ Support/Claude/claude_desktop_config.json):
# {
#   "mcpServers": {
#     "cli-mcp-server": {
#       "command": "uvx",
#       "args": ["cli-mcp-server"],
#       "env": {
#         "ALLOWED_DIR": "/your/safe/dir",
#         "ALLOWED_COMMANDS": "ls,cat,pwd"
#       }
#     }
#   }
# }

Requires Python 3.10 or later. Requires mcp runtime dependency. Must set ALLOWED_DIR environment variable before the server will start.

Verify before relying

  • Whether the MIT license mentioned in the description is actually applied to the package on PyPI, given the unclear metadata.
  • Current maintenance cadence and whether 406 days since last release indicates active development or dormancy.
  • Whether shell operator injection protection and path traversal prevention have been independently audited for security.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — mcp
Maintenance aging — 406 days since the last release
Last repo commit
First released
Downloads 82,121/month — #14,182 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cli_mcp_server-0.2.5-py3-none-any.whl

Tags

mcp server command executionsecure cli for llmcommand whitelist validationmcp protocol implementationcontrolled shell accessclaude desktop integrationcommand security sandbox
mcp-protocolllm-integrationsecurity-sandbox

More Utilities packages

Further reading