
Onsense
io.github.hufirstPublished by GitHub account hufirstv0.3.20Updated Oct 24, 2026
Android phone camera, sensors & files for any MCP client — local, no cloud, no ADB.
Overview
Lets an AI assistant see through a paired Android phone's camera, read its sensors, and move photos, files, and clipboard content over local Wi-Fi.
- What you can do
- Onsense is a PC-side stdio MCP broker for the onSense Android app. Tools include get_live_frame for a current camera frame, read_sensors for battery, ambient light, and accelerometer readings, recent_photos and get_photo for browsing and fetching phone photos, rename_photo for renaming fetched files, get_reference for a designated camera frame, photo, or arbitrary file, and get_cam_fps/set_cam_fps for the phone's camera frame rate. An optional clip bridge daemon on port 8770 pushes images, files, and clipboard content from the phone to the PC and can pull the PC clipboard if enabled.
- When to use it
- Use it when an assistant running on a PC needs live visual or sensor input from a nearby Android phone, or needs to move photos, files, and clipboard content between phone and PC. It suits local, privacy-conscious setups where cloud relays and ADB are unwanted.
- Requirements
- Runs locally via uvx (uv downloads a managed Python). Requires the onSense Android app on a phone on the same local Wi-Fi network, an MCP-compatible stdio client, and a one-time pairing step that stores the phone address and token in ~/.onsense/pair.json. Optional environment variables include PHONE_BASE, PHONE_TOKEN, ONSENSE_CLIP_DIR, ONSENSE_CLIP_MAX_MB, ONSENSE_CLIP_ALLOW_PULL, ONSENSE_CLIP_SET_CLIPBOARD, and ONSENSE_TEST_FRAME.
Installation
In SourceWeft
- Open Onsense in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
onsense — Phone Camera, Sensors & Files for PC AI Agents
Don't describe it. Let your AI see it. onsense is the PC-side MCP broker for the onSense Android app: run uvx onsense pair on your PC, and any MCP-capable AI — Claude Code, Claude Desktop, Codex, or your own agent — can see through your phone's camera, read its sensors, and move files & clipboard both ways. No cloud relay. No ADB.
[onSense demo — Claude Code reads the phone's sensors and camera through onSense]
Claude Code, running on the PC, reads the phone's sensors and looks through its camera to answer — live, over local Wi-Fi.
[onSense demo — Codex does the same through onSense]
…and the same with Codex. onSense is a standard MCP server, so any MCP client works.
Architecture
- The phone runs an HTTP provider on port 8080. It exposes camera frames, recent photos, and sensor readings, all gated by a pairing token.
- The PC package (
onsense) is a stdio MCP broker. It translates MCP tool calls from your AI client into HTTP requests to the phone. - Discovery uses mDNS (
_onsense._tcp.local.). If the phone's IP changes, the broker rediscovers it automatically — no manual reconfiguration needed. - An optional clip bridge daemon on port 8770 lets the phone push camera frames, files, and clipboard content to the PC (and, if enabled, lets the phone pull from the PC clipboard).
Requirements
- uv (provides
uvx; downloads a managed Python automatically — no separate Python install needed) - The onSense Android app installed on a phone on the same local Wi-Fi network as your PC
- An MCP-compatible AI client such as Claude Code, Codex, or any stdio MCP client
Quick Start
0. Fresh PC without uv? Use the app's setup helper (recommended)
On a clean PC, uvx doesn't exist yet and the command below will fail with "'uvx' is not recognized". The easiest fix: install the onSense app first, tap "Start PC setup helper", and open the shown address on your PC. It gives you a one-line command that installs uv, pairs, and registers the MCP server in one go — and because the PC connects out to the phone, it also sidesteps the Windows firewall entirely.
Prefer installing uv yourself? One line:
1. Pair your phone
Run this once. The PC prints a QR code; scan it from the onSense app ("Scan PC QR"). The phone pushes its address and token to the PC, which registers the MCP server automatically.
After pairing, restart your AI client once so it picks up the new onsense MCP server.
2. Use it
Ask your AI client naturally:
"Take a photo of what's in front of my phone." "What are the current sensor readings?" "Show me the last 5 photos on my phone."
The MCP tools are called automatically. In Claude Code you can also use the bundled /onsense slash command (installed during pairing).
3. Diagnose problems
Windows: QR scan times out?
The #1 cause is the Windows firewall dropping the phone's inbound connection:
-
If your Wi-Fi network profile is Public, inbound traffic is blocked hard. Switch it to Private (Settings → Network → your Wi-Fi → Network profile), or just use the app's PC setup helper, which needs no inbound port at all.
-
On a Private network, add a durable allow rule once (run as administrator):
The first-run firewall popup is program-path-scoped and uvx's ephemeral paths silently invalidate it — the port-scoped rule above (TCP 8765–8774, Private) is what actually sticks.
-
If port 8765 is taken,
pairautomatically falls back to the next free port (up to 8774) and the QR reflects the real port — no action needed.
Subcommands
Other MCP clients (Claude Desktop, Codex, …)
uvx onsense pair auto-registers the server with Claude Code (via claude mcp add) — this one-line auto-setup is Claude Code-specific. The MCP server itself is standard stdio MCP, so any MCP-compatible client works once you add it manually. Run uvx onsense pair once first: it saves your phone's address and token to ~/.onsense/pair.json, which the server reads at request time — so you don't put the token in each client's config, and the phone's IP is auto-tracked via mDNS.
Claude Desktop — add to claude_desktop_config.json:
Codex — register via the CLI (verified with Codex CLI 0.142.5):
Codex sandbox note: Codex's default sandbox blocks network access, so the MCP server can't reach your phone and tool calls fail silently. Run Codex with network access enabled (e.g.
--sandbox danger-full-access, or a sandbox policy that permits network) so onsense can talk to the phone on your LAN.
or add to ~/.codex/config.toml:
Restart the client once after adding the server. Any other stdio MCP client works the same way — point it at uvx onsense serve.
MCP Tools
These tools are exposed to your AI client after pairing:
If the phone's IP changes, the broker retries using mDNS autodiscovery before surfacing an error.
Clip Bridge (Phone ↔ PC File & Clipboard)
onsense serve automatically starts a clip daemon on port 8770. You can also run it standalone with onsense clip.
Phone → PC push (POST /clip)
The onSense Android app can push content to the PC:
- Images are saved to disk as
latest.jpg(inONSENSE_CLIP_DIR, default<tempdir>/onsense/). - Text files are saved to disk.
- Other files (video, PDF, etc.) are saved to disk by filename.
- If
--set-clipboardis active, images and text are also injected into the PC OS clipboard so you can paste with Ctrl+V immediately.
By default, --set-clipboard is off — files are saved to disk but the clipboard is not touched.
PC → Phone pull (GET /clip)
Off by default. Enable with:
When enabled, the phone can GET /clip to retrieve the current PC clipboard content (copied files first, then images, then text). Returns 204 if the clipboard is empty.
Ports and environment variables
Security
Local network only. The PC-side services bind to all interfaces but reject connections from non-private IP addresses at the application layer. They are not intended to be exposed to the internet.
HMAC request signing. The pairing token is never sent in cleartext. Every authenticated request is signed with HMAC-SHA256 over METHOD\npath\ntimestamp\nnonce\nalgorithm, keyed by a signing key derived from the pairing token via HKDF-SHA256 (a key separate from the encryption key), and carries X-Ts / X-Nonce / X-Sig / X-Enc headers. Servers verify in constant time, reject timestamps outside a ±300 s window, and reject reused nonces — so a sniffed request cannot be replayed and the token cannot be stolen off the wire. New Android installs generate a 128-bit random token, stored on the phone and in ~/.onsense/pair.json (chmod 600) after pairing. (The /health endpoint is unauthenticated.) See PROTOCOL.md for the exact wire format.
Pull and clipboard injection are off by default. GET /clip (phone pulls PC clipboard) and OS clipboard auto-injection (phone push → Ctrl+V) are disabled unless you explicitly pass --allow-pull or --set-clipboard.
Encrypted bodies (AES-256-GCM). Sensitive payloads — camera frames, photos, sensor data, files, and clipboard content — are encrypted between the phone and your PC with AES-256-GCM (no cloud in between, so there is no third party to decrypt them). The key is derived from the pairing token via HKDF-SHA256 (a key separate from the signing key); each message uses a fresh 96-bit nonce, and the GCM tag authenticates the body and binds it to its request (so tampering or response substitution is rejected). A passive sniffer on the same Wi-Fi sees only ciphertext. Low-sensitivity metadata stays plaintext: the open /version and /health endpoints, HTTP error responses, and the saved-file path returned after a push. (Note: large transfers currently buffer the body in memory while encrypting/decrypting — chunked streaming for very large files is a future step. Transport-level TLS is also a possible future hardening.)
File size cap. Incoming pushes are rejected if they exceed ONSENSE_CLIP_MAX_MB (default 200 MB). Set to 0 to remove the cap.
Reporting a vulnerability. Please report security issues privately — see SECURITY.md. Do not open a public issue for security reports.
License
MIT. See LICENSE.
Source: README.md at commit 8027d37
Tools
0Version history
1- v0.3.20LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts