CLI MCP Server
Table of Contents
- Overview
- Features
- Configuration
- Available Tools
- Usage with Claude Desktop
- Security Features
- Error Handling
- Development
- License
Overview
Features
- Secure command execution with strict validation
- Configurable command and flag whitelisting with 'all' option
- Path traversal prevention and validation
- Shell operator injection protection
- Execution timeouts and length limits
- Detailed error reporting
- Async operation support
- Working directory restriction and validation
Configuration
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
ALLOWED_COMMANDS or ALLOWED_FLAGS to 'all' will allow any command or flag respectively.Installation
Available Tools
run_command
- Shell operators (&&, |, >, >>) are not supported by default, but can be enabled with
ALLOW_SHELL_OPERATORS=true
- Commands must be whitelisted unless ALLOWED_COMMANDS='all'
- Flags must be whitelisted unless ALLOWED_FLAGS='all'
- All paths are validated to be within ALLOWED_DIR
show_security_rules
- Working directory
- Allowed commands
- Allowed flags
- Security limits (max command length and timeout)
Usage with Claude Desktop
~/Library/Application\ Support/Claude/claude_desktop_config.json:Development/Unpublished Servers Configuration
Published Servers Configuration
In case it's not working or showing in the UI, clear your cache viauv clean.
Security Features
- Command whitelist enforcement with 'all' option
- Flag validation with 'all' option
- Path traversal prevention and normalization
- Shell operator blocking (with opt-in support via
ALLOW_SHELL_OPERATORS=true)
- Command length limits
- Execution timeouts
- Working directory restrictions
- Symlink resolution and validation
Error Handling
- Security violations (CommandSecurityError)
- Command timeouts (CommandTimeoutError)
- Invalid command formats
- Path security violations
- Execution failures (CommandExecutionError)
- General command errors (CommandError)
Development
Prerequisites
- Python 3.10+
- MCP protocol library
Building and Publishing
- Sync dependencies and update lockfile:
- Build package distributions:
- Publish to PyPI:
Debugging
License
CLI MCP Server
Table of Contents
- Overview
- Features
- Configuration
- Available Tools
- Usage with Claude Desktop
- Security Features
- Error Handling
- Development
- License
Overview
Features
- Secure command execution with strict validation
- Configurable command and flag whitelisting with 'all' option
- Path traversal prevention and validation
- Shell operator injection protection
- Execution timeouts and length limits
- Detailed error reporting
- Async operation support
- Working directory restriction and validation
Configuration
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
ALLOWED_COMMANDS or ALLOWED_FLAGS to 'all' will allow any command or flag respectively.Installation
Available Tools
run_command
- Shell operators (&&, |, >, >>) are not supported by default, but can be enabled with
ALLOW_SHELL_OPERATORS=true
- Commands must be whitelisted unless ALLOWED_COMMANDS='all'
- Flags must be whitelisted unless ALLOWED_FLAGS='all'
- All paths are validated to be within ALLOWED_DIR
show_security_rules
- Working directory
- Allowed commands
- Allowed flags
- Security limits (max command length and timeout)
Usage with Claude Desktop
~/Library/Application\ Support/Claude/claude_desktop_config.json:Development/Unpublished Servers Configuration
Published Servers Configuration
In case it's not working or showing in the UI, clear your cache viauv clean.
Security Features
- Command whitelist enforcement with 'all' option
- Flag validation with 'all' option
- Path traversal prevention and normalization
- Shell operator blocking (with opt-in support via
ALLOW_SHELL_OPERATORS=true)
- Command length limits
- Execution timeouts
- Working directory restrictions
- Symlink resolution and validation
Error Handling
- Security violations (CommandSecurityError)
- Command timeouts (CommandTimeoutError)
- Invalid command formats
- Path security violations
- Execution failures (CommandExecutionError)
- General command errors (CommandError)
Development
Prerequisites
- Python 3.10+
- MCP protocol library
Building and Publishing
- Sync dependencies and update lockfile:
- Build package distributions:
- Publish to PyPI: