phone-mcp-server
Turns an Android device running Termux into an MCP endpoint, exposing a shell execution tool that runs commands in Termux's native environment with configurable timeouts (default 60s), smart truncation of long output, and per-command timing and exit-code reporting.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@phone-mcp-servercheck my phone's battery level and list the files in ~/Downloads"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
📱 phone-mcp-server
English
Turn your Android phone into an MCP server for AI assistants — powerful shell and device integration via Termux.
Built on the Model Context Protocol (MCP), this server allows AI assistants (like Claude Desktop, Cursor, GitHub Copilot CLI, etc.) to securely interact with your Android device running Termux.
Active Maintenance & Fixes: This repository is actively maintained. Compared to the upstream project, known bugs have been addressed and optimized (including environment variables, session lifecycles, execution timeouts, and response truncation). If you encounter any issues or have feature requests, please feel free to open an Issue — they will be handled promptly!
✨ Features
Full Termux Environment: Executes commands within Termux's native environment (
/data/data/com.termux/files/usr/bin), retaining path resolution and shell behavior.Robust Shell Tool:
Configurable timeouts (default: 60s).
Smart output truncation (protecting client context from massive terminal dumps).
Detailed runtime execution profiling and exit-code reporting.
MCP Streamable HTTP Transport: Modern HTTP transport supporting multi-session MCP clients.
Service Management: Includes
restart.shhelper script for easy background lifecycle management.
📋 Prerequisites
Android Phone
Termux installed from F-Droid
Node.js:
pkg install nodejs-lts
🚀 Quick Start
1. Installation
git clone https://github.com/mgyanik/phone-mcp-server.git
cd phone-mcp-server
npm install2. Running the Server
Start in foreground:
node server.jsOr run in background / restart:
chmod +x restart.sh
./restart.sh3. MCP Client Configuration
Add to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"phone": {
"url": "http://<PHONE_IP>:3000/mcp"
}
}
}Replace <PHONE_IP> with your phone's Wi-Fi IP address (displayed in server console output).
Related MCP server: sully-termux-mcp
中文说明
将你的 Android 手机打造成面向 AI 助手的 MCP 服务端 —— 通过 Termux 提供强大的 Shell 与设备控制能力。
本项目基于 Model Context Protocol (MCP),让 AI 编程助手(如 Claude Desktop、Cursor、GitHub Copilot CLI 等)能够直接与运行 Termux 的安卓设备无缝交互。
长期维护与已知问题修复:本项目为一个长期活跃维护的版本。相较原版,我们对已知的大多数缺陷与体验问题进行了针对性修改与重构(如 Termux 原生环境变量加载、会话生命周期回收、超时与大流量输出折叠等)。如果您在使用过程中遇到任何问题或有新功能需求,欢迎随时提交 Issue,我们会尽快响应和修复!
✨ 功能特点
原生 Termux 运行环境:自动注入 Termux 环境变量与
$PREFIX/bin路径,完整保留 Termux 终端生态与工具链支持。增强型 Shell 工具:
支持可配置超时控制(默认 60 秒)。
智能长输出折叠截断(避免命令输出过长刷屏撑爆 AI 上下文窗口)。
精确记录并展示每条命令的耗时和执行状态。
MCP Streamable HTTP 协议:基于官方标准 HTTP 传输协议,支持多客户端会话管理。
便捷启停脚本:附带
restart.sh,支持一键热重载与后台静默运行。
📋 准备工作
安卓手机(Android 设备)
Termux(推荐从 F-Droid 下载安装)
Node.js 环境:
pkg install nodejs-lts
🚀 快速上手
1. 安装项目
git clone https://github.com/mgyanik/phone-mcp-server.git
cd phone-mcp-server
npm install2. 启动服务
前台运行:
node server.js或者使用重载脚本后台启动:
chmod +x restart.sh
./restart.sh3. 配置 MCP 客户端
在你的客户端配置(如 claude_desktop_config.json)中添加:
{
"mcpServers": {
"phone": {
"url": "http://<手机局域网IP>:3000/mcp"
}
}
}将 <手机局域网IP> 替换为你手机当前的 Wi-Fi IP 地址(服务启动日志会打印具体地址)。
📄 License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to control Android devices securely via Shizuku and Termux:API, providing a universal shell tool for command execution and persistent sessions.6Apache 2.0
- FlicenseNot gradedqualityAmaintenanceA secure MCP gateway for Termux that exposes filesystem, shell, and Termux:API tools over a local HTTP endpoint with admin controls, job management, and upstream support.1-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to remotely control an Android device from a PC, using Termux API for camera, location, SMS, notifications, and shell commands over SSH or SSE.MIT
- FlicenseNot gradedqualityBmaintenanceEnables any external AI client to control an Android device's hardware, read sensors, fetch communications, and execute arbitrary shell commands via Termux.4-