mcp-cli-exec MCP サーバー
強力なCLIコマンド実行MCPサーバー。構造化された出力を持つシェルコマンドの実行を可能にします。このパッケージはコマンド実行機能に特化しており、他のMCP CLIツールとは一線を画しています。
特徴
ツール
cli-exec-raw
生の CLI コマンドを実行し、構造化された出力を返す
- コマンド文字列とオプションのタイムアウト(デフォルト: 5 分)を受け取ります。
- stdout、stderr、終了コードを含む詳細な実行結果を返します。
- 構造化されたエラー応答でエラーを適切に処理します
cli-exec
特定の作業ディレクトリで1つ以上のCLIコマンドを実行する
- 単一コマンド、&& 連鎖コマンド、またはコマンドの配列をサポートします
- すべてのコマンドは指定された作業ディレクトリで実行されます
- 各コマンドの詳細な結果を返します。
- 成功/失敗ステータス
- 終了コード
- stdout と stderr (ANSI コードは削除)
- 実行期間
- 作業ディレクトリ
- 最初のコマンドが失敗すると停止します
- コマンドごとのオプションのタイムアウト(デフォルト: 5 分)
注: 実行コンテキストの制限により、各コマンドは独立して実行されます。コマンド内でのディレクトリ変更(cd)は、後続のコマンドには影響しません。すべてのコマンドは、最初に指定された作業ディレクトリで実行されます。
出力形式
コマンドは次のような構造化された結果を返します:
- 成功/失敗ステータス
- 終了コード
- stdout と stderr (ANSI コードは削除)
- 実行期間
- 作業ディレクトリ
- 詳細なエラー情報(該当する場合)
使用例
cli-exec-raw
簡単なコマンド実行:
タイムアウトあり:
cli-exec
特定のディレクトリ内の単一コマンド:
複数のコマンド (すべて同じ作業ディレクトリで実行):
インストール
オプションでnpmからインストールします:
または、設定でnpxを使用するだけです
Cline VSCode拡張機能
%APPDATA%/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
に追加します:
クロードデスクトップ向け
適切な設定ファイルに追加します:
Windows: %APPDATA%/Claude/claude_desktop_config.json
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
特別なWindows構成
Windows で ENOENT spawn npx の問題が発生した場合は、完全なパスを指定する次の代替構成を使用します。
発達
依存関係をインストールします:
サーバーを構築します。
自動リビルドを使用した開発の場合:
デバッグ
MCPサーバーはstdio経由で通信するため、デバッグが困難になる場合があります。MCP Inspectorは便利なデバッグツールを提供します。
これにより、ブラウザでインスペクタにアクセスするための URL が提供され、次の操作を実行できます。
- すべてのMCPメッセージを表示
- リクエスト/レスポンスペイロードを検査する
- ツールをインタラクティブにテストする
- サーバーの状態を監視する
エラー処理
サーバーには包括的なエラー処理が含まれています。
- すべてのツールパラメータの入力検証
- 構造化されたエラー応答
- コマンドタイムアウト処理
- 作業ディレクトリの検証
- きれいな出力のための ANSI コード除去
技術的な詳細
- TypeScriptとMCP SDKを使用して構築
- 信頼性の高いコマンド実行のためにexecaを使用する
- デフォルトのコマンドタイムアウト: 5分
- Windows および Unix 系システムをサポートします (OS に応じて適切なコマンドを使用します (例: 'dir' と 'ls'))
- コマンドを順番に実行し、最初の失敗で停止します
- 各コマンドは指定された作業ディレクトリ内で独立して実行されます
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
構造化された出力でシェル コマンドを実行できる CLI コマンド実行サーバー。stdout、stderr、終了コード、実行時間などの詳細な実行結果を提供します。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA 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 -174PythonMIT License
- -securityAlicense-qualityShell and file edit capabilities tightly coupled to provide a powerful coding experience. You can work with different modes: architect and code-writer for separate plan and implementation phase. You can get it to invoke any cli command, e.g., compiling, type checking, linting, github cli, pythonLast updated -494PythonApache 2.0
- -securityAlicense-qualityA secure server that enables AI applications to execute shell commands in specified directories, supporting multiple shell types (bash, sh, cmd, powershell) with built-in security features like directory isolation and timeout control.Last updated -9PythonApache 2.0
- AsecurityFlicenseAqualityA CLI tool that runs a Model Context Protocol server over stdio, enabling interaction with specification documents like business requirements, product requirements, and user stories for the Specif-ai platform.Last updated -90TypeScript
Appeared in Searches
- How to run a Python file using Claude Desktop
- How to view console logs
- Information about Penetration Testing
- Marking Linux terminal commands as safe or unsafe for local execution
- 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