xiaomi-ocr-mcp
Reconstructs IntelliJ IDEA projects from screen recordings by extracting line-numbered code rows, rebuilding the source tree and file paths, verifying Java/XML/YAML syntax, and providing review tools to compare video frames with recovered text and fix OCR errors.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
xiaomi-ocr-mcp
Unofficial community project. Not affiliated with, endorsed by, or sponsored by Xiaomi.
Record your IDE scrolling through a project → get the project back as files.
CLI + MCP server: point it at a screen recording of IntelliJ IDEA and it rebuilds the
source tree (pom.xml, src/main/java/..., resources), checks the syntax, and gives you a
short list of lines worth a second look — with the video frame for each.
recording.mp4 ─► keyframes ─► line number + text per row ─► vote per line ─► project/ + REPORT.md
(screen at rest) (gutter = exact line index) (all frames)v0.2 is a rewrite. The 0.1 screen-control tools (click/type) are gone; this version is about recovering code from recordings.
How it works
The gutter is the index. Each row is keyed by the line number printed next to it, so stitching scrolled frames is exact, blank lines are explicit, lines nobody scrolled to are reported by number, and Code Vision rows ("3 个用法", author hints) are skipped for free.
Every row is read on its own. Text detection misses tiny tokens (
},*/, single-digit line numbers), so rows are cut out by their ink and sent straight to the recogniser (PP-OCRv6 via RapidOCR; DirectML GPU on Windows).Spaces and indentation come from pixels. In a monospace font a gap of k cells is k spaces. Full-width Chinese punctuation is told apart from ASCII by its width.
Every frame votes, and code-aware fixes repair typical slips (
11 注释→// 注释,S1f4j→Slf4j,import java.util.list→List) — only where the misread form is not valid code, and flagged for review.Names come from the code: a Java file is named by its public type and placed by its
package; IDEA's navigation bar gives the module directory and non-Java paths.
Measured (v0.2)
Synthetic IDEA recordings rendered from a real multi-module Spring Boot project
(苍穹外卖 day01 skeleton: Java with Chinese comments, pom.xml, YAML, MyBatis XML), 1080p,
Darcula, Code Vision on, page-down + wheel scrolling (tools/make_video.py),
RTX 4060 Laptop with DirectML:
recording | files | exact lines | time |
8 files, 12 s | 8/8, right paths | 274/274 | 20 s |
whole project (93 files, 3197 lines), 130 s | 93/93, right paths | 98.5 %¹ | ~3.5 min |
¹ measured one iteration before the last fixes; remaining errors are mostly Chinese
punctuation and // markers in comments, plus a few letter-case slips.
Related MCP server: plate
Recording checklist
Line numbers on (default) — they make stitching exact.
Navigation bar visible (View → Appearance → Navigation Bar, or the status-bar breadcrumb in the new UI) — gives each file its module and directory.
Expand all folds before scrolling:
Ctrl+Shift+NumPad +(imports are folded by default).Inlay hints off (Settings → Editor → Inlay Hints): parameter-name hints sit inside a line.
Font 14 pt or larger, soft wraps off, one editor split, native resolution.
Open each file at the top and PageDown to the end, pausing ~0.5 s per page.
Install
pip install "xiaomi-ocr-mcp[gpu,yaml] @ git+https://github.com/SorenKang/xiaomi-ocr-mcp.git"
xiaomi-ocr-mcp check # ocr_backend should be dml (Windows) or cuda
xiaomi-ocr-mcp check --fix-gpu # if it says cpu although onnxruntime-directml is installedJava syntax checking needs a JDK (javac on PATH or JAVA_HOME).
CLI
xiaomi-ocr-mcp rebuild recording.mp4 -o F:/replica # resumable
xiaomi-ocr-mcp report F:/replica # summary + review queue
xiaomi-ocr-mcp crop F:/replica <file> 40 52 # PNG of those lines from the video
xiaomi-ocr-mcp set F:/replica <file> 47 " return x;"
xiaomi-ocr-mcp verify F:/replica [--build] # javac/XML/YAML (+ mvn compile)Bookkeeping lives in F:/replica/.xocr/: reads.jsonl (frame cache), state.json
(per-line results), overrides.json (your fixes — re-applied on every rebuild), REPORT.md.
MCP
{ "mcpServers": { "xiaomi-ocr": { "command": "xiaomi-ocr-mcp" } } }tool | purpose |
| duration/resolution + sample frames to check readability |
| rebuild in the background |
| ranges to check: syntax errors, never-shown lines, OCR doubts |
| the frame image of those lines + current text |
| fix lines (kept across rebuilds) |
| syntax check, optional |
| helpers |
An agent with vision closes the loop: review_queue → view_lines → compare → set_lines
→ verify, until the queue is empty.
Testing with synthetic recordings
pip install pillow
python tools/make_video.py path/to/project -o demo.mp4 --code-vision
xiaomi-ocr-mcp rebuild demo.mp4 -o out
python tools/evaluate.py path/to/project out --files demo.files.txtLimits
Built for IntelliJ IDEA; other editors work if they show line numbers in a left gutter.
Lines never shown on screen cannot be recovered — they are listed by number.
Review flags are still noisy (many
single/cjkflags on correct lines).
This server cannot be deployed
Maintenance
Related MCP Connectors
Verification videos for AI coding agents: upload recordings over MCP and share viewer links. Keep work moving in parallel and review results asynchronously, when you're ready, from your laptop or phone. Add video evidence to pull requests so teammates can see how your changes work during code review.
Video review and collaboration for teams and agents: a full review interface for agentic video and motion graphics, feedback by voice, screen and drawing on the frame, agents that iterate version by version, and every version's notes and source files saved for the team.
Jam recordings (video, console, network) as context and proof of work for your coding agent.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to capture screen and voice recordings, extract timestamped frames, and receive structured Markdown reports with context for bug fixing and UI feedback.6 npm18MIT
- AlicenseAqualityAmaintenanceEnables coding agents to capture and inspect running projects, resolve real assets from free sources, and check source for design tells, providing an evidence loop for improving websites, games, and motion.101MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-capable coding agents to run a human-gated, evidence-backed reverse-engineering pipeline that turns an unfamiliar repository into layered architecture, behavioral contracts, defect findings, validation gates, and a language-agnostic reimplementation spec.136 npm7MIT
- AlicenseAqualityBmaintenanceEnables users to build and continuously refresh a code index of a repository, then query it to answer architecture, impact, tracing and log questions with verifiable evidence lines. Also checks Java, Kotlin and TypeScript/JavaScript names against real sources and classpaths, and supports commit review and Minecraft/JVM analysis directly from an agent session.51Apache 2.0