
Nano Mcp Termux
io.github.Lmeng486由 GitHub 账号 Lmeng486 发布v1.1.1更新于 Oct 24, 2026
Zero-dependency single-file MCP server for Termux/Android, Raspberry Pi and Linux
概览
一个零依赖、单文件的 Python MCP 服务器,面向 Termux/Android、树莓派和 Linux,向 AI 助手报告设备、运行时与路径信息。
- 可以做什么
- 查看设备信息:通过 device_status 获取电池、存储、架构与内存
- 检查服务器运行状况:进程号、运行时长、请求计数、子进程、内存占用及 Android 进程查杀风险
- 解析 Android/Termux 路径:规范形式、挂载点、noexec 或只读标志、大小写敏感性与引号转义警告
- 读取环境概况:运行时类型、主目录、前缀与临时目录、Android 存储根目录及 noexec 挂载列表
- 适用场景
- 适合在 Android/Termux、树莓派或小型 Linux 设备上运行 AI 客户端时使用,让助手在执行命令前了解设备状态、服务器健康状况和文件系统特性。它是诊断用的旁挂服务,不是通用命令执行器。
- 运行要求
- 作为本地 stdio 进程由 MCP 客户端启动。需要 Python 3(源码构建支持 3.8+),或通过 uvx/pip 安装 PyPI 包;Docker 可选。未声明需要账号、API 密钥或网络访问。可选环境变量 NANO_IDLE_TIMEOUT 与 NANO_NO_WATCHDOG 用于调整空闲退出与看门狗。
安装
在 SourceWeft 中
- 打开 控制台中的 Nano Mcp Termux,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
nano-mcp-termux
Zero-dependency, single-file MCP server for AI agents, natively running on Termux (Android), Raspberry Pi, and Linux.
[GitHub Repository] [License: MIT] [MCP Version] [Docker Ready] [Version] [Tests] [CI] [Zero Dependencies]
🚀 Quick Start
Local (Termux / Linux)
Docker
Health check (one-shot, no MCP handshake)
🔌 Connect to your MCP client
This server does not run standalone — it's a sidecar that your AI client connects to via the MCP protocol.
Below are the three most common ways to mount it.
Option 1 — Zero‑install (uvx), best for desktop AI clients
Then add this JSON to your AI client's mcpServers config (see client‑specific notes below):
Option 2 — Already pip installed, or you prefer a direct Python launch
Config snippet for your AI client:
Option 3 — Run the single file directly (e.g. inside Termux on Android)
Config snippet for your AI client:
How to use these snippets: client‑specific config files
Tip: after editing the config file, restart your AI client so the new server is detected. If the client supports hot‑reload, you may not need a restart.
Troubleshooting
🛠️ Features
- ✅ Zero-dependency: No external packages required
- ✅ Single-file: All logic in one Python script
- ✅ Cross-platform: Works in Termux (Android), on Raspberry Pi, Linux, and inside Docker
- ✅ Container-ready: Dockerfile at repo root for Glama introspection
- ✅ Standard stdio framing: Newline-delimited JSON-RPC (official MCP transport)
- ✅ Version negotiation: Echoes client
protocolVersion(2024-11-05 / 2025-06-18 / 2025-11-25), falls back to highest supported - ✅ Graceful degradation:
device_statusnever fails; unavailable inputs are marked, not crashed - ✅ [lifecycle] No orphaned processes: every command runs in its own process group; timeouts kill the whole tree (
SIGTERM→SIGKILL), never just the shell - ✅ [lifecycle] Self-terminating: parent-process watchdog + stdin-EOF detection + optional idle timeout, so a dead client never leaves a zombie server behind
- ✅ [lifecycle] Phantom Process Killer aware: reports Android 12+ child-count risk with concrete mitigations
- ✅ [paths] Android/Termux path adapter: resolves
/sdcard↔/storage/emulated/0↔$HOME/storage/shared, detectsnoexecmounts, case-insensitive filesystems, and shell-quoting hazards
🧩 Tools Overview
🔗 Protocol Surface
🔄 Why 1.1.0: the orphan-process bug
Version 1.0.0 ran commands with subprocess.run(..., timeout=...). On timeout,
Python terminates only the direct child — the sh -c wrapper. Anything the
shell had already spawned is reparented to init and survives forever. On
Android that is the exact leak class that trips the Phantom Process Killer
and can get the whole app group killed.
1.1.0 fixes this at the root: commands are spawned with start_new_session=True
and torn down with os.killpg(pgid, SIGTERM) → SIGKILL, so the entire process
tree dies together.
The repository ships a reproducible A/B regression test for it:
✅ Tests
verify_glama_build.sh answers one question: will Glama's builder be able to
install and introspect this repo? It replays the same toolchain Glama uses
(uv venv && uv pip install -e ., i.e. a newer setuptools than most dev
machines have), then asserts the console entry point exists and that the server
answers initialize + tools/list over stdio. Exit codes are deliberately
three-valued so the script never lies about whose fault a failure is:
The index is pinned to pypi.org on purpose — a local mirror inherited from
your shell profile can return 403 and make a healthy repo look broken. Override
with GLAMA_VERIFY_INDEX=https://your-mirror/simple only if you mean it.
Deprecation warnings about project.license are expected and non-fatal: the
SPDX form that silences them needs setuptools>=77, which requires Python 3.9+,
while this project still supports 3.8 source builds.
⚙️ Environment variables
🔗 Links
- Original repository: Lmeng486/nano-mcp-termux
- Verification report: awesome-termux-mcp
- Measured overhead report (this server as subject under test, all numbers from a real device): MCP on Mobile: Measured Overhead Report
- Dev.to article: Showdev: A zero-dependency MCP server that runs on Android Termux
- Glama score verification (TDQS 4.6 / grade A, with version-metadata forensics): docs/GLAMA-SCORE.md
This server is designed to pass Glama introspection checks and serve as a lightweight MCP implementation for mobile and edge devices.
来源:README.md,提交 b37343f
工具
0版本历史
2- v1.1.1最新Oct 16, 2026
- v1.1.0Oct 12, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分