by mladensu
Execute secure shell commands and manage scp command line Linux tasks with CLI Secure's strict security policies. Protec
Executes shell commands through a secure interface with whitelisting, path validation, and execution controls to safely provide CLI access to AI assistants.
CLI Secure is a community-built MCP server published by mladensu that provides AI assistants with tools and capabilities via the Model Context Protocol. Execute secure shell commands and manage scp command line Linux tasks with CLI Secure's strict security policies. Protec It is categorized under auth security, developer tools.
You can install CLI Secure in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
MIT
CLI Secure is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Share your MCP server with the developer community
CLI Secure has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
Useful MCP listing: CLI Secure is the kind of server we cite when onboarding engineers to host + tool permissions.
CLI Secure is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
CLI Secure reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
Strong directory entry: CLI Secure surfaces stars and publisher context so we could sanity-check maintenance before adopting.
Strong directory entry: CLI Secure surfaces stars and publisher context so we could sanity-check maintenance before adopting.
CLI Secure is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
CLI Secure has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
We evaluated CLI Secure against two servers with overlapping tools; this profile had the clearer scope statement.
According to our notes, CLI Secure benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
showing 1-10 of 38
A secure Model Context Protocol (MCP) server implementation for executing controlled command-line operations with comprehensive security features.
<a href="https://glama.ai/mcp/servers/q89277vzl1"><img width="380" height="200" src="https://glama.ai/mcp/servers/q89277vzl1/badge" /></a>
This MCP server enables secure command-line execution with robust security measures including command whitelisting, path validation, and execution controls. Perfect for providing controlled CLI access to LLM applications while maintaining security.
Configure the server using environment variables:
| Variable | Description | Default |
|---|---|---|
ALLOWED_DIR | Base directory for command execution (Required) | None (Required) |
ALLOWED_COMMANDS | Comma-separated list of allowed commands or 'all' | ls,cat,pwd |
ALLOWED_FLAGS | Comma-separated list of allowed flags or 'all' | -l,-a,--help |
MAX_COMMAND_LENGTH | Maximum command string length | 1024 |
COMMAND_TIMEOUT | Command execution timeout (seconds) | 30 |
ALLOW_SHELL_OPERATORS | Allow shell operators (&&, ||, |, >, etc.) | false |
Note: Setting ALLOWED_COMMANDS or ALLOWED_FLAGS to 'all' will allow any command or flag respectively.
To install CLI MCP Server for Claude Desktop automatically via Smithery:
npx @smithery/cli install cli-mcp-server --client claude
Executes whitelisted CLI commands within allowed directories.
Input Schema:
{
"command": {
"type": "string",
"description": "Single command to execute (e.g., 'ls -l' or 'cat file.txt')"
}
}
Security Notes:
ALLOW_SHELL_OPERATORS=trueDisplays current security configuration and restrictions, including:
Add to your ~/Library/Application\ Support/Claude/claude_desktop_config.json:
Development/Unpublished Servers Configuration
{
"mcpServers": {
"cli-mcp-server": {
"command": "uv",
"args": [
"--directory",
"<path/to/the/repo>/cli-mcp-server",
"run",
"cli-mcp-server"
],
"env": {
"ALLOWED_DIR": "</your/desired/dir>",
"ALLOWED_COMMANDS": "ls,cat,pwd,echo",
"ALLOWED_FLAGS": "-l,-a,--help,--version",
"MAX_COMMAND_LENGTH": "1024",
"COMMAND_TIMEOUT": "30",
"ALLOW_SHELL_OPERATORS": "false"
}
}
}
}
Published Servers Configuration
{
"mcpServers": {
"cli-mcp-server": {
"command": "uvx",
"args": [
"cli-mcp-server"
],
"env": {
"ALLOWED_DIR": "</your/desired/dir>",
"ALLOWED_COMMANDS": "ls,cat,pwd,echo",
"ALLOWED_FLAGS": "-l,-a,--help,--version",
"MAX_COMMAND_LENGTH": "1024",
"COMMAND_TIMEOUT": "30",
"ALLOW_SHELL_OPERATORS": "false"
}
}
}
}
In case it's not working or showing in the UI, clear your cache via
uv clean.
ALLOW_SHELL_OPERATORS=true)The server provides detailed error messages for:
To prepare the package for distribution:
Sync dependencies and update lockfile:
uv sync
Build package distributions:
uv build
This will create source and wheel distributions in the
dist/directory.
Publish to PyPI:
uv publish --token {{YOUR_PYPI_API_TOKEN}}
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with
this command:
npx @modelcontextprotocol/inspector uv --directory {{your source code local directory}}/cli-mcp-server run cli-mcp-server
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
This project is licensed under the MIT License - see the LICENSE file for details.
For more information or support, please open an issue on the project repository.
Prerequisites
Time Estimate
15-60 minutes depending on server complexity
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
Compatibility
✓ Use when
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid when
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.