Genio520 ISP MCP
# Genio520 ISP MCP
An MCP development bridge for Genio 520: inspect and edit a local source workspace, build a Camera2 diagnostic APK, deploy it through ADB, and retrieve YUV images with capture metadata.
Uses standard Node.js and the official MCP TypeScript SDK. No code indexer, AI runtime, MediaTek BSP, or vendor SDK binary is included. Each user connects their own Android board to their own Windows PC.
## Install
Install Node.js 22 or later, Git, JDK 21, and Android SDK platform-tools, platform 35 and build-tools 35.0.0. Android Studio's JBR can supply the JDK. Source-only tools can run without a board; camera build/deploy currently requires Windows.
```powershell
git clone https://github.com/eric612/Genio520_ISP_MCP.git
cd Genio520_ISP_MCP
npm ci --ignore-scripts
node bin/genio-dev-mcp.mjs doctor
```
Set `GENIO_ANDROID_SDK` and `GENIO_JDK` for custom installations. With exactly one ADB device, no serial is needed; set `GENIO_SERIAL` for multiple devices. The doctor reports missing prerequisites; it does not install SDKs or flash firmware.
## Local MCP client
Copy [examples/mcp.local.json](examples/mcp.local.json), replace the workspace path, and configure your client to launch it. `--write` enables edits and commits; omit it for inspection and camera validation. Use an absolute Node executable path if the client's default is older than 22.
```json
{
"mcpServers": {
"genio_dev": {
"command": "node",
"args": ["D:/dev/Genio520_ISP_MCP/bin/genio-dev-mcp.mjs", "--workspace", "D:/dev/Genio520_ISP_MCP", "--write"]
}
}
}
```
Ask the AI to list sources, read a file, edit it using the returned SHA256, inspect the diff, then build and validate. Edits are restricted to allowed source paths within the workspace. New files require existing parent directories. There is no general shell tool. Building modified source executes it with the local user's permissions; use a workspace and AI client you trust.
| Tool | Function |
| --- | --- |
| `list_source_files` | List allowed source files |
| `read_source_file` | Read UTF-8 content and SHA256 |
| `edit_source_file` | Apply unique exact replacements, or create a file with `expected_sha256: "NEW"` |
| `get_source_diff` | Read selected files' Git status and diffs |
| `commit_candidate` | Commit exactly selected source files; never push |
| `get_target_info` | Inspect ADB, Android, ABI and board build |
| `get_camera_capabilities` | Read HAL-advertised metadata |
| `build_camera_probe` | Build diagnostic APK and return hashes |
| `run_camera_validation` | Run capture or controls suite; return a job ID |
| `get_job` | Check asynchronous validation status |
| `get_report` | Read summary or full report |
## Browser AI
Installing the repository alone does not connect a browser AI to the PC. See [browser connection instructions](docs/public/browser-connection.md). A token-protected, loopback-only Streamable HTTP endpoint is available; it is not an OAuth implementation or a public shared service.
For ChatGPT, the documented private connection is Secure MCP Tunnel, which can forward to this stdio server. It requires the user's own tunnel/account permissions and runtime key. No shared credentials are included. Account-specific browser testing is separate from local MCP protocol testing.
## Validate
See [validated behavior and remaining scope](docs/public/status.md).
```powershell
npm test
node tools/mcp_smoke.mjs --run
```
The camera test closes the existing camera app, installs the diagnostic app, grants it CAMERA permission, wakes the board and captures YUV. The controls suite collects 3 frames for each of 7 cases: auto, two exposures, NR OFF/FAST and linear/lifted tone curves. Each case saves its first frame as NV21 and a viewing JPEG. Reports and the exact APK are stored in `outputs/camera-runs/<run-id>/`.
Control readback does not prove image quality, temporal NR implementation, hardware HDR, sustained frame rate, power or end-to-end latency. WDR/Defog/TNR implementations and other projects' data are not included.
For repeated builds, keep the same local development keystore. When moving a source checkout, set `GENIO_CAMERA_KEYSTORE` to the original `development.keystore` (development alias/password as generated by this project's build script). Different signatures cannot update the same installed app. The tool reports that installation error; it does not uninstall the app or erase its captures. Never commit or distribute the keystore.
The standalone [native ARM64 deployment probe](tools/android_probe/README.md) is a saturating multiply-by-two fixture, not an ISP algorithm.
## License
Public MCP source is [MIT licensed](LICENSE). Dependency copyright and license texts are preserved in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). Android/JDK tools are installed separately under their own terms. No official board photographs, SDK binaries, camera captures or signing keys are distributed.
TDQS
Scored across 11 tools
Each tool has a fairly distinct role: read-only target info, camera capability probing, build, run validation, job status, and report retrieval form a clear pipeline, while the source tools (list/read/edit/diff/commit) are well separated. Minor potential confusion exists between get_job (async job status) and get_report (validation report contents), and between commit_candidate and get_source_diff, but descriptions differentiate them adequately.
Every tool follows a consistent verb_noun snake_case pattern (get_target_info, build_camera_probe, run_camera_validation, commit_candidate, list_source_files, read_source_file, edit_source_file, get_source_diff). No mixed conventions or vague single-word names.
Eleven tools is well within the ideal 3-15 range and each maps to a concrete step in the camera-validation or source-editing workflow. Nothing seems redundant or missing at the count level.
The surface covers the core lifecycle: board inspection, build, run validation, job polling, report reading, plus a full source read/edit/diff/commit loop. Gaps are minor and largely intentional (no delete/restore source, no job cancellation, no push), which an agent can work around within stated constraints.