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: servo-mcp
设置
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 installed
Maintenance
Related MCP Connectors
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.
- openhelmOAuthai.openhelm
Autonomous cloud agent tasks: real browser + your tools, structured evidence-backed results.
E2LLM gives your AI eyes and hands in a real browser: structured perception (SiFR) plus action.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA local autonomous AI agent that watches your screen, understands the visual layout, and executes native OS commands (clicking, typing) without cloud APIs.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to see and control your desktop with tools for screenshots, clicks, typing, and more, all locally on macOS and Windows.80MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to control Windows desktops via local OCR, optional YOLO icon detection, and mouse/keyboard actions.PolyForm Noncommercial 1.0.0
- 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