Skip to main content
Glama

mcp-remote-agent

AIエージェント向けリモート開発用MCPサーバー

AIエージェントがMCPプロトコルを通じてリモートのLinuxサーバーを操作できるようにし、ローカルの開発環境とリモートサーバーをシームレスに接続します。

License: MIT Version

中文文档


概要

AIエージェント(WorkBuddy、Claude Desktop、Cursorなど)がMCPを介してリモートのLinuxサーバー上のファイルを直接読み書きし、コマンドを実行できるようにし、ローカル開発とリモートサーバーをシームレスに接続します。

例え: VS Code Remote SSHが人間向けであるのに対し、mcp-remote-agentはAI向けです。


Related MCP server: SSH MCP Server

主な機能

機能

説明

リモートファイル操作

remote_read / remote_write / remote_stat

リモート検索

remote_glob によるグロブパターンでのファイル検索

コマンド実行

単純なコマンド用の remote_bash、複数行スクリプト用の remote_script

バッチ操作

1リクエストあたり最大20操作の remote_batch

非同期実行

長時間実行タスク用の remote_exec_async + remote_task

設定のホットリロード

再起動なしでリモート設定を変更する remote_config

動的接続

MCPを再起動せずに複数のサーバーを切り替え可能

ヘルスチェック

リモートサービスの状態を自動検知

エンコーディング処理

特殊文字の自動Base64エンコード、CRLF/BOMのクリーンアップ


クイックスタート

1. リポジトリのクローン

git clone https://github.com/knownothing20/mcp-remote-agent.git
cd mcp-remote-agent

2. 依存関係のインストール

npm install

3. 設定

cp mcp-remote-agent.example.json local/mcp-remote-agent.json
# Edit local/mcp-remote-agent.json, fill in all variables

主要な変数:

変数

説明

skillDir

スキルインストールディレクトリの絶対パス

mcpConfigPath

対象AIツールのMCP設定ファイルのパス

remoteUrl

リモートデーモンのアドレス

authToken

クライアント認証トークン

4. 設定の同期

node sync.cjs

5. リモートデーモンのデプロイ

# Create daemon directory on remote server
ssh USER@SERVER "mkdir -p /path/to/daemon"

# Upload server files to remote server
scp server/server.js server/mcp-remote-agent-manager.sh server/package.json USER@SERVER:/path/to/daemon/

# Upload generated .env config (created by sync.cjs in step 4)
scp local/server/.env USER@SERVER:/path/to/daemon/

# SSH to remote server
ssh USER@SERVER
cd /path/to/daemon
npm install
nohup bash mcp-remote-agent-manager.sh >> boot.log 2>&1 &

6. AIツールの再起動

設定が反映されたら、AIツールを再起動してMCP登録を有効にします。


対応AIツール

AIツール

MCP設定パス (Windows)

MCP設定パス (macOS/Linux)

WorkBuddy

C:\Users\<user>\.workbuddy\mcp.json

~/.workbuddy/mcp.json

Claude Desktop

C:\Users\<user>\AppData\Roaming\Claude\claude_desktop_config.json

~/.config/Claude/claude_desktop_config.json

Cursor

<project>\.cursor\mcp.json

<project>/.cursor/mcp.json

Windsurf

C:\Users\<user>\.codeium\windsurf\mcp_config.json

~/.codeium/windsurf/mcp_config.json


ツール一覧

ツール

機能

remote_health

リモートサービスの到達可能性を確認

remote_read

リモートファイルの読み込み (ETagキャッシュ)

remote_write

リモートファイルの書き込み (CRLF/BOM自動クリーンアップ)

remote_stat

ファイルメタデータの取得

remote_glob

グロブパターンによる検索

remote_bash

リモートコマンドの実行

remote_script

複数行スクリプトの実行

remote_batch

バッチ操作

remote_exec_async

非同期実行

remote_task

非同期タスクの照会

remote_config

設定のホットリロード

remote_status

接続診断

詳細な使用方法は SKILL.md を参照してください。


ディレクトリ構造

mcp-remote-agent/
├── SKILL.md                        # Complete documentation
├── README.md                       # This file (English)
├── README_CN.md                    # Chinese documentation
├── index.js                        # MCP server main program
├── package.json                    # Client dependencies
├── mcp-remote-agent.example.json   # Config template
├── sync.cjs                        # Variable sync script
├── test.cjs                        # Test script
├── .gitignore                      # Git ignore config
├── LICENSE                         # MIT License
├── CHANGELOG.md                    # Version changelog
├── local/                          # Local config directory
│   ├── README.md                   # Configuration guide
│   ├── mcp-remote-agent.json       # Main config (copy from example)
│   ├── connections.json.example    # Multi-server config example
│   └── server/
│       └── .env                    # Server config (auto-generated)
└── server/
    ├── server.js                   # Daemon process
    ├── mcp-remote-agent-manager.sh # Process guardian script
    ├── setup-autostart.sh          # Autostart config script
    ├── dashboard.html              # Web Dashboard UI
    ├── .env.example                # Server config template
    └── package.json                # Server dependencies

設定ファイル

ファイル

場所

説明

mcp-remote-agent.json

local/

メイン設定 (mcp-remote-agent.example.json からコピー)

connections.json

local/

マルチサーバー接続 (オプション、connections.json.example を参照)

.env

server/

サーバー設定 (sync.cjs により自動生成)

詳細な設定ガイドについては local/README.md を参照してください。


ダッシュボード

mcp-remote-agentは、監視と管理のためのWebダッシュボードを提供します。

ダッシュボードの有効化

local/mcp-remote-agent.json で設定します:

{
  "variables": {
    "serverEnableDashboard": "true"
  }
}

ダッシュボードへのアクセス

サービス起動後、以下にアクセスしてください:

  • http://your-server:3183/

  • http://your-server:3183/dashboard

ダッシュボードの機能

機能

説明

サービスステータス

Node.js、依存関係、ポート、ディスク状態の表示

監査統計

リクエスト統計、成功率、タイプ/クライアント別の分析表示

エラーログ

最近のエラーログの表示

設定管理

サーバー設定の表示と変更 (管理者トークンが必要)


自動起動設定

方法 1: setup-autostart.sh を使用 (推奨)

# SSH to remote server
ssh USER@SERVER
cd /path/to/daemon

# Install autostart
bash setup-autostart.sh install

# Check status
bash setup-autostart.sh status

# Uninstall autostart
bash setup-autostart.sh uninstall

方法 2: 手動でのcrontab設定

# Edit crontab
crontab -e

# Add the following line
@reboot /path/to/daemon/mcp-remote-agent-manager.sh # mcp-remote-agent autostart

方法 3: systemd を使用 (オプション)

/etc/systemd/system/mcp-remote-agent.service を作成します:

[Unit]
Description=mcp-remote-agent daemon
After=network.target

[Service]
Type=simple
User=your-user
WorkingDirectory=/path/to/daemon
ExecStart=/bin/bash /path/to/daemon/mcp-remote-agent-manager.sh
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

次に有効化します:

sudo systemctl enable mcp-remote-agent
sudo systemctl start mcp-remote-agent

セキュリティ機能

  • ワークスペースの分離: ファイル操作は WORKSPACE_ROOT 内に制限されます

  • トークン認証: クライアントトークン + 管理者トークン

  • パス制限: 不正アクセスの防止

  • スクリプトインタープリターのホワイトリスト: 安全なインタープリターのみを許可

  • コマンド実行制限: 設定可能な ALLOW_BASH_EXEC および ALLOWED_COMMANDS


バージョン履歴

CHANGELOG.md を参照してください


ライセンス

MITライセンス - LICENSE を参照してください


コントリビューション

Issueやプルリクエストを歓迎します!

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    An open MCP server that gives any AI agent SSH access to remote Linux/Unix machines — shell commands, file read/write, and SFTP transfers.
    11
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI tools to manage SSH connections, execute commands, transfer files, and perform remote server diagnostics via MCP protocol.
    17
    4 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A centralized MCP server that enables LLM agents to securely execute commands and manage Linux servers via SSH.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables MCP-compatible AI clients to remotely manage a Linux server via SSH, supporting file operations, Docker control, Git pulls, and arbitrary command execution.
    6,170 npm
    MIT