Metadata-Version: 2.4
Name: android-camera-mcp
Version: 0.5.0
Summary: Turn any Android 10+ phone into a private, LAN-first remote camera for AI agents via MCP
Author: sinhsac
License-Expression: MIT
Project-URL: Homepage, https://sinhsac.github.io/android-camera-mcp/
Project-URL: Repository, https://github.com/sinhsac/android-camera-mcp
Project-URL: Documentation, https://github.com/sinhsac/android-camera-mcp#readme
Project-URL: Issues, https://github.com/sinhsac/android-camera-mcp/issues
Project-URL: Releases, https://github.com/sinhsac/android-camera-mcp/releases
Keywords: mcp,model-context-protocol,android,camera,ai,agent,vision,ocr,claude,cursor,lan
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics :: Capture
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp<2,>=1.2
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Provides-Extra: mdns
Requires-Dist: zeroconf>=0.132; extra == "mdns"
Dynamic: license-file

<!-- mcp-name: io.github.sinhsac/android-camera-mcp -->

# Android Camera MCP

**Turn any Android 10+ phone into a private, LAN-first remote camera for AI agents via the Model Context Protocol (MCP).**

This Python package provides the **Camera Gateway daemon** (TCP `:8765` for phones, local control API `127.0.0.1:8766`) and the **MCP Server (`stdio`)** exposing **15 camera tools** for Claude Desktop, Cursor, Kiro, Antigravity, and custom LLM agents — with zero cloud dependency.

- **Homepage & Guide:** https://sinhsac.github.io/android-camera-mcp/
- **GitHub Repository:** https://github.com/sinhsac/android-camera-mcp
- **Android Companion APK:** https://github.com/sinhsac/android-camera-mcp/releases

## Install

Requires **Python 3.10+**.

```bash
# Run directly with uvx (no manual venv required)
uvx android-camera-mcp --help

# Or install with pip
pip install android-camera-mcp

# Optional: include mDNS / LAN auto-discovery (_android-camera-mcp._tcp)
pip install "android-camera-mcp[mdns]"
```

## Quick Start

### 1. Install the Android Companion App

Download and install the latest **Android Camera Agent** APK (Android 10 / API 29+) from [GitHub Releases](https://github.com/sinhsac/android-camera-mcp/releases).

### 2. Start the Camera Gateway Daemon

Run one long-lived gateway process on your computer so restarting or running multiple MCP clients never drops the phone connection:

```bash
# With pip install
android-camera-mcp gateway

# Or with uvx (including optional mDNS discovery)
uvx --from "android-camera-mcp[mdns]" android-camera-mcp gateway

# Optional flags
android-camera-mcp gateway --port 8765 --api-port 8766 --log-file ~/.android-camera-mcp/gateway.log -v
```

Open **Android Camera Agent** on your phone, tap **Discover** (with `mdns` extra installed) or enter your computer's LAN IP and port `8765`, then tap **Connect**.

### 3. Configure Your MCP Client

Add `android-camera` to your MCP client configuration (Claude Desktop, Cursor, Kiro, Antigravity, etc.):

```json
{
  "mcpServers": {
    "android-camera": {
      "command": "uvx",
      "args": ["android-camera-mcp"]
    }
  }
}
```

Or if installed via `pip install android-camera-mcp`:

```json
{
  "mcpServers": {
    "android-camera": {
      "command": "android-camera-mcp",
      "args": ["mcp"]
    }
  }
}
```

Optional environment variables for the MCP process:
- `ANDROID_CAMERA_API_HOST` (default `127.0.0.1`)
- `ANDROID_CAMERA_API_PORT` (default `8766`)

## Available MCP Tools (15)

| Tool | Description |
|------|-------------|
| `camera_list` | List connected Android agents, online status, cameras, and battery/thermal health |
| `camera_info` | Per-camera capabilities (zoom/EV ranges, flash, manual focus), active lens, queue, pending commands |
| `camera_status` | Live phone state: idle/capturing/streaming, battery, temperature, thermal status, uptime |
| `camera_capture` | Upright JPEG still (`1600px` default; `max_dimension=0` full sensor), presets, phone-side ROI crop |
| `camera_preview` | Fast `640px` live-feed frame for framing checks (supports ROI crop) |
| `camera_analyze` | Offline on-device ML Kit OCR, barcode scanning, and exposure/focus stats (structured JSON, no large JPEG) |
| `camera_stream_start` | Start temporary low-FPS preview stream (with duration and idle auto-stop) |
| `camera_stream_frame` | Read newest stream frame, optionally waiting for one newer than `after_sequence` |
| `camera_stream_stop` | Stop the active stream (idempotent) |
| `camera_set_zoom` | Set zoom ratio on the active camera (clamped to supported bounds, including `<1.0x` ultra-wide) |
| `camera_set_torch` | Toggle continuous flashlight/torch on or off |
| `camera_set_flash` | Set flash mode (`off` / `auto` / `on`) |
| `camera_set_focus` | Configure `continuous` AF, one-shot `auto` AF, or `manual` focus distance (`0.0–1.0`) |
| `camera_set_exposure` | Set EV compensation steps (or omit to reset to auto exposure) |
| `camera_select_lens` | Switch active camera/lens by `camera_id` |

## Development & Tests

```bash
cd server
pip install -e ".[dev,mdns]"
python -m pytest -q
```

## License

MIT License — see [LICENSE](https://github.com/sinhsac/android-camera-mcp/blob/main/LICENSE).
