termux-mcp-bridge
Enables AI assistants to interact with an Android phone through Termux, including running shell commands, listing and opening apps, opening URLs, sending notifications, reading battery/Wi-Fi/volume status, getting location, reading or writing the clipboard, and speaking via text-to-speech.
π± termux-mcp-bridge
π English Β· Π ΡΡΡΠΊΠΈΠΉ Β· ΔeΕ‘tina
Give your AI assistant hands on your Android phone. A tiny, zero-dependency MCP server that runs in Termux and lets AI clients like Claude, ChatGPT or Notion AI run commands, open apps, send notifications, read battery and location, and more. No root, no ADB, no PC needed.
AI client ββHTTPSβββΆ Cloudflare quick tunnel βββΆ 127.0.0.1:8765 (Termux) βββΆ your phone
(secret URL path)β¨ Features
One-line install. Nothing to configure and no accounts to create.
No port forwarding. Uses a free Cloudflare quick tunnel, so it works on mobile data and any Wi-Fi.
Self-healing. A watchdog restarts the server and tunnel when the connection drops.
Permanent link with an optional free Cloudflare Worker relay.
Never copy links again. Each new tunnel URL is published to your private ntfy topic, so your AI client always finds the current one.
Autostart after reboot via Termux:Boot.
Zero npm dependencies. About 120 lines of plain Node.js.
Related MCP server: Termux MCP Server
π Tools
Tool | What it does |
| Run any shell command in Termux |
| List installed apps (with filter) |
| Launch an app by package name |
| Open a link in the browser or a matching app |
| Show a notification |
| Battery, charging, temperature, Wi-Fi, volume |
| GPS / network location |
| Read or write the clipboard |
| Text-to-speech out loud |
π Install
Install from F-Droid (not Google Play):
Termux:API: needed for notify, battery, location, clipboard, TTS
Termux:Boot (optional): autostart. Open it once after installing.
In Termux run:
curl -fsSL https://raw.githubusercontent.com/belacorc/termux-mcp-bridge/main/install.sh | bashThe installer prints your MCP link and your private ntfy topic.
Add the link to your AI client as a remote MCP server (Streamable HTTP), for example:
{ "mcpServers": { "phone": { "url": "https://xxxx.trycloudflare.com/mcp/<token>" } } }Local stdio mode
To run it from a local MCP client inside Termux, without the tunnel:
{ "mcpServers": { "phone": { "command": "node", "args": ["/data/data/com.termux/files/home/termux-mcp-bridge/bridge.mjs", "--stdio"] } } }π Daily use
~/termux-mcp-bridge/start.sh # start (also runs automatically on boot)
~/termux-mcp-bridge/stop.sh # stopQuick tunnel URLs change on every restart. To always get the current one:
curl -s "https://ntfy.sh/<your-topic>/json?poll=1&since=24h" | tail -n 1Or use the helper from client/phone.sh:
export BRIDGE_TOPIC=pb-xxxxxxxx
./client/phone.sh phone_status
./client/phone.sh shell '{"command":"uname -a"}'π Permanent link (optional, free)
Quick tunnel URLs change on every restart, so a chat AI (Claude, ChatGPT) would need the new link each time. Fix it with the tiny Cloudflare Worker in relay/worker.js. It reads the current URL from your ntfy topic and proxies requests there, so your link never changes:
https://phone.<your-subdomain>.workers.dev/mcp/<token>Create a free Cloudflare account and go to Workers & Pages β Create β Start with Hello World. Name it
phoneand deploy.Click Edit code, paste
relay/worker.js, then Deploy.Under Settings β Variables and Secrets, add a secret
TOPICwith your ntfy topic.Use
https://phone.<your-subdomain>.workers.dev/mcp/<token>in your AI client. The token is in~/.bridge_token.
The worker only forwards /mcp/* paths and the phone still checks the token, so a wrong token gets 404.
π Security
β οΈ The MCP link = full shell access to your Termux. Treat it like a password.
The server listens on
127.0.0.1only. The outside world reaches it only through the tunnel, and only on the secret path/mcp/<random 144-bit token>. Every other path returns 404.The token is stored in
~/.bridge_token. Delete that file and restart to rotate it.The ntfy topic name is random and acts as a secret too. Anyone who knows it can read your current link, so don't share it.
Run
stop.shwhen you don't need the bridge.
π§© Files
File | Purpose |
| The MCP server (JSON-RPC over HTTP) |
| Starts server + tunnel, publishes link |
| Health check every 60 s, auto-restart |
| Start / stop everything |
| Termux:Boot autostart script |
| One-line installer |
| Call tools from any machine via ntfy lookup |
| Optional Cloudflare Worker for a permanent link |
π License
MIT Β© belacorc
Available Tools
9 toolsclipboardA
Phone clipboard: without text = read, with text = write.
Inputs: text.
list_appsA
List installed apps (package names). filter = part of the name, e.g. "tele" or "spotify".
Inputs: filter.
locationA
Current phone location (GPS/network): latitude, longitude, accuracy in meters.
Inputs: provider.
notifyC
Show a notification on the phone (needs the Termux:API app).
Inputs: text (required), title.
open_appA
Open an app by package name (e.g. org.telegram.messenger). Find names with list_apps.
Inputs: package (required).
open_urlB
Open a URL on the phone (browser or a matching app such as YouTube).
Inputs: url (required).
phone_statusA
Phone status: battery (level, charging, temperature), Wi-Fi connection, volume.
Inputs: no named parameters.
shellA
Run an sh command in Termux on the user's Android phone. Working dir is the Termux home; shared storage is ~/storage/shared (after termux-setup-storage). pkg, termux-* commands, am and pm are available.
Inputs: command (required), timeout_ms.
speakC
Speak text out loud on the phone (TTS).
Inputs: text (required), language.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 9 tools
Each dedicated tool targets a distinct phone capability (apps, URL, notification, status, location, clipboard, TTS) and descriptions make the intended use clear. The main overlap is `shell`, which can perform almost every other tool's job (e.g. `am start`, `termux-notification`, `termux-clipboard-get`), and `open_url` vs `open_app` can blur when a URL deep-links into an app, but an agent can still choose reliably.
The set mixes bare nouns (`shell`, `location`, `clipboard`), bare verbs (`notify`, `speak`), and verb_noun pairs (`list_apps`, `open_app`, `open_url`), plus a noun_noun form (`phone_status`). All names use snake_case and are readable, so it is inconsistent but not chaotic.
Nine tools for a phone-control bridge is well-scoped: one general shell plus a small set of convenience wrappers for common device actions. Nothing feels redundant beyond the intentional shell escape hatch, and nothing is missing at the count level.
The surface covers the core remote-control lifecycle: command execution, app discovery/launch, URL handling, notifications, device status, location, clipboard, and TTS. Notable gaps include SMS/contacts, camera/media, file push/pull, and input injection, though most of these can be reached through `shell` (am/pm/termux-api), so agents are not hard-blocked.
Maintenance
Related MCP Connectors
Remote MCP server to control your Android phone from AI assistants with per-app permissions.
Give your Grok Bot a phone: an MCP server to see and use your phone. Also works with Claude.
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoβ¦
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that gives AI agents full control of Android devices and emulators through plain ADB β no companion APK, no extra daemon, no telemetry.2614MIT
- AlicenseNot gradedqualityFmaintenanceZero-dependency Model Context Protocol server for Termux (Android) that gives shell access to your device.2MIT
- AlicenseNot gradedqualityCmaintenanceTurns an Android phone running Termux into a remotely drivable machine, letting an AI agent run shell commands, manage background jobs and tmux sessions, read and write files, install packages, and use Android device features such as battery status, screenshots, notifications, SMS and sensors. It can be reached either over stdio on the same device or over Streamable HTTP with bearer tokens and token scopes from anywhere on the local network, with a confirmation gate on destructive actions, a jailed file API and an audit log.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to securely interact with an Android device running Termux, executing shell commands with configurable timeouts, smart output truncation, and MCP Streamable HTTP transport for multi-session clients.1MIT