Skip to main content
Glama

Remote Command MCP Server

リモートコマンドMCPサーバー

異なるオペレーティングシステム間でリモートコマンド実行を可能にするモデルコンテキストプロトコル(MCP)サーバー。このサーバーは、シェルコマンドを実行するための統一されたインターフェースを提供し、WindowsとUnix系システム間のプラットフォーム固有の違いを自動的に処理します。

特徴

  • クロスプラットフォームのコマンド実行
  • WindowsとUnix間の自動コマンド正規化
  • 組み込みのエラー処理と出力ストリーミング
  • 作業ディレクトリ指定のサポート
  • プラットフォーム固有のシェルの選択

インストール

  1. リポジトリをクローンします。
git clone https://github.com/deepsuthar496/Remote-Command-MCP cd remote-command-server
  1. 依存関係をインストールします:
npm install
  1. サーバーを構築します。
npm run build
  1. 設定ファイルで MCP サーバーを構成します。

VSCode Cline 拡張機能 ( cline_mcp_settings.json ) の場合:

{ "mcpServers": { "remote-command": { "command": "node", "args": ["path/to/remote-command-server/build/index.js"], "disabled": false, "autoApprove": [] } } }

使用法

サーバーは、ホストマシン上で有効な任意のシェルコマンドを実行できるexecute_remote_commandという単一のツールを提供します。これには以下が含まれます。

  • システムコマンド
  • パッケージ マネージャー コマンド (apt、yum、chocolatey など)
  • 開発ツール (git、npm、python など)
  • ファイル操作
  • ネットワークコマンド
  • サービス管理
  • システムで利用可能なその他のCLIコマンド

ツール: execute_remote_command

パラメータ:

  • command (必須): ホストOS上で実行できる有効なシェルコマンド
  • cwd (オプション): コマンド実行のための作業ディレクトリ

  1. システム情報:
<use_mcp_tool> <server_name>remote-command</server_name> <tool_name>execute_remote_command</tool_name> <arguments> { "command": "systeminfo" // Windows // or "uname -a" // Linux } </arguments> </use_mcp_tool>
  1. パッケージ管理:
<use_mcp_tool> <server_name>remote-command</server_name> <tool_name>execute_remote_command</tool_name> <arguments> { "command": "npm list -g --depth=0" // List global NPM packages } </arguments> </use_mcp_tool>
  1. ネットワーク操作:
<use_mcp_tool> <server_name>remote-command</server_name> <tool_name>execute_remote_command</tool_name> <arguments> { "command": "netstat -an" // Show all network connections } </arguments> </use_mcp_tool>
  1. Git 操作:
<use_mcp_tool> <server_name>remote-command</server_name> <tool_name>execute_remote_command</tool_name> <arguments> { "command": "git status", "cwd": "/path/to/repo" } </arguments> </use_mcp_tool>
  1. ファイル操作:
<use_mcp_tool> <server_name>remote-command</server_name> <tool_name>execute_remote_command</tool_name> <arguments> { "command": "ls -la", // List files with details "cwd": "/path/to/directory" } </arguments> </use_mcp_tool>
  1. プロセス管理:
<use_mcp_tool> <server_name>remote-command</server_name> <tool_name>execute_remote_command</tool_name> <arguments> { "command": "ps aux" // List all running processes (Unix) // or "tasklist" // Windows equivalent } </arguments> </use_mcp_tool>
  1. サービス制御:
<use_mcp_tool> <server_name>remote-command</server_name> <tool_name>execute_remote_command</tool_name> <arguments> { "command": "systemctl status nginx" // Check service status (Linux) // or "sc query nginx" // Windows equivalent } </arguments> </use_mcp_tool>

セキュリティに関する考慮事項

このサーバーは任意のシステム コマンドを実行できるため、次のセキュリティ プラクティスを考慮してください。

  1. アクセス制御: MCP サーバーへのアクセスを信頼できるユーザーのみに制限します
  2. コマンド検証: アプリケーションロジックで実行する前にコマンドを検証します
  3. 作業ディレクトリ: cwdパラメータを使用して、コマンドの実行を特定のディレクトリに制限します。
  4. 環境: システム設定や機密ファイルを変更するコマンドには注意してください
  5. 権限: 適切なユーザー権限でMCPサーバーを実行します

クロスプラットフォームのコマンド処理

サーバーはプラットフォーム固有の違いを自動的に処理します。

  1. コマンド翻訳:
    • lsdir (プラットフォームに応じて自動的に変換されます)
    • 各プラットフォームに適したパイプ演算子のフォーマット
  2. シェルの選択:
    • Windows: cmd.exeを使用します
    • Unix/Linux: /bin/shを使用する

エラー処理

サーバーは詳細なエラーメッセージを提供し、応答には標準出力と標準エラー出力の両方が含まれます。コマンドが失敗した場合は、問題の詳細を含むエラーメッセージが表示されます。

エラー応答の例:

{ "content": [ { "type": "text", "text": "Command execution error: Command failed with exit code 1" } ], "isError": true }

発達

プロジェクト構造

remote-command-server/ ├── src/ │ └── index.ts # Main server implementation ├── package.json ├── tsconfig.json └── README.md

建物

npm run build

これにより、TypeScript コードがコンパイルされ、 buildディレクトリに実行可能ファイルが作成されます。

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成します( git checkout -b feature/amazing-feature
  3. 変更をコミットします ( git commit -m 'Add some amazing feature' )
  4. ブランチにプッシュする ( git push origin feature/amazing-feature )
  5. プルリクエストを開く

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

異なるオペレーティング システム間でシェル コマンドをリモート実行できるようにし、Windows と Unix 系システム間のプラットフォーム固有の違いを自動的に処理するモデル コンテキスト プロトコル サーバー。

  1. 特徴
    1. インストール
      1. 使用法
        1. ツール: execute_remote_command
        2. セキュリティに関する考慮事項
        3. クロスプラットフォームのコマンド処理
        4. エラー処理
      2. 発達
        1. プロジェクト構造
        2. 建物
      3. 貢献
        1. ライセンス

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that provides programmatic access to the Windows terminal, enabling AI models to interact with the Windows command line through standardized tools for writing commands, reading output, and sending control signals.
            Last updated -
            3
            JavaScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.
            Last updated -
            3
            Python
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.
            Last updated -
            2
            Python
            MIT License
            • Apple
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server implementation that enables secure remote command execution via SSH, with features for managing and using SSH credentials.
            Last updated -
            5
            9
            9
            JavaScript

          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/deepsuthar496/Remote-Command-MCP'

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