Skip to main content

Powerful MCP server for Termux — let AI agents run shell commands on your Android device in real time

Project description

Termux Tutor

A lightweight HTTP server that exposes Termux Shell as a streaming API — built to pair with AI agents, Claude, or Postman.

Python Platform License Status


📖 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 cd state
  • 📦 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

termux_mcp-0.2.3.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termux_mcp-0.2.3-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file termux_mcp-0.2.3.tar.gz.

File metadata

  • Download URL: termux_mcp-0.2.3.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for termux_mcp-0.2.3.tar.gz
Algorithm Hash digest
SHA256 c86d43337654087056015651d0dbe9e925f5bd2286a405b86237b96d301a804e
MD5 540ea132389dca4e8f36263688988562
BLAKE2b-256 ce45ebd8d99c80fafc1d07c6ed1e77fb172c4ac172e1808f19bad9a3a7d29836

See more details on using hashes here.

File details

Details for the file termux_mcp-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: termux_mcp-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for termux_mcp-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 14609fb4311ef90ff3a3987655660fd595a2fb293730f8f4ef39178e751b1d78
MD5 99611cae9197cfcf0dd876169fa09ae9
BLAKE2b-256 3754ca782cdfd797a1810f9b9a4e80a443839e6c6339f433018021d7aa8bf2e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page