Token导航 LogoToken导航TokenDH.com
Codriver MCP logo
运维云端未说明官方级别未说明来源级核验

Codriver MCP

MCP Server

CoDriver是一个通过Model Context Protocol实现的AI驱动桌面自动化控制工具,支持屏幕截图、UI树读取、OCR识别和鼠标键盘输入注入,适用于实时人机协作。

工具数

12

提示词数

0

GitHub Stars

13

资源数

0
TypeScriptClaudeAI控制ClaudeWindsurfVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ViktorTrn

提供方

ViktorTrn

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

CoDriver MCP

通过模型上下文协议实现AI驱动的桌面自动化

CoDriver是一个MCP服务器,它使Claude能够控制任何桌面应用程序。它捕获屏幕截图,读取可访问性树,执行OCR,并注入鼠标/键盘输入,从而在桌面上实现实时人工智能协作。

CoDriver适用于整个桌面,就像“Chrome中的克劳德”适用于浏览器一样。

特性

工具说明
desktop_screenshot捕获整个桌面、窗口或特定显示器(PNG/JPEG)
desktop_click单击坐标或按元素参照
desktop_type在光标处或特定元素中键入文本
desktop_key按组合键(ctrl+c, alt+tab, f5)
desktop_scroll在某个位置向任意方向滚动
desktop_drag在坐标或元素参照之间拖放
desktop_windows列出并聚焦应用程序窗口
desktop_read_ui使用引用ID读取可访问性树
desktop_find按名称、角色或值查找UI元素
desktop_launch启动、退出或检查应用程序的状态
desktop_ocr通过OCR从屏幕提取文本(tesseract.js)
desktop_displays列出连接的监视器以进行多显示器捕获

平台支持

平台状态鼠标/键盘窗口管理辅助功能屏幕截图OCR
macOS支持Swift/CGEvent+robotjsSwift/CoreGraphicsJXA/osascript截图桌面tesseract.js
视窗支持robotjsPowerShell+Win32 P/InvokePowerShell+UI自动化屏幕截图桌面tesseract.js
Linux计划中--

快速开始

先决条件

  • Node.js 20+
  • macOSWindows 10/11
  • 仅限Windows:Visual Studio构建工具(用于robotjs本机编译)

macOS权限

CoDriver需要两个系统权限。授予他们 系统设置>隐私和安全:

权限必需如何授予
屏幕录制截图、窗口列表添加您的终端/IDE应用程序
无障碍鼠标点击、键盘输入、滚动、UI树阅读添加您的终端/IDE应用程序
提示: 如果您使用IDE中的CoDriver(例如Windsurf、VS Code),请添加 IDE应用程序 打开两个权限列表,然后完全重新启动它(Cmd+Q)。

Windows权限

权限需要备注
截图、窗口列表、UI树阅读开箱即用
管理员 (可选)读取管理员提升进程的UI以管理员身份运行终端
注: robotjs需要 Visual Studio 生成工具 在Windows上编译本机模块。通过安装 npm install --global windows-build-tools 或从以下网址下载 Visual Studio.

安装

git clone https://github.com/ViktorTrn/codriver-mcp.git
cd codriver-mcp
npm install
npm run build

用克劳德代码配置(本地)

增添 ~/.claude/settings.json:

{
  "mcpServers": {
    "codriver": {
      "command": "node",
      "args": ["/absolute/path/to/codriver-mcp/dist/index.js"]
    }
  }
}

远程访问(HTTP传输)

node dist/index.js --http                           # localhost:3100
node dist/index.js --http --port 8080               # custom port
node dist/index.js --http --host 0.0.0.0            # all interfaces
node dist/index.js --http --api-key YOUR_SECRET      # with authentication

远程克劳德代码配置:

{
  "mcpServers": {
    "codriver-remote": {
      "url": "http://your-machine:3100/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

使用示例

"Take a screenshot of my desktop"
-> desktop_screenshot

"Read the UI tree of the frontmost app"
-> desktop_read_ui

"Find the Save button"
-> desktop_find { query: "Save" }

"Click the Save button"
-> desktop_click { ref: "ref_3" }

"Drag the file to the trash"
-> desktop_drag { startRef: "ref_5", endRef: "ref_12" }

"Type into the search field"
-> desktop_type { ref: "ref_5", text: "hello world" }

"Launch Safari"
-> desktop_launch { action: "launch", appName: "Safari" }

"Read text from this area of the screen"
-> desktop_ocr { x: 100, y: 200, width: 500, height: 100 }

"Which monitors are connected?"
-> desktop_displays

可访问性驱动的工作流

推荐的工作流程反映了Chrome的可访问性方法:

  1. 读取UI - desktop_read_ui 返回一个包含引用ID的元素树
  2. 查找元素 - desktop_find 按名称、角色或值搜索
  3. 通过ref进行交互 - desktop_click { ref: "ref_1" }desktop_type { ref: "ref_3", text: "..." }

这比基于坐标的点击更可靠,因为元素是在语义上标识的。

组合键

输入操作
enter按Enter键
ctrl+c复制
ctrl+v粘贴
ctrl+shift+s另存为
cmd+a全选(macOS)
alt+tab切换窗口
f5刷新
esc逃跑

发展

npm run build        # Compile TypeScript
npm run dev          # Watch mode (tsx)
npm test             # Run tests (107 tests)
npm run typecheck    # Type-check without emit

建筑

CoDriver MCP Server (Node.js/TypeScript)
  |
  +-- Transport
  |     +-- stdio (local, default)
  |     +-- Streamable HTTP/SSE (remote, --http flag)
  |
  +-- Tools (12 total)
  |     +-- desktop_screenshot   PNG/JPEG capture, multi-monitor
  |     +-- desktop_click        Mouse click (coords or ref)
  |     +-- desktop_type         Keyboard input
  |     +-- desktop_key          Key combinations
  |     +-- desktop_scroll       Scroll wheel
  |     +-- desktop_drag         Drag & drop
  |     +-- desktop_windows      Window management
  |     +-- desktop_read_ui      Accessibility tree
  |     +-- desktop_find         Element search
  |     +-- desktop_launch       App lifecycle
  |     +-- desktop_ocr          Text recognition
  |     +-- desktop_displays     Monitor listing
  |
  +-- Modules
        +-- ScreenCapture       screenshot-desktop + sharp (cross-platform)
        +-- InputController     Swift/CGEvent (macOS) | robotjs (Windows)
        +-- WindowManager       Swift/CoreGraphics (macOS) | PowerShell+Win32 (Windows)
        +-- AccessibilityReader JXA/osascript (macOS) | PowerShell+UIA (Windows)
        +-- AppLauncher         AppleScript (macOS) | PowerShell (Windows)
        +-- OcrEngine           tesseract.js (cross-platform)

技术栈

组件macOSWindows
运行时Node.js 20 LTS,TypeScript 5.7+严格版相同
MCP SDK@modelcontextprotocol/SDK v1.26相同
截图截图桌面+锐化相同
鼠标输入Swift/CGEvent@jitsi/robotjs
键盘输入@jitsi/robotjs相同
可访问性JXA/osascriptPowerShell+用户界面自动化(System.Windows.Automation)
窗口管理Swift/核心图形PowerShell+Win32 P/Invoke
应用程序启动器AppleScript/osascriptPowerShell(启动进程/停止进程)
OCRtesseract.js相同
HTTP传输Express+StreamableHTTPServerTransport相同
测试vitest(107次测试)相同

路线图

  • \[x\] 第一阶段:MVP -屏幕截图、鼠标、键盘、windows(macOS)
  • \[x\] 第二阶段:可访问性 -UI树读取、元素引用、自然语言查找
  • \[x\] 第三阶段:远程 -HTTP/SSE传输、API-key身份验证、JPEG压缩
  • \[x\] 第四阶段:波兰语 -OCR、拖放、应用程序启动、多显示器
  • \[x\] 第五阶段:窗户 -完全支持Windows 10/11

未来

  • \[x\] npm包发布(npm install -g codriver-mcp)
  • \[\]GIF录制
  • \[\]Linux平台支持

许可证

麻省理工学院

作者

维克托·特伦切克- IBT 工程 办公 Trncik

目录标签

目录标签

TypeScriptClaudeAI控制桌面自动化本地部署屏幕截图UI交互OCR识别

支持客户端

ClaudeWindsurfVS Code

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

12

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP