{"type":"mcp_server","name":"cli-mcp-server","description":"This repository provides a secure Model Context Protocol (MCP) server for controlled command-line execution, featuring command whitelisting, path validation, and protection against shell operator injection, ensuring secure LLM application integration.","category":"Developer Tools","language":"Python","stars":172,"forks":11,"owner":"MladenSU","github_url":"https://github.com/MladenSU/cli-mcp-server","homepage":null,"setup":"## Setup\nTo install CLI MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/protocol/cli-mcp-server):\n\n```bash\nnpx @smithery/cli install cli-mcp-server --client claude\n```\n\nAdd to your `~/Library/Application\\ Support/Claude/claude_desktop_config.json`:\n\n> Development/Unpublished Servers Configuration\n\n```json\n{\n  \"mcpServers\": {\n    \"cli-mcp-server\": {\n      \"command\": \"uv\",\n      \"args\": [\n        \"--directory\",\n        \"<path/to/the/repo>/cli-mcp-server\",\n        \"run\",\n        \"cli-mcp-server\"\n      ],\n      \"env\": {\n        \"ALLOWED_DIR\": \"</your/desired/dir>\",\n        \"ALLOWED_COMMANDS\": \"ls,cat,pwd,echo\",\n        \"ALLOWED_FLAGS\": \"-l,-a,--help,--version\",\n        \"MAX_COMMAND_LENGTH\": \"1024\",\n        \"COMMAND_TIMEOUT\": \"30\"\n      }\n    }\n  }\n}\n```\n\n> Published Servers Configuration\n\n```json\n{\n  \"mcpServers\": {\n    \"cli-mcp-server\": {\n      \"command\": \"uvx\",\n      \"args\": [\n        \"cli-mcp-server\"\n      ],\n      \"env\": {\n        \"ALLOWED_DIR\": \"</your/desired/dir>\",\n        \"ALLOWED_COMMANDS\": \"ls,cat,pwd,echo\",\n        \"ALLOWED_FLAGS\": \"-l,-a,--help,--version\",\n        \"MAX_COMMAND_LENGTH\": \"1024\",\n        \"COMMAND_TIMEOUT\": \"30\"\n      }\n    }\n```\n> In case it's not working or showing in the UI, clear your cache via `uv clean`.\n","tools":"## Available Tools\n\n1.  run_command (Executes whitelisted CLI commands within allowed directories.)\n2.  show_security_rules (Displays current security configuration and restrictions.)","faq":null,"created_at":"2024-12-08T23:01:54+00:00","updated_at":"2025-03-28T19:10:21+00:00","source_url":"https://model-context-protocol.com/servers/cli-mcp-server-secure-command-execution","related_articles":[]}