Sponsored by Deepsite.site

Termux-API-Tools-MCP-Server 项目说明

Created By
hyhAsma7 months ago
基于Termux-API的部分指令,用于MCP客户端操控Android设备的服务端
Content

Termux-API-Tools-MCP-Server 项目说明

目录

项目概述

本项目是一个基于 Termux-API 的新人练手项目,主要用于通过 MCP 客户端操控 Android 设备。它提供了部分敏感操作功能,包括获取手机信息和执行电话/短信相关操作。

注意:本项目涉及敏感功能,使用时请谨慎,建议敏感信息处理尽量使用本地 LLM。

功能特性

  • 获取手机相关信息(部分功能可能涉及敏感数据)
  • 获取通话记录、获取短信记录等功能(敏感操作)
  • 拨打电话、发送短信等功能(敏感操作)
  • 通过 MCP 客户端进行远程控制

工作逻辑

项目采用以下工作逻辑:

  1. Android 设备(Termux 环境)与 MCP 客户端处于同一局域网;
  2. Termux开启SSHD,并配置远程登陆;
  3. termux-api-tools-mcp-server.py可以链接的到Termux;
  4. 通过MCP客户端 JSON 配置建立连接:
{
    "termux-api-mcp-tools": {
      "name": "termux-api-mcp-tools",
      "type": "stdio",
      "isActive": true,
      "tags": [
        "termux",
        "android",
        "mobile"
      ],
      "command": "python.exe",
      "args": [
        "D:\\test\\termux-api-mcp\\termux-api-tools-mcp-server.py"
      ],
      "env": {
        "TERMUX_SSH_HOST": "192.168.x.xx",
        "TERMUX_SSH_PORT": "xxxx",
        "TERMUX_SSH_USER": "username",
        "TERMUX_SSH_PASSWORD": "password"
      }
    }
}

如何使用

  1. 将上述JSON导入cherry studio或claude等MCP客户端;
  2. 修改其termux-api-tools-mcp-server.py位置为自己本地文件位置
  3. pip install 相关包
  4. 填写env相关信息(前提是termux开启sshd,termux-api-tools-mcp-server.py可以通过网络请求的到termux)

测试截图

已知问题

  • 获取设备上所有无线电模块 (termux-telephony-cellinfo) 有点问题
  • cherry stduio调用电话cell功能存在异常
  • 其他偶发的调用失败情况(可能是手机兼容性问题)
  • 还有几个不常用的API未通过本地测试故没有添加进项目

免责声明

本项目为学习练习用途,开发者对使用本项目可能造成的任何后果不承担责任。涉及敏感操作的功能请谨慎使用,并遵守当地法律法规。

未来计划

  • 完善代码异常处理
  • 增加更多设备控制功能如需更多Android信息可以参考ADB-MCP-Server
  • 提高代码质量和安全性

新人练手项目,请多包涵!联系作者:B站@忘月沁

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Tavily Mcp
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.