autoglm-mcp-server
Enables AI models to control Android devices via ADB through natural language commands, supporting screen analysis and automated actions.
README
AutoGLM MCP Server
A Model Context Protocol (MCP) server for the AutoGLM-Phone API, enabling automated GUI interaction on mobile devices.
Overview
This MCP server provides tools for interacting with the AutoGLM-Phone API, which allows AI models to control mobile devices through a series of actions. The server supports Android (ADB).
Quick Start
Using npx (Recommended)
# Run directly without installation
npx -y autoglm-mcp-server
# With options
npx -y autoglm-mcp-server --transport http --port 3000
Global Installation
npm install -g autoglm-mcp-server
autoglm-mcp-server
Local Installation
npm install autoglm-mcp-server
MCP Client Configuration
Claude Desktop / Cursor (stdio mode)
{
"mcpServers": {
"autoglm": {
"command": "npx",
"args": ["-y", "autoglm-mcp-server"],
"env": {
"AUTOGLM_API_KEY": "<YOUR_API_KEY>"
}
}
}
}
StreamableHTTP Mode
First start the server:
npx -y autoglm-mcp-server --transport http --port 3000
Then configure your MCP client:
{
"mcpServers": {
"autoglm": {
"url": "http://127.0.0.1:3000/mcp",
"headers": {
"Authorization": "<YOUR_API_KEY>"
}
}
}
}
Configuration
Set the following environment variables:
export AUTOGLM_API_KEY="your-api-key-here"
export AUTOGLM_API_URL="https://open.bigmodel.cn/api/paas/v4" # optional
export AUTOGLM_MODEL="autoglm-phone" # optional
Or create a .env file based on .env.example.
Usage
Development
npm run dev
Build
npm run build
Production
# stdio mode (default)
npm start
# HTTP mode
node dist/index.js --transport http --port 3000
# SSE mode
node dist/index.js --transport sse --port 3000
# HTTP mode on all interfaces
node dist/index.js --transport http --host 0.0.0.0 --port 3000
Command Line Options
| Option | Alias | Description | Default |
|---|---|---|---|
--transport |
-t |
Transport type: stdio, http, or sse |
stdio |
--port |
-p |
Port for HTTP/SSE transport | 3000 |
--host |
-h |
Host for HTTP/SSE transport | 127.0.0.1 |
--help |
Show help message |
Available Tools
autoglm_list_adb_devices
List all Android devices connected via ADB (Android Debug Bridge).
Parameters:
response_format('markdown' | 'json', optional): Output format
Returns:
- Device ID, status, connection type, model, Android version, screen dimensions
Example:
{}
autoglm_task
Execute a task on a connected device using AutoGLM online model. The model will iteratively capture screenshots, analyze the screen, and execute actions until the task is complete.
Parameters:
prompt(string, required): Natural language task description (1-5000 characters)device_id(string, optional): Target ADB device IDmax_steps(number, optional): Maximum steps to execute (default: 100, range: 1-200)lang('cn' | 'en', optional): Language for responses (default: 'cn')
How it works:
- Captures the current screen via ADB
- Sends the screen image and task prompt to AutoGLM online model
- The model analyzes the screen and decides on the next action
- Executes the action via ADB
- Repeats until the task is complete or max_steps is reached
Example:
{
"prompt": "Open WeChat and send a message to Mom saying hello",
"max_steps": 50,
"lang": "cn"
}
Supported Actions
The AutoGLM model can execute the following actions:
| Action | Description | Parameters |
|---|---|---|
| Launch | Launch an application | app_name |
| Tap | Tap at coordinates | x, y (0-1000 scale) |
| Type | Type text | text |
| Type_Name | Type text by name | text |
| Swipe | Swipe between coordinates | x1, y1, x2, y2, duration |
| Back | Go back | - |
| Home | Go to home screen | - |
| Double Tap | Double tap at coordinates | x, y |
| Long Press | Long press at coordinates | x, y, duration |
| Wait | Wait for duration | duration (ms) |
| Take_over | Request human takeover | reason |
| Note | Add a note | text |
| Call_API | Call an API endpoint | endpoint, params |
| Interact | Interact with UI element | element, action |
Coordinate System
All coordinates use a 0-1000 scale relative to screen size:
- (0, 0) is top-left corner
- (1000, 1000) is bottom-right corner
Project Structure
autoglm-mcp-server/
├── src/
│ ├── index.ts # Main server entry point
│ ├── constants.ts # Configuration constants
│ ├── types.ts # TypeScript type definitions
│ ├── tools/
│ │ └── autoglm-tools.ts # MCP tool implementations
│ ├── services/
│ │ ├── autoglm-api-client.ts # AutoGLM API client
│ │ ├── autoglm-client.ts # AutoGLM client wrapper
│ │ └── adb-service.ts # ADB device service
│ └── schemas/
│ └── index.ts # Zod validation schemas
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
├── .env.example
└── README.md
HTTP/SSE Authentication
When using HTTP or SSE transport, you can pass the API key via the Authorization header:
# Bearer token format
curl -X POST http://localhost:3000/mcp \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"initialize",...}'
References
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。