ThinkDrop Vision Service
Provides screen capture, OCR text extraction, and visual language model scene understanding capabilities with continuous monitoring and automatic memory storage integration.
README
Vision Service - MCP
Vision capabilities for ThinkDrop AI: screen capture, OCR, and VLM scene understanding.
Features
- Screenshot Capture - Fast cross-platform screen capture
- OCR - Text extraction using PaddleOCR (local, multilingual)
- VLM - Scene understanding using MiniCPM-V 2.6 (lazy-loaded, optional)
- Watch Mode - Continuous monitoring with change detection
- Memory Integration - Auto-store to user-memory service as embeddings
Quick Start
# 1. Copy environment config
cp .env.example .env
# 2. Edit .env (set API keys, configure VLM, etc.)
nano .env
# 3. Start service
./start.sh
Service will be available at http://localhost:3006
Installation Options
Minimal (OCR Only - No GPU Required)
pip install -r requirements.txt
- Screenshot + OCR only
- ~200-500ms per capture
- No VLM dependencies
Full (OCR + VLM - GPU Recommended)
# Uncomment VLM dependencies in requirements.txt
pip install torch transformers accelerate
# Or with CUDA support
pip install torch --index-url https://download.pytorch.org/whl/cu118
pip install transformers accelerate
- Screenshot + OCR + VLM
- 600-1500ms with GPU, 2-6s with CPU
- ~2.4GB model download on first use
API Endpoints
Health Check
GET /health
Capture Screenshot
POST /vision/capture
{
"region": [x, y, width, height], # Optional
"format": "png"
}
Extract Text (OCR)
POST /vision/ocr
{
"region": [x, y, width, height], # Optional
"language": "en" # Optional
}
Describe Screen (VLM)
POST /vision/describe
{
"region": [x, y, width, height], # Optional
"task": "Find the Save button", # Optional focus
"include_ocr": true, # Include OCR text
"store_to_memory": true # Auto-store to user-memory
}
Start Watch Mode
POST /vision/watch/start
{
"interval_ms": 2000,
"change_threshold": 0.08,
"run_ocr": true,
"run_vlm": false,
"task": "Monitor for errors"
}
Stop Watch Mode
POST /vision/watch/stop
Watch Status
GET /vision/watch/status
Configuration
Key environment variables in .env:
# Service
PORT=3006
API_KEY=your-vision-api-key-here
# OCR
OCR_ENGINE=paddleocr
OCR_LANGUAGE=en
# VLM (lazy-loaded)
VLM_ENABLED=true
VLM_MODEL=openbmb/MiniCPM-V-2_6
VLM_DEVICE=auto # auto, cpu, cuda
# Watch
WATCH_DEFAULT_INTERVAL_MS=2000
WATCH_CHANGE_THRESHOLD=0.08
# User Memory Integration
USER_MEMORY_SERVICE_URL=http://localhost:3003
USER_MEMORY_API_KEY=your-user-memory-api-key
Performance
OCR Only (Minimal Setup)
- Capture: 10-20ms
- OCR: 200-500ms
- Total: ~300-600ms per request
- Memory: ~500MB
OCR + VLM (Full Setup)
- Capture: 10-20ms
- OCR: 200-500ms
- VLM (GPU): 300-800ms
- VLM (CPU): 2-5s
- Total (GPU): ~600-1500ms
- Total (CPU): ~2.5-6s
- Memory: ~3-4GB (model loaded)
Watch Mode Strategy
Watch mode uses smart change detection to minimize VLM calls:
- Every interval: Capture + fingerprint comparison
- On change: Run OCR (if enabled)
- On significant change: Run VLM (if enabled)
- Auto-store: Send to user-memory service as embedding
This keeps VLM usage efficient while maintaining continuous awareness.
Integration with ThinkDrop AI
The vision service integrates with the MCP state graph:
// In AgentOrchestrator state graph
const visionResult = await mcpClient.callService('vision', 'describe', {
include_ocr: true,
store_to_memory: true,
task: userMessage
});
// Result automatically stored as embedding in user-memory
// No screenshot files to manage!
Testing
Test Capture
curl -X POST http://localhost:3006/vision/capture \
-H "Content-Type: application/json" \
-d '{}'
Test OCR
curl -X POST http://localhost:3006/vision/ocr \
-H "Content-Type: application/json" \
-d '{}'
Test VLM (if enabled)
curl -X POST http://localhost:3006/vision/describe \
-H "Content-Type: application/json" \
-d '{"include_ocr": true, "store_to_memory": false}'
Test Watch
# Start
curl -X POST http://localhost:3006/vision/watch/start \
-H "Content-Type: application/json" \
-d '{"interval_ms": 2000, "run_ocr": true}'
# Status
curl http://localhost:3006/vision/watch/status
# Stop
curl -X POST http://localhost:3006/vision/watch/stop
Troubleshooting
OCR Not Working
- Check PaddleOCR installation:
pip list | grep paddleocr - Models download on first use (~100MB)
- Check logs for download progress
VLM Not Loading
- Ensure dependencies installed:
pip list | grep transformers - Check available memory (need 4-8GB)
- Set
VLM_ENABLED=falseto disable - Model downloads on first use (~2.4GB)
Performance Issues
- CPU too slow: Disable VLM, use OCR only
- Memory issues: Reduce watch interval, disable VLM
- GPU not detected: Check CUDA installation
Architecture
vision-service/
├── server.py # FastAPI app
├── src/
│ ├── services/
│ │ ├── screenshot.py # mss wrapper
│ │ ├── ocr_engine.py # PaddleOCR wrapper
│ │ ├── vlm_engine.py # VLM wrapper (lazy)
│ │ └── watch_manager.py # Watch loop
│ ├── routes/
│ │ ├── capture.py # /vision/capture
│ │ ├── ocr.py # /vision/ocr
│ │ ├── describe.py # /vision/describe
│ │ └── watch.py # /vision/watch/*
│ └── middleware/
│ └── validation.py # API key validation
├── requirements.txt
├── start.sh
└── README.md
License
Part of ThinkDrop AI project.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。