local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Implemented as a Node.js application that follows the Model Context Protocol, offering command validation and secure shell command execution.
Provides secure execution of shell commands with protective measures against dangerous operations including file system destruction, permission changes, and privilege escalation.
シェル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
ハンドラーのコマンド解析ロジックを強化します
You must be authenticated.
Tools
安全なシェル コマンド実行機能を提供するモデル コンテキスト プロトコルの Node.js 実装。これにより、Claude などの AI モデルは、セキュリティ対策が組み込まれた制御された環境でシェル コマンドを実行できます。
- Features
- Installation
- Security Features
- Available Tools
- Blacklisted Commands
- Error Handling
- Implementation Details
- Development
Related Resources
Appeared in Searches
- Using MySQL STDiO with Node.js or Python to Implement an MCP Server
- Information about penetration testing (pentest)
- How to clone a Git repository, create a Gradle 8 project with Java 21 and Spring Boot REST API, compile it, and upload to Git
- Information about Gmail MCP Node
- Transferring a Dockerized Website from Local to Remote Server Using Cursor AI