Remote Demo MCP
Remote Demo MCP
rsyncを使用して、ビルド済みの静的ディレクトリをリモートホストにデプロイするローカルMCPサーバーです。
機能
MCP設定の固定
deployUserを使用localDirのベース名からprojectを導出localDirの内容を以下にアップロード:/var/www/html/demo-remote/{user}/{project}/
ローカルの
rsyncコマンドを使用rsyncセッションを
/dev/ttyにアタッチすることで、OTP/対話型SSHフローをサポート失敗した場合は、ユーザーがキャンセルするまで再試行するかどうかを尋ねる
インストール
npm install
npm run build設定
デフォルトの設定パス:
~/.config/remote-demo-mcp/config.json
パスを上書きする場合:
REMOTE_DEMO_MCP_CONFIG=/abs/path/config.json
例:
{
"deployUser": "demo_user-01",
"publicBaseUrl": "https://example.com",
"sessionLog": {
"enabled": false,
"path": "/tmp/remote-demo-mcp-session.log",
"logInputValue": false
},
"ssh": {
"host": "xxx.xxx.xxx.xxx",
"port": 2222,
"username": "alice123#ec2-user#52.76.147.44",
"interactiveAuth": true,
"password": "",
"hostKeyPolicy": "accept-new",
"autoFillPassword": true
},
"rsyncOptions": ["-az", "--delete"]
}サーバーは以下のオプションを追加して、自動的にレジューム可能なアップロードを有効にします:
--partial--checksum--progress(rsyncOptionsに既に--progressまたは--info=...が含まれている場合を除く)
互換性に関する注意:
対話型セッションモードは
node-ptyを使用します。macOS/Linuxでposix_spawnp failedと表示される場合、多くはnode-ptyのヘルパー(.../node-pty/prebuilds/*/spawn-helper)に実行権限がないことが原因です。このサーバーはセッション開始時にヘルパーの実行権限を確認し、自動修正します。
リモートターゲットのベースパスはハードコードされており、上書きできません:
/var/www/html/demo-remote
ツール
deploy_static
キーワード:
EN:
deploy to remote,deploy demo,publish demo,upload static site中文:
部署到远程,部署demo,部署 demo,发布demo,上传静态网页
userのルール:
deployUserはリモートパス用のアプリアプリケーションユーザーIDであり、SSHのusernameではありません使用可能な文字:
A-Z a-z 0-9 _ -使用不可:
.,.., スペース,/,\, およびその他の特殊文字
入力:
{
"localDir": "/abs/path/to/dist",
"clientCwd": "/abs/path/on-mcp-client",
"dryRun": false
}localDirのパス解決:
絶対パス: そのまま使用
相対パス:
clientCwdが提供されている場合はそれを基準に解決相対パスのフォールバック:
CODEX_START_DIRが設定されていればそれを使用、そうでなければprocess.cwd()(サーバー起動ディレクトリ)を使用
プロジェクト名の解決:
clientCwdが提供されている場合、プロジェクト名はclientCwdの最後のパスセグメントを使用そうでない場合、プロジェクト名は解決された
localDirの最後のパスセグメントを使用
動作に関する注意:
ssh.interactiveAuth=trueかつdryRun=falseの場合、deploy_staticは設計上、即座に失敗します。OTP/パスワードによる対話型デプロイを行うには、以下を使用してください:
start_deploy_sessionpoll_deploy_sessionnextAction=submit_inputの時にsubmit_deploy_inputを実行
ホストキーの確認(
yes/no)およびパスワードプロンプトは、セッションモードで自動的に処理されます。OTPは手動です:
nextAction=submit_inputの時にsubmit_deploy_inputを呼び出してください。
出力 (structuredContent):
{
"ok": true,
"attempts": 1,
"user": "alice",
"project": "my-site",
"remotePath": "/var/www/html/demo-remote/alice/my-site/",
"publicUrl": "https://example.com/alice/my-site/index.html",
"message": "Deploy succeeded after 1 attempt(s)."
}verify_deploy
入力:
{
"url": "https://example.com/alice/my-site/index.html",
"timeoutMs": 8000
}対話型OTPセッションツール
TTY以外のホストでデプロイ中にOTP/パスワードを入力する必要がある場合に使用します:
start_deploy_sessionpoll_deploy_session(出力と進捗を読み取る;state=waiting_inputの場合はコードを送信)submit_deploy_input(OTP/パスワードを送信)stateがsucceededまたはfailedになるまでステップ2を繰り返すオプションで
cancel_deploy_session
poll_deploy_sessionはcursorによる増分出力をサポートしており、nextCursorを返します。
セッションツールはオーケストレーションを決定論的にするためにnextActionを返します:
submit_input:submit_deploy_inputを呼び出すpoll:poll_deploy_sessionを呼び出すdone: ワークフロー終了 (succeeded/failed/cancelled)
セッションログ:
MCP設定ファイルの
sessionLogで設定します。sessionLog.enabledのデフォルトはfalseです。sessionLog.pathのデフォルトは/tmp/remote-demo-mcp-session.logです。sessionLog.logInputValueのデフォルトはfalseです(入力の長さのみが記録されます)。対話型セッションツールはrsyncをPTYで実行するため、パスワード/OTPプロンプトは
poll_deploy_session経由で検出可能です。
SSHホストキーポリシー:
accept-new(デフォルト): 初回のホストキーは自動的に受け入れられ、変更されたキーは拒否されます。strict: 不明なホストキーを自動的に受け入れません。insecure: ホストキーの検証を無効にします(リスクが高いため、一時的/デバッグ目的でのみ使用してください)。
Codex CLIの対話フロー:
start_deploy_sessionを呼び出すpoll_deploy_sessionをループするneedsInput=trueまたはnextAction=submit_inputの場合、OTP/パスワードを指定してsubmit_deploy_inputを呼び出す。ユーザーへのヒント表示は「Please Enter MFA Code.」または「Please Enter Password.」とする。nextAction=doneになるまでポーリングを継続する
エージェントプロトコル契約 (CodexのようなMCPクライアント向け):
start_deploy_sessionを1回呼び出す。レスポンスから
nextActionを読み取る。nextAction=submit_inputの場合、submit_deploy_inputを呼び出す。nextAction=pollの場合、poll_deploy_sessionを呼び出す。nextAction=doneになるまでステップ2〜4を繰り返す。OTPフローで
deploy_staticを呼び出さないこと。セッションツールのみを使用すること。ポーリング中、転送の進捗を
outputからエンドユーザーに継続的に中継すること。
出力 (structuredContent):
{
"ok": true,
"url": "https://example.com/alice/my-site/index.html",
"status": 200,
"statusText": "OK",
"responseTimeMs": 123,
"message": "URL is reachable: HTTP 200 in 123ms"
}実行
npm run dev
# or
npm run build && npm start設定ファイルの初期化:
remote-demo-mcp init以下が作成されます:
~/.config/remote-demo-mcp/config.json対話モードでは、編集のために現在の各フィールド値が表示されます。
入力せずにEnterキーを押すと、現在の値が変更されずに保持されます。
設定が既に存在する場合、
initは変更するかどうかを尋ね、上書き前に最終確認を求めます。
codex 使用
安裝 npm 包
npm install -g @jake.e-com365/remote-demo-mcpcodex 添加 mcp
codex mcp add remote-demo-mcp remote-demo-mcp remote-demo-mcp 的配置
remote-demo-mcp init
vi ~/.config/remote-demo-mcp/config.json{
"deployUser": "jake",
"publicBaseUrl": "https://demo-remote.e-com365.com/",
"ssh": {
"host": "xxx.xxx.xxx.xxx",
"username": "alice123#ec2-user#18.140.183.126",
"interactiveAuth": true,
"port": 2222,
"password": "xxx",
"hostKeyPolicy": "accept-new",
"autoFillPassword": true
},
"rsyncOptions": ["-az", "--delete"]
}This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/jake-bcn/remote-demo-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server