DesktopBridge
DesktopBridge 🌉
本地 Model Context Protocol 服务器,适用于 macOS。Claude(或任何 MCP 主机)通过 stdio 与之通信,可以:
在 允许的目录 内读取、写入、列出和搜索文件
读取 CPU / 内存 / 磁盘统计、运行时间和脱敏的环境变量
列出正在运行的应用程序
运行 shell 命令,支持 分离的 stdout/stderr、超时和可选的进度流
读取和写入剪贴板
捕获屏幕截图并列出显示器
此进程与启动它的用户具有相同的操作系统权限。将其视为在 Mac 上给模型一个终端,然后使用 DESKTOP_BRIDGE_ROOTS 缩小爆炸半径。
要求
macOS(剪贴板、屏幕截图和应用程序列表使用 Apple 工具)
Node.js 20.19+(推荐 22 LTS)
Related MCP server: macOS Automator MCP Server
安装
cd desktop-bridge
npm install
npm run build
npm test编译后的入口点是 dist/index.js。
连接到 Claude Desktop
构建服务器(
npm run build)。打开 Claude Desktop → 设置 → 开发者 → 编辑配置。
合并
claude_desktop_config.example.json中的块,替换路径和用户名:
{
"mcpServers": {
"desktop-bridge": {
"command": "node",
"args": ["/Users/YOU/dev/desktop-bridge/dist/index.js"],
"env": {
"DESKTOP_BRIDGE_ROOTS": "/Users/YOU/Desktop,/Users/YOU/Documents,/Users/YOU/Downloads"
}
}
}
}完全退出并重新打开 Claude Desktop。
确认 desktop-bridge 出现在 MCP 工具中(桥接图标 🌉)。
macOS 上的配置文件:
~/Library/Application Support/Claude/claude_desktop_config.json
连接到 Claude Code
claude mcp add desktop-bridge -- node /Users/YOU/dev/desktop-bridge/dist/index.js或者将相同的 command / args / env 块添加到 ~/.claude.json。
连接到 Cursor
添加到 ~/.cursor/mcp.json(或项目的 .cursor/mcp.json):
{
"mcpServers": {
"desktop-bridge": {
"command": "node",
"args": ["/Users/YOU/dev/desktop-bridge/dist/index.js"]
}
}
}无主机冒烟测试
npm run inspector这将针对构建的 stdio 服务器启动 MCP Inspector。调用 list_roots,然后调用 get_system_info。
日志仅输出到 stderr。不要在此进程中使用 console.log — stdout 是 JSON-RPC 通道。
环境变量
变量 | 默认值 | 含义 |
|
| 文件工具可以访问的逗号分隔目录。操作系统临时目录始终添加,以便屏幕截图有存放位置。 |
|
| 单个文件读/写的最大大小(1 KiB–100 MiB)。 |
|
| 默认 |
|
| 组合的 stdout+stderr 捕获上限。超出输出会终止进程并设置 |
|
| 设置为 |
|
| 为 true 时, |
| 未设置 | 状态站点的心跳 POST URL( |
| 未设置 | 与站点的 |
|
| 心跳间隔(5s–5m)。 |
复制 .env.example 获取带注释的模板。服务器读取 进程环境变量(Claude Desktop env 块),而不是 .env 文件。
工具
工具 | 功能 |
| 允许的目录和文件大小上限 |
| 文本(可选行窗口)或 base64 |
| 创建/覆盖/追加;可选 |
| 名称、类型、大小、修改时间、模式 |
| 按名称进行 glob 和/或按文件内容进行正则表达式搜索 |
| CPU 百分比、负载、内存、 |
| 主机、运行时间、用户、脱敏环境变量 |
| 通过 System Events 列出 GUI(或所有)进程 |
| 带分离 stdout/stderr 的 shell; |
|
|
| 显示器名称、主显示器标志、缩放、帧 |
| 通过 |
资源:desktop://roots、desktop://system/info。
提示:inspect_desktop、find_file。
安全模型
文件: 每个路径都经过
realpath处理。解析后的路径必须保持在配置的根目录内。拒绝..、多余斜杠和逃逸的符号链接。主目录不是默认根目录。 这使
~/.ssh等目录在您有意添加之前无法访问。Shell: 仍然是完整的用户 shell。即使 cwd 受限,命令也可以
cd到任何位置。如果只需要文件/剪贴板/屏幕工具,请使用DESKTOP_BRIDGE_ALLOW_SHELL=false禁用它。环境变量: 匹配 password/token/secret/key/credential/cookie/session 的键将被替换为
[redacted]。Stdio: 没有网络监听器。主机启动此进程。
macOS 权限
功能 | 权限 |
屏幕截图 | 启动 Node 的应用程序(Claude Desktop、Cursor 或 Terminal)需要 屏幕录制 权限 |
| 如果 macOS 提示,需要 自动化 → System Events 权限 |
重度辅助功能应用 | 可能仍会隐藏标题;该工具无论如何都会列出进程名称 |
如果 screencapture 失败,请打开 系统设置 → 隐私与安全性 → 屏幕录制 并启用主机应用,然后重新启动它。
开发
npm run build # tsc → dist/
npm start # node dist/index.js (stdio)
npm test # compile + node:test布局:src/lib/*(路径守卫、进程运行器、glob/搜索)、src/tools/*(MCP 工具)、src/index.ts(stdio 入口)。
主页
https://home.jameymcelveen.com 是浏览器起始页(web/,无额外 npm 包)。登录使用 @mcelveen.us 加上 STATUS_PASSWORD。
今天有什么,以及未来内容的转储托盘:
部分 | 说明 |
搜索 | 自动聚焦。Google / Kagi / DDG。Bang 命令: |
链接 | 与本地起始页应用相同的磁贴,加上属性。在设置中作为 JSON 编辑 |
天气 | Open-Meteo,°F,Florence SC,除非您覆盖坐标 |
Mac | DesktopBridge 心跳:在线 / 过期 / 离线,IP,负载 |
草稿 | 自动保存的笔记 |
单词 | 每日经文 |
将 Chrome/Safari/Firefox 主页设置为 https://home.jameymcelveen.com(浏览器不会让页面为您设置)。会话 cookie 持续 30 天。/ 聚焦搜索;⌘K 也可以。
推送到 main 运行 CI,然后部署 Vercel(站点)和 Railway(心跳 + 保存的配置)。
在 Mac 上,添加到 MCP 服务器环境变量:
DESKTOP_BRIDGE_STATUS_URL=https://home.jameymcelveen.com/api/heartbeat
DESKTOP_BRIDGE_STATUS_TOKEN=<HEARTBEAT_TOKEN>许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityFmaintenanceA Model Context Protocol server that enables running AppleScript code to interact with Mac applications and system features including Notes, Calendar, Contacts, Messages, file management, and more.178460MIT
- AlicenseAqualityAmaintenanceProvides a Model Context Protocol server for executing AppleScript and JavaScript for Automation scripts on macOS, featuring a knowledge base of pre-defined scripts and supporting automation of macOS applications and system functions.2507874MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables execution of AppleScript and JavaScript for Automation scripts on macOS, allowing programmatic control of applications and system functions through a rich knowledge base of pre-defined scripts.25078MIT
- FlicenseAqualityDmaintenanceSecure AppleScript execution for AI applications via Model Context Protocol with configurable security profiles and automatic TCC permission handling.31
Related MCP Connectors
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/jameymcelveen/desktop-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server