CLI MCP Server
@anjumanraut
A simplified MCP server for terminal command execution
Overview
What is CLI MCP Server?
CLI MCP Server is a Model Context Protocol (MCP) server implementation that allows MCP-compatible AI assistants to execute terminal commands in specified directories. It is for developers who want to let AI assistants run shell commands within controlled, user-defined paths.
How to use CLI MCP Server?
Install Node.js v16+ and npm v7+, then clone the repo and run npm install. Start the server by passing allowed directory paths as arguments to start-server.sh (macOS/Linux) or start-server.bat (Windows). Configure Claude by adding the server to its claude_desktop_config.json with the server path and allowed directories.
Key features of CLI MCP Server
- Executes terminal commands via MCP-compatible AI assistants
- Only allows commands in user-specified directories
- Includes path validation to prevent unauthorized access
- Cross-platform support (macOS, Linux, Windows)
- Configurable with Claude Desktop via JSON configuration
Use cases of CLI MCP Server
- Let Claude run file operations or scripts in a project directory
- Automate development tasks like builds or tests through AI conversation
- Execute system commands in a sandboxed, path-restricted environment
FAQ from CLI MCP Server
What directories can the server access?
Only directories provided as command-line arguments when starting the server. The server validates paths to block access outside those directories.
What runtime does CLI MCP Server require?
Node.js v16 or higher and npm v7 or higher.
How do I configure Claude to use this server?
Add an entry under mcpServers in Claude’s configuration file (e.g., claude_desktop_config.json) pointing to the server start script and listing allowed directory paths.
Are there security restrictions?
Yes. The server only executes commands in explicitly allowed directories and performs path validation. The README advises using a dedicated low‑permission user and reviewing all executed commands.
What transport or authentication does the server use?
The README does not mention transport or authentication details.