Powerful MCP server for Termux — let AI agents run shell commands on your Android device in real time
Project description
A lightweight HTTP server that exposes Termux Shell as a streaming API — built to pair with AI agents, Claude, or Postman.
📖 What is TermuxMCP?
TermuxMCP runs inside Termux and provides a simple HTTP interface so any AI agent can:
- 🖥️ Execute shell commands with real-time streaming output
- 📂 Navigate directories with persistent
cdstate - 📦 Install packages non-interactively (
pkg install,apt install) - 💓 Check server health via
/ping
AI / API Call ──► POST /run {"cmd": "ls -la"} ──► TermuxMCP ──► Termux Shell
│
◄── chunked streaming output ───┘
Quick Start
1 — Install in Termux
pkg update && pkg install python git -y;git clone https://github.com/termuxgpt/termux-mcp;cd termux-mcp;python -m termux_mcp
or Try below method (recommended)
curl -fSL https://termux-mcp.pages.dev/add-repo.sh | bash
pkg install termux-mcp
termux-mcp
2 — Test it
# Health check
curl http://localhost:8080/ping
# Run a command
curl -X POST http://localhost:8080/run \
-H "Content-Type: application/json" \
-d '{"cmd": "ls ~"}'
# Install a package (streaming output)
curl -X POST http://localhost:8080/run \
-H "Content-Type: application/json" \
-d '{"cmd": "pkg install python"}'
3 — Custom port
TERMUX_MCP_PORT=9090 python -m termux_mcp
API Reference
| Method | Path | Body | Response |
|---|---|---|---|
| GET | /ping |
— | {"status":"ok","cwd":"..."} |
| POST | /run |
{"cmd": "<shell>"} |
Chunked plain-text stream |
Streaming Response Format
Output uses HTTP chunked transfer encoding (Transfer-Encoding: chunked).
Read it line by line — each line is real terminal output as it happens.
Configuration
All settings can be overridden via environment variables:
| Variable | Default | Description |
|---|---|---|
TERMUX_MCP_PORT |
8080 |
HTTP listen port |
TERMUX_MCP_HOST |
0.0.0.0 |
Bind address |
HOME |
Termux home | Working directory base |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file termux_mcp-0.2.1-py3-none-any.whl.
File metadata
- Download URL: termux_mcp-0.2.1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1284cf3d2950f19b891ee29b62a6c53ca876edbc8053cd9477d5f4fc42c0e4e2
|
|
| MD5 |
efff15d0cc364fec606fb9d49122027f
|
|
| BLAKE2b-256 |
3f9280a03061a03e365a4d2984eed4d5cadba04800f84e846af5e448bf08f512
|