MCP-ShellJS
Claude のような LLM に安全で制御された ShellJS アクセスを提供する MCP サーバー。
概要
MCP-ShellJSは、モデルコンテキストプロトコル(MCP)とShellJSを橋渡しし、AIシステムが安全なサンドボックス内でシェルコマンドを実行できるようにします。また、複数のセキュリティレイヤーによる制御されたファイルシステムアクセスを提供します。
特徴
- 簡素化されたセキュリティ:
- デフォルトでは読み取り専用モード
- コマンドラインフラグによるオプションの読み取り/書き込みモード
- コマンドラインフラ��によるオプションの実行権限
- Zodによるスキーマベースの検証
- 完全な ShellJS 機能 (
ls
、grep
、sed
、find
など) - 強い型付けによるTypeScript実装
- LLM統合のためのシンプルなAPI
インストール
使用法
コマンドライン
TypeScript統合
セキュリティ設計
MCP-ShellJS はシンプルなセキュリティ モデルを実装します。
- 読み取り専用モード(デフォルト):ファイルシステムを変更しないコマンドのみが使用可能
- 読み書きモード(
--enable-rw
): ファイルを作成、変更、または削除できるコマンドを有効にします - 実行モード(
--enable-exec
): 潜在的に危険なexec
コマンドを有効にして、任意のシェル コマンドを実行します。
サーバーは stdio トランスポートのみで実行されるため、デスクトップ LLM アプリケーションとの統合に適しています。
MCP-ShellJS を使用する理由
AI 開発者にとって、MCP-ShellJS は、リスクを制御しながら強力なファイルシステム機能を実現します。
- 効率的な探索:
grep
による高速検索とコードベース全体のfind
- テキスト処理: ファイル全体をロードせずに
sed
で変換する - 安全な自動化:AIがファイルの整理と管理を支援
- 強力なパイプライン: Unix スタイルのパイプによるチェーン操作
リソース
ディレクトリリソース
強力なフィルタリング機能を備えたディレクトリ リストを提供します。
パラメータ | 説明 |
---|---|
include | 含める glob パターン (例: *.js,*.ts ) |
exclude | 除外する glob パターン (例: node_modules,dist ) |
honor_gitignore | true の場合、.gitignore のパターンに一致するファイルを除外します。 |
recursive | true の場合、サブディレクトリを再帰的に含めます |
例:
ファイルリソース
特定の部分を表示するためのオプションを含むファイルの内容を提供します。
パラメータ | 説明 |
---|---|
lines | true の場合、出力に行番号が含まれます |
start | 含める最初の行(1から始まるインデックス) |
end | 最後に含める行 |
highlight | 一致するテキストを強調表示するグロブパターン |
例:
ツール
MCP-ShellJS は、セキュリティ リスク レベル別にグループ化された ShellJS コマンドをツールとして公開します。
読み取り専用ツール
道具 | 説明 | 議論 |
---|---|---|
cat | 出力ファイルの内容 | files : 文字列/配列、 options : -n 付きオブジェクト (行数) |
grep | ファイル内のパターンを検索する | regex 、 files 、 options : -v (反転)、 -l (ファイル名のみ)、 -i (大文字と小文字を区別しない) を指定したオブジェクト |
find | 再帰的にファイルを検索する | paths : 文字列/配列 (ベースディレクトリを含むファイルパスを返します) |
ls | ディレクトリの内容を一覧表示する | paths : 文字列/配列、 options : -R (再帰)、 -A (すべて)、 -L (シンボリックリンクをたどる)、 -d (ディレクトリのみ) を使用したオブジェクト |
which | コマンドを見つける | command : 文字列(コマンドへのパスを返す) |
pwd | 作業ディレクトリを印刷 | (議論なし) |
test | テストファイルの条件 | expression : 文字列 (例: -d path ディレクトリが存在する、 -f path ファイルが存在する) |
head | 最初の行を表示 | files : 文字列/配列、 options : -n <num> 付きのオブジェクト (表示する行数) |
tail | 最後の行を表示 | files : 文字列/配列、 options : -n <num> 付きのオブジェクト (表示する行数) |
sort | ソートライン | files : 文字列/配列、 options : -r (逆順)、 -n (数値) 付きのオブジェクト |
uniq | 重複行をフィルタリング | input : 文字列、 output : 文字列、 options : -i (大文字と小文字を区別しない)、 -c (カウント)、 -d (重複のみ) 付きのオブジェクト |
読み書きツール
道具 | 説明 | 議論 |
---|---|---|
mkdir | ディレクトリを作成する | dir : 文字列/配列、 options : -p 付きのオブジェクト(中間ディレクトリを作成) |
touch | ファイルの作成/更新 | files : 文字列/配列、 options : -c (作成なし)、 -a (アクセス時間のみ)、 -m (変更時間のみ) を指定したオブジェクト |
cp | ファイル/ディレクトリをコピーする | source : 文字列/配列、 dest : 文字列、 options : -R (再帰)、 -n (上書きなし)、 -f (強制) 付きのオブジェクト |
mv | ファイル/ディレクトリを移動する | source : 文字列/配列、 dest : 文字列、 options : -f (強制)、 -n (上書きなし) 付きのオブジェクト |
rm | ファイル/ディレクトリを削除する | files : 文字列/配列、 options : -r/-R (再帰)、 -f (強制) 付きのオブジェクト |
sed | ファイルのストリームエディター | search_regex : 正規表現、 replacement : 文字列、 files : 文字列/配列、 options : -i 付きオブジェクト (インプレース) |
特別な権限ツール
道具 | 説明 | 議論 |
---|---|---|
exec | コマンドを実行 | command : 文字列、 options : async 、 silent 、 allowExec: true 構成が必要なオブジェクト |
ライセンス
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
LLM に制御された ShellJS アクセスを提供する安全な MCP サーバー。これにより、AI システムはシェル コマンドを安全に実行し、構成可能なセキュリティ サンドボックス内でファイルシステムと対話できるようになります。
Related MCP Servers
- AsecurityAlicenseAqualityA secure MCP server for executing whitelisted shell commands with resource and timeout controls, designed for integration with Claude and other MCP-compatible LLMs.Last updated 5 months ago204754TypeScriptMIT License
- AsecurityAlicenseAqualityAn MCP server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface for LLMs.Last updated 2 months ago1073PythonMIT License
- -securityAlicense-qualityA secure, container-based implementation of the Model Context Protocol (MCP) that provides sandboxed environments for AI systems to safely execute code, run commands, access files, and perform web operations.Last updated 25 days ago11PythonApache 2.0
- AsecurityAlicenseAqualityAn MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.Last updated a month ago94336JavaScriptMIT License