Skip to main content
Glama

mcp-cli-exec MCP Server

by jakenuts

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

簡単なコマンド実行:

{ "command": "echo Hello World" }

タイムアウトあり:

{ "command": "long-running-script.sh", "timeout": 300000 }
cli-exec

特定のディレクトリ内の単一コマンド:

{ "workingDirectory": "/path/to/project", "commands": "npm install" }

複数のコマンド (すべて同じ作業ディレクトリで実行):

{ "workingDirectory": "C:\\project", "commands": [ "dir /b", "npm run build" ] }

インストール

オプションでnpmからインストールします:

npm install -g mcp-cli-exec # or with pnpm pnpm add -g mcp-cli-exec

または、設定でnpxを使用するだけです

Cline VSCode拡張機能

%APPDATA%/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.jsonに追加します:

{ "mcpServers": { "mcp-cli-exec": { "command": "npx", "args": ["-y", "mcp-cli-exec"] } } }

クロードデスクトップ向け

適切な設定ファイルに追加します:

Windows: %APPDATA%/Claude/claude_desktop_config.json MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{ "mcpServers": { "mcp-cli-exec": { "command": "npx", "args": ["-y", "mcp-cli-exec"] } } }

特別なWindows構成

Windows で ENOENT spawn npx の問題が発生した場合は、完全なパスを指定する次の代替構成を使用します。

{ "mcpServers": { "mcp-cli-exec": { "command": "C:\\Users\\jim\\AppData\\Roaming\\nvm\\v22.1.0\\node.exe", "args": [ "C:\\Users\\jim\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npx-cli.js", "-y", "mcp-cli-exec" ] } } }

発達

依存関係をインストールします:

pnpm install

サーバーを構築します。

pnpm run build

自動リビルドを使用した開発の場合:

pnpm run watch

デバッグ

MCPサーバーはstdio経由で通信するため、デバッグが困難になる場合があります。MCP Inspectorは便利なデバッグツールを提供します。

pnpm run inspector

これにより、ブラウザでインスペクタにアクセスするための URL が提供され、次の操作を実行できます。

  • すべてのMCPメッセージを表示
  • リクエスト/レスポンスペイロードを検査する
  • ツールをインタラクティブにテストする
  • サーバーの状態を監視する

エラー処理

サーバーには包括的なエラー処理が含まれています。

  • すべてのツールパラメータの入力検証
  • 構造化されたエラー応答
  • コマンドタイムアウト処理
  • 作業ディレクトリの検証
  • きれいな出力のための ANSI コード除去

技術的な詳細

  • TypeScriptとMCP SDKを使用して構築
  • 信頼性の高いコマンド実行のためにexecaを使用する
  • デフォルトのコマンドタイムアウト: 5分
  • Windows および Unix 系システムをサポートします (OS に応じて適切なコマンドを使用します (例: 'dir' と 'ls'))
  • コマンドを順番に実行し、最初の失敗で停止します
  • 各コマンドは指定された作業ディレクトリ内で独立して実行されます

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

構造化された出力でシェル コマンドを実行できる CLI コマンド実行サーバー。stdout、stderr、終了コード、実行時間などの詳細な実行結果を提供します。

  1. 特徴
    1. ツール
    2. 出力形式
    3. 使用例
  2. インストール
    1. Cline VSCode拡張機能
    2. クロードデスクトップ向け
    3. 特別なWindows構成
  3. 発達
    1. デバッグ
  4. エラー処理
    1. 技術的な詳細

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        A 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 -
        1
        74
        Python
        MIT License
        • Apple
      • -
        security
        A
        license
        -
        quality
        Shell 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, python
        Last updated -
        494
        Python
        Apache 2.0
        • Apple
        • Linux
      • -
        security
        A
        license
        -
        quality
        A 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 -
        9
        Python
        Apache 2.0
        • Linux
        • Apple
      • A
        security
        F
        license
        A
        quality
        A 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 -
        9
        0
        TypeScript

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/jakenuts/mcp-cli-exec'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server