
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 分