シェルMCPサーバー
セキュアなシェルコマンド実行機能を提供するモデルコンテキストプロトコル(MCP)のNode.js実装です。このサーバーにより、AIモデルはセキュリティ対策が組み込まれた制御された環境でシェルコマンドを実行できます。Claude Desktopと簡単に統合でき、Claudeをシェルに接続できます。
特徴
MCP準拠のサーバー実装
ブラックリスト保護による安全なコマンド実行
コマンドの存在検証
標準I/Oベースのトランスポート
エラー処理と正常なシャットダウン
インストール
npx mcp-shellを実行します。
Claude Desktopに追加するには、 npx mcp-shell config実行します。または、 npx -y mcp-shell手動で設定に追加します。
Claude Desktop を起動 (または再起動) すると、ランディング ページに MCP ツールが表示されます。
セキュリティ機能
サーバーはいくつかのセキュリティ対策を実装しています。
コマンドブラックリスト
危険なシステムコマンドの実行を防止します
重要なシステム変更へのアクセスをブロック
ファイルシステムの破壊から保護します
権限昇格を防止
コマンド検証
実行前にコマンドの存在を確認する
ブラックリストを検証する
無効なコマンドに対して明確なエラーメッセージを返します
利用可能なツール
サーバーは次のツールを 1 つ提供します。
実行コマンド
シェル コマンドを実行し、その出力を返します。
入力スキーマ:
応答:
成功: コマンド出力はプレーンテキストとして出力されます
エラー: エラー メッセージがプレーン テキストで表示されます
ブラックリストに登録されたコマンド
次のコマンド カテゴリはセキュリティ上の理由によりブロックされています。
ファイルシステム破壊コマンド (rm、rmdir、del)
ディスク/ファイルシステムコマンド(format、mkfs、dd)
権限/所有権コマンド (chmod、chown)
権限昇格コマンド (sudo、su)
コード実行コマンド (exec、eval)
システム通信コマンド(write、wall)
システム制御コマンド (シャットダウン、再起動、初期化)
エラー処理
サーバーには包括的なエラー処理が含まれています。
コマンドが見つからないエラー
ブラックリストに登録されたコマンドエラー
実行エラー
MCPプロトコルエラー
SIGINT による正常なシャットダウン
実装の詳細
サーバーは以下を使用して構築されます:
モデルコンテキストプロトコルSDK
通信用のStdioServerTransport
コマンド実行用のexeca
コマンド検証のためのコマンド存在
発達
セキュリティ設定を変更するには、次の操作を行います。
ブロックされたコマンドを調整するには、
BLACKLISTED_COMMANDSセットを編集します。追加の検証ルールを追加するには、
validateCommand関数を変更します。CallToolRequestSchemaハンドラーのコマンド解析ロジックを強化します
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server implementation that enables secure remote command execution via SSH, with features for managing and using SSH credentials.Last updated -539
- -security-license-qualityA TypeScript application that allows Claude to safely execute bash commands with security safeguards, providing a secure interface through the Model Context Protocol.
- AsecurityAlicenseAqualityA secure Model Context Protocol server that allows AI models to safely interact with Windows command-line functionality, enabling controlled execution of system commands, project creation, and system information retrieval.Last updated -87MIT License
- -securityFlicense-qualityA secure interface that enables language models to execute shell commands on the host operating system through the Model Context Protocol.Last updated -1
Appeared in Searches
- Bash shell scripting and command line resources
- Security testing and vulnerability assessment of MCP Server execution functions
- Security vulnerabilities and risks in MCP Server execution methods
- Security vulnerabilities in MCP Server related to subprocess execution
- NestJS framework information and resources