MCP シェル サーバー
モデルコンテキストプロトコル(MCP)を使用してシェルコマンドを実行するサーバー。AIエージェントが安全にシェルコマンドを実行できるようにするブリッジとして機能します。
特徴
シェルコマンドを実行する(単一行および複数行のサポート)
さまざまなシェル (bash、zsh、fish、powershell、cmd など) のサポート
詳細なエラー処理とログ記録
MCP Inspector対応
インストール
npmから(ユーザーとして)
ソースから(開発用)
MCP構成
カーソルの設定
カーソル構成ファイル ( ~/.cursor/config.json ) に次のコードを追加します。
クライン統合
Clineは、Claude AIでMCPサーバーを利用できるようにするVS Code拡張機能です。ClineでMCPシェルサーバーを設定するには、以下の手順に従います。
Cline MCP 設定ファイルを開きます。
macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.jsonWindows:
%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.jsonLinux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
シェル サーバーの MCP 構成を追加します。
{ "mcpServers": { "shell": { "command": "npx", "args": ["-y", "@mkusaka/mcp-shell-server"], "disabled": false, "autoApprove": [] } } }あるいは、ローカルにインストールされたパッケージを使用する場合は、次のようにします。
{ "mcpServers": { "shell": { "command": "node", "args": ["/path/to/mcp-shell-server/dist/index.js"], "disabled": false, "autoApprove": [] } } }
ルール設定
AI アシスタントのルールまたはプロンプトに次の内容を追加します。
使用法
直接実行
開発モード
MCP Inspectorによるテスト
コマンドライン引数
ツールリファレンス
シェル実行
指定されたシェルでコマンドを実行します。
パラメータ:
command(文字列、必須): 実行するシェルコマンドworkingDir(文字列、オプション): コマンドを実行する作業ディレクトリ。$HOME の下にある必要があります。
リソースリファレンス
サーバーは、リソースとして次のシステム情報を提供します。
ホスト名
システムのホスト名を返します。
URI: hostname://
プラットフォーム
オペレーティング システム プラットフォームを返します。
URI: platform://
シェル
サーバーで使用されているシェル パスを返します。
URI: shell://
ユーザー名
現在のユーザー名を返します。
URI: username://
システム情報
以下の情報を含む包括的なシステム情報を JSON 形式で返します。
ホスト名
プラットフォーム
シェル
ユーザー名
CPU数
合計メモリ
空きメモリ
システム稼働時間
使用例
基本的なコマンド実行
複数行コマンド(ヒアドキュメント)の実行
発達
プロジェクト構造
ログ記録
ログはmcp-shell.logファイルに書き込まれます。
ライセンス
マサチューセッツ工科大学
Related MCP Servers
- Asecurity-licenseAqualityA secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.Last updated -1141MIT License
- Asecurity-licenseAqualityA server that enables AI assistants to execute terminal commands and retrieve outputs via the Model Context Protocol (MCP).Last updated -317MIT License
- AsecurityFlicenseAqualityAn MCP server that allows AI models to execute system commands on local machines or remote hosts via SSH, supporting persistent sessions and environment variables.Last updated -42011624
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server that enables AI assistants to perform comprehensive file operations including finding, reading, writing, editing, searching, moving, and copying files with security validations.Last updated -71