
mladensu/cli-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
mladensu/cli-mcp-serverは、https://github.com/mladensu/cli-mcp-server.からインポートされたMCPサーバー候補です。
概要
mladensu/cli-mcp-serverは、https://github.com/mladensu/cli-mcp-server.からインポートされたMCPサーバー候補です。
概要(AI 翻訳)
制御されたコマンドライン操作を実行するための安全なモデルコンテキストプロトコル(MCP)サーバー実装 包括的なセキュリティ機能。
目次
- 概要
- 特徴
- 構成
- 利用可能なツール
- run_command
- show_security_rules
- Claude Desktopでの利用
- 開発/未公開サーバー構成
- 公開サーバー構成
- セキュリティ機能
- エラー処理
- 開発
- 前提条件
- 建築と出版
- デバッグ
- ライセンス
概要
このMCPサーバーは、コマンドホワイトリストやパスなどの堅牢なセキュリティ対策により安全なコマンドライン実行を可能にします 検証と実行制御。LLMアプリケーションへの制御されたCLIアクセスを提供しつつ、セキュリティを維持しつつに最適です。
特徴
- 🔒 厳密検証によるコマンド実行の安全
- ⚙️ 「all」オプション付きコマンドおよびフラグのホワイトリスト設定が可能です
- 🛡️ 経路通過の防止と検証
- 🚫 シェルオペレーター噴射保護
- ⏱️ 実行タイムアウトと長さ制限
- 📝 詳細なエラー報告
- 🔄 非同期操作のサポート
- 🎯 ワーキングディレクトリの制限と検証
構成
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
CLI MCP Server
A secure Model Context Protocol (MCP) server implementation for executing controlled command-line operations with comprehensive security features.
Table of Contents
- Overview
- Features
- Configuration
- Available Tools
- Usage with Claude Desktop
- Security Features
- Error Handling
- Development
- License
Overview
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.
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
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 |
インストール
uvx cli-mcp-server設定
{
"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"
}
}
}
}