remote-pc-mcp
Enables remote control of macOS machines through shell command execution, file operations, screenshots, window listing/focusing, UI element reading, and mouse/keyboard automation.
Provides a run_command tool to execute shell commands on the remote computer, with configurable timeouts and UTF-8 handling on Windows.
Executes commands on macOS through the built-in /bin/zsh shell.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
remote-pc-mcp
一套代码同时适配 macOS 与 Windows 的跨平台 Streamable HTTP MCP Server,配合 Tailscale 私有加密组网,让部署在 VPS 上的 AI Agent(如 CloudCLI / Codex / Claude Code / Antigravity CLI)可以安全、稳定地远程操控你的多台个人电脑。
核心特性
零 C++ 原生编译依赖:纯 Node.js(>= 20)+ 官方
@modelcontextprotocol/sdk,Mac / Windows 下载后npm install即用,不会踩node-gyp编译坑。多台电脑同时接入:Mac 默认监听
8787(my-mac),Windows 默认监听8788(my-win),VPS 上的 Agent 可以同时区分并操控两台电脑。默认绑定 Tailscale 私网 + Bearer Token 鉴权:自动检测本机 Tailscale IPv4(
100.64.0.0/10)绑定,不暴露公网,每次请求校验Authorization: Bearer <token>。增强版桌面控制(纯系统内置,零额外软件):
基础工具:
get_system_info、run_command(Mac 固定/bin/zsh,Windows 固定系统powershell.exe强制 UTF-8 防中文乱码)、read_file、write_file、list_dir桌面 GUI 工具:
take_screenshot(直接回传压缩后的屏幕图像给模型看)、list_windows、focus_window、read_ui_elements(读取窗口控件树)、mouse_click、keyboard_type(剪贴板粘贴模式完美支持中文)、keyboard_hotkey
Related MCP server: agentic-remote-pc
整体架构
手机 / 浏览器
│ HTTPS
▼
VPS (CloudCLI: Codex / Claude Code)
├── MCP "my-mac" ──(Tailscale 加密内网)──► macOS 电脑 (:8787)
└── MCP "my-win" ──(Tailscale 加密内网)──► Windows 电脑 (:8788)快速上手
前置准备
Tailscale:在你的 VPS、Mac、Windows 上安装并登录同一个 Tailscale 账号。
Node.js >= 20:在要被控制的 Mac 和 Windows 电脑上安装 Node.js 20 或更高版本。
一、在 macOS 上部署(默认端口 8787)
git clone https://github.com/Caben123/remote-pc-mcp.git
cd remote-pc-mcp
# 一键安装依赖、生成随机 Token,并注册 macOS 开机自启(LaunchAgent)
bash scripts/setup-mac.sh --install-service如果只想前台手动运行,不加
--install-service,执行完后运行npm start即可。
macOS 桌面控制权限设置(使用截屏 / 窗口 / 键鼠工具必做):
打开 系统设置 → 隐私与安全性,在以下两项中勾选你的终端 App(或 node 可执行文件):
辅助功能(Accessibility)
屏幕录制(Screen Recording)
二、在 Windows 上部署(默认端口 8788)
打开 PowerShell:
git clone https://github.com/Caben123/remote-pc-mcp.git
cd remote-pc-mcp
# 一键安装依赖、生成随机 Token,并配置登录自动后台启动
powershell -ExecutionPolicy Bypass -File scripts\setup-win.ps1 -InstallStartup如果只想前台手动运行,去掉
-InstallStartup,执行完后运行npm start即可。 Windows 防火墙如弹出提示,请允许 Node.js 在“专用网络”通信(或允许 Tailscale 接口入站端口8788)。
三、在 VPS 上一键挂载到 Codex & Claude Code
上面在 Mac / Windows 运行完一键脚本后,终端会直接打印出一条对应这台电脑的注册命令。
在 VPS 上(切换到运行 CloudCLI 的用户,例如 coder)执行即可:
# 下载注册脚本(或直接 git clone 本仓库)
git clone https://github.com/Caben123/remote-pc-mcp.git
cd remote-pc-mcp
# 注册 Mac
bash scripts/register-vps.sh my-mac http://<Mac的Tailscale_IP>:8787/mcp <Mac生成的MCP_TOKEN>
# 注册 Windows
bash scripts/register-vps.sh my-win http://<Win的Tailscale_IP>:8788/mcp <Win生成的MCP_TOKEN>完成后刷新 CloudCLI 网页(或新开一个会话),就可以直接对 AI 说:
“先看看 my-mac 的系统信息,列出我桌面的文件”
“截一张 my-win 的屏幕,告诉我当前打开了哪些窗口”
配置项说明(.env)
变量名 | 默认值 | 说明 |
|
| 自动绑定本机 Tailscale IPv4;检测不到时回退 |
| Mac | 监听端口 |
|
| 机器名称标识 |
| (必填) | Bearer 鉴权密钥(禁止提交到 Git) |
| (留空) | 可选目录白名单,逗号分隔;留空按当前用户权限 |
|
| 单条命令超时时间(毫秒) |
|
| 设为 |
|
| 截屏缩放最大宽度(像素) |
安全提醒
切勿将
.env或MCP_TOKEN提交到任何代码仓库或截图分享。建议始终保持
HOST=auto(仅绑定 Tailscale 私网 IP),不要把服务暴露在公网 IP 上。本服务以你当前系统用户权限运行,如仅希望 AI 访问特定项目目录,请在
.env中配置ALLOWED_ROOTS。被控制的电脑需要保持开机、联网、不休眠(Mac 可设置合盖/电源防休眠,Windows 可在电源选项关闭自动睡眠)。
本地自检
npm run test:smokeTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Give your AI hands on every computer you own. Remote control of your Windows, Mac and Linux machines from one ChatGPT, Claude or Cursor chat — even from your phone. Ask it to find out why the office server is crawling, update every PC in the house, sort out your mom's laptop from another city, or ship the site from your work machine while you're on a train. It runs commands and reads and writes files; screenshots are a beta you can request. You decide what each computer allows, and you can cut any of them off in a second.
Reach your own computers from any AI app: files, commands, screen and mouse, approvals and alerts.
Securely control computers you explicitly pair through files, terminals, processes, screenshots, desktop UI/input, clipboard, browser automation, diagnostics, and document tools.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI services like Claude and Cursor to remotely control a Mac by executing shell commands, managing files, and running AppleScript for UI automation. Access is secured through OAuth 2.0 authentication and encrypted tunnels to protect remote interactions.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to securely control a remote Windows/Linux PC via MCP and REST, executing shell commands and driving coding-agent CLIs like Claude, Cursor, and Codex.1-
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to securely control trusted devices and perform filesystem, terminal, process, and document operations through a self-hosted remote service.1,287,096 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables an AI agent to inspect and operate a remote Windows machine over a private tailnet, listing and reading files, transferring and mutating them within a configured sandbox root, capturing screenshots, and — only when explicitly double-opted-in — executing commands and sending keystrokes. It runs self-hosted with no third-party client or vendor cloud in the session path, and reports its live policy rather than asserting its own safety.MIT