nano-mcp-termux is a zero-dependency, single-file MCP (Model Context Protocol) server for AI agents, designed to provide a lightweight MCP implementation in resource-constrained or mobile environments. It natively supports Termux (Android), Raspberry Pi, and Linux, and can run via Docker containers.
Key capabilities include:
- Zero dependencies: no external packages need to be installed; all logic is contained in a single Python script.
- Cross-platform: runs on Termux (Android), Raspberry Pi, Linux, and inside Docker.
- Standard stdio framing: uses newline-delimited JSON-RPC, conforming to the official MCP transport specification.
- Version negotiation: echoes the client protocolVersion (2024-11-05 / 2025-06-18 / 2025-11-25) and falls back to the highest supported version.
- Graceful degradation: the device_status tool never fails; unavailable inputs are flagged rather than causing a crash.
- Process lifecycle management: each command runs in its own process group, and on timeout the entire process tree is terminated (SIGTERM → SIGKILL) to avoid orphan processes; includes a parent-process watchdog, stdin-EOF detection, and an optional idle timeout to prevent zombie servers from lingering; aware of the Android 12+ phantom process killer risk and provides mitigations.
- Android/Termux path adaptation: resolves /sdcard ↔ /storage/emulated/0 ↔ $HOME/storage/shared, detects noexec mounts, case-insensitive filesystems, and shell quoting risks.
Usage: the server does not run standalone; it must be connected as a sidecar by an AI client via the MCP protocol. Three common mounting methods are provided:
- Zero-install (uvx): suitable for desktop AI clients; add a JSON snippet to the client's mcpServers configuration.
- Already pip-installed or preferring direct Python launch: add the corresponding snippet to the client configuration.
- Run the single file directly (e.g., inside Termux on Android). After editing the configuration file, restart the AI client to detect the new server (clients that support hot reload may not need a restart).
Use cases: mobileor edge-device AI agent integration, development and testing that requires a lightweight MCP server, and running AI toolchains in an Android Termux environment.
Limitations: the material does not provide complete details of the specific tool list, performance data, pricing information, or detailed usage steps; some features (such as the tool overview) are not fully elaborated in the original material.