Skip to main content
Glama
deepsuthar496

Remote Command MCP Server

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

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

特徴

  • クロスプラットフォームのコマンド実行

  • WindowsとUnix間の自動コマンド正規化

  • 組み込みのエラー処理と出力ストリーミング

  • 作業ディレクトリ指定のサポート

  • プラットフォーム固有のシェルの選択

Related MCP server: MCP Shell Server

インストール

  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. コマンド翻訳:

    • ls ⟷ dir (プラットフォームに応じて自動的に変換されます)

    • 各プラットフォームに適したパイプ演算子のフォーマット

  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 ファイルを参照してください。

Available Tools

1 tool
execute_remote_commandC

Execute a command on the host machine

NameRequiredDescriptionDefault
commandYesCommand to execute
cwdNoWorking directory for command execution

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions execution but doesn't describe permissions required, whether commands run asynchronously, timeout behavior, error handling, or output format. For a potentially dangerous remote execution tool, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core functionality without unnecessary words. It's appropriately sized and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that executes remote commands with no annotations and no output schema, the description is insufficient. It doesn't address critical aspects like security implications, execution environment, error conditions, or what the tool returns. The combination of high-risk functionality and minimal description creates significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (command and cwd) adequately. The description doesn't add any additional meaning about parameter usage beyond what's in the schema, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('execute') and target ('command on the host machine'), providing a specific verb+resource combination. It doesn't need to differentiate from siblings since none exist, but it could be more specific about what types of commands or hosts are supported.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives or what prerequisites might be needed. The description states what it does but offers no context about appropriate use cases, security considerations, or limitations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool update
    • First observedexecute_remote_command

TDQS

B3/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or confusion between tools. The tool's purpose is singular and clearly defined.

Naming Consistency5/5

Since there is only one tool, it inherently maintains consistency. The naming follows a clear verb_noun pattern (execute_remote_command).

Tool Count2/5

A single tool is too few for a server named 'Remote Command MCP Server', which suggests a broader scope for remote command execution. This minimal set limits functionality and may cause agent failures due to lack of supporting operations.

Completeness1/5

The tool surface is severely incomplete. It only provides command execution with no support for listing available commands, checking command status, handling outputs, or managing remote sessions, which are essential for the domain.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.
    7
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    A server that enables remote command execution over SSH through the Model Context Protocol (MCP), supporting both password and private key authentication.
    1
    3 npm
    2
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    A local Model Context Protocol server that allows LLMs to securely execute shell commands on remote Linux and Windows systems via SSH connections.
    6
    4 npm
    2
    -