loading…
Search for a command to run...
loading…
A local MCP server that automates the deployment of static directories to remote hosts using rsync. It features support for interactive SSH authentication inclu
A local MCP server that automates the deployment of static directories to remote hosts using rsync. It features support for interactive SSH authentication including MFA/OTP flows and provides tools to verify reachable URLs after deployment.
Local MCP server that deploys a pre-built static directory to a remote host with rsync.
deployUser from MCP configproject from localDir basenamelocalDir contents to:/var/www/html/demo-remote/{user}/{project}/rsync command/dev/ttynpm install
npm run build
Default config path:
~/.config/remote-demo-mcp/config.jsonOverride path with:
REMOTE_DEMO_MCP_CONFIG=/abs/path/config.jsonExample:
{
"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"]
}
The server automatically enables resumable uploads by appending:
--partial--append-verify (if local rsync supports it)--progress (unless rsyncOptions already includes --progress or --info=...)Compatibility note:
rsync 2.6.9, --append-verify is unsupported.--append-verify automatically when unsupported.node-pty. If you see posix_spawnp failed on macOS/Linux, it is often caused by non-executable node-pty helper (.../node-pty/prebuilds/*/spawn-helper). This server now checks and auto-fixes helper execute permission at session start.Remote target base path is hard-coded and cannot be overridden:
/var/www/html/demo-remotedeploy_staticKeywords:
deploy to remote, deploy demo, publish demo, upload static site部署到远程, 部署demo, 部署 demo, 发布demo, 上传静态网页user rules:
deployUser is app user id for remote path, not SSH usernameA-Z a-z 0-9 _ -., .., spaces, /, \\, and other special charactersInput:
{
"localDir": "/abs/path/to/dist",
"clientCwd": "/abs/path/on-mcp-client",
"dryRun": false
}
localDir path resolution:
clientCwd if providedCODEX_START_DIR if set, otherwise process.cwd() (server start directory)Project name resolution:
clientCwd is provided, project name uses the last path segment of clientCwdlocalDirBehavior note:
ssh.interactiveAuth=true and dryRun=false, deploy_static will fail fast by design.start_deploy_sessionpoll_deploy_sessionsubmit_deploy_input when nextAction=submit_inputyes/no) and password prompts are auto-handled in session mode.submit_deploy_input when nextAction=submit_input.Output (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_deployInput:
{
"url": "https://example.com/alice/my-site/index.html",
"timeoutMs": 8000
}
Use these when OTP/password must be entered during deploy in non-TTY hosts:
start_deploy_sessionpoll_deploy_session (read output and progress; if state=waiting_input, submit code)submit_deploy_input (send OTP/password)state is succeeded or failedcancel_deploy_sessionpoll_deploy_session supports incremental output by cursor and returns nextCursor.
Session tools return nextAction to make orchestration deterministic:
submit_input: call submit_deploy_inputpoll: call poll_deploy_sessiondone: workflow finished (succeeded / failed / cancelled)Session logging:
sessionLog.sessionLog.enabled default is false.sessionLog.path default is /tmp/remote-demo-mcp-session.log.sessionLog.logInputValue default is false (only input length is logged).poll_deploy_session.SSH host key policy:
accept-new (default): first-time host key is auto-accepted; changed key is rejected.strict: never auto-accept unknown host key.insecure: disable host key validation (high risk; for temporary/debug use only).Codex CLI interactive flow:
start_deploy_sessionpoll_deploy_sessionneedsInput=true or nextAction=submit_input, call submit_deploy_input with OTP/password. The tip display to user is "Please Enter MFA Code." or "Please Enter Password."nextAction=doneAgent protocol contract (for MCP clients like Codex):
start_deploy_session once.nextAction from response.nextAction=submit_input, call submit_deploy_input.nextAction=poll, call poll_deploy_session.nextAction=done.deploy_static for OTP flows; use session tools only.output to the end user continuously.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
Initialize config file:
remote-demo-mcp init
It creates:
~/.config/remote-demo-mcp/config.jsoninit asks whether to modify, then asks final confirmation before overwrite.npm install -g @jake.e-com365/remote-demo-mcp
codex mcp add 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"]
}
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"remote-demo-mcp": {
"command": "npx",
"args": []
}
}
}