uitars-mcp
uitars-mcp
MCP 服务器,为 AI 编码代理提供本地 GUI 接地能力——即查找屏幕上任何 UI 元素并返回其精确像素坐标的能力。
由 UI-TARS-2B 提供支持,这是字节跳动推出的 2B 参数 GUI 接地模型。
为什么选择它
Claude Code 内置的计算机使用功能会将每个屏幕截图发送到云端进行分析。而此 MCP 服务器运行的是本地视觉模型:
每次查找元素约 1.2 秒(相比云端往返延迟)
4.1GB 显存(可在任何现代 GPU 上运行)
完全离线——无需 API 密钥,无云端依赖
90.7% 的准确率(基于 ScreenSpot 桌面文本基准测试)
原生像素坐标——返回精确的点击目标
Related MCP server: screencye
设置
1. 下载 UI-TARS-2B
# Requires ~4.5GB disk space
huggingface-cli download bytedance-research/UI-TARS-2B-SFT --local-dir ./ui-tars-2b2. 安装带有 CUDA 的 PyTorch
# Install CUDA-enabled PyTorch first (adjust cu126 to your CUDA version)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu1263. 安装 uitars-mcp
pip install uitars-mcp
# or from source:
pip install -e .4. 配置 Claude Code
添加到您的 Claude Code MCP 设置中 (~/.claude/settings.json):
{
"mcpServers": {
"uitars-mcp": {
"command": "uitars-mcp",
"env": {
"UITARS_MODEL": "/path/to/ui-tars-2b"
}
}
}
}如果安装在虚拟环境中,请使用可执行文件的完整路径:
{
"mcpServers": {
"uitars-mcp": {
"command": "/path/to/venv/bin/uitars-mcp",
"env": {
"UITARS_MODEL": "/path/to/ui-tars-2b"
}
}
}
}工具
工具 | 功能 | 延迟 |
| 通过描述查找 UI 元素,返回点击坐标 | ~1.2s |
| 描述屏幕上可见的所有内容 | ~2s |
| OCR — 读取屏幕上的所有文本 | ~3s |
| 检查元素状态(启用、值等) | ~1s |
| 通过检查屏幕状态验证操作是否成功 | ~1.5s |
| 建议实现目标的下一步操作 | ~1.5s |
| 测量端到端延迟 | 不定 |
工作原理
通过
mss进行屏幕截图(快速、跨平台)调整大小至 1344px 宽(最佳视觉 token 数量)
在 GPU 上运行 UI-TARS-2B 推理
将模型 0-1000 的归一化坐标转换为原生屏幕像素
返回可用于
computer-use点击工具的坐标
模型在首次调用时延迟加载(约 3 秒),随后保留在显存中以供后续调用。
环境变量
变量 | 默认值 | 描述 |
| (必需) | UI-TARS-2B 模型目录的路径 |
要求
Python 3.10+
具有 4.1GB+ 显存的 NVIDIA GPU
支持 CUDA 的 PyTorch
Windows 或 Linux(macOS 未经测试)
This server cannot be deployed
Maintenance
Related MCP Connectors
Visual testing for coding agents: your agent sees every UI change it makes and triages each diff.
A visual brain for your agents: live, reusable UI fragments and skills to pull into code.
UI design from prompts, screenshots, and URLs for AI coding agents and theme tokens.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA local autonomous AI agent that watches your screen, understands the visual layout, and executes native OS commands (clicking, typing) without cloud APIs.39MIT
- AlicenseNot gradedqualityBmaintenanceEyes for text-only LLMs: decodes screenshots into exact structured text (words, coordinates, sizes, colors) using pure-code CV and OCR. Enables text-only models to reason about UI layouts without vision models or VRAM usage.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to see, locate UI elements, and operate any Windows desktop app through natural language, using accessibility-tree matching with optional vision-model fallback, plus an autonomous visual loop with introspection and meta-learning.13MIT
- AlicenseAqualityAmaintenanceEnables AI agents to automate GUI interactions across Windows, Linux, macOS, Android, iOS, and browsers using structured platform APIs first, with vision grounding as a fallback for robust cross-platform computer use.17MIT