home / mcp / mcp wechat adb server

MCP WeChat ADB Server

一个基于 ADB 的微信自动化 MCP 服务器,为 AI 助手提供微信消息发送和截图功能。适配雷电模拟器(LDPlayer 9),通过 MCP 协议暴露工具接口。

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "dabaigoose-mcp-wechat-adb-server": {
      "url": "http://127.0.0.1:8000/sse"
    }
  }
}

This MCP server enables an AI assistant to control WeChat on an LDPlayer Android emulator through ADB. It exposes two practical tools—sending personalized messages and capturing screenshots—so your AI can interact with contacts and groups as if you were performing the tasks yourself. It is optimized for LDPlayer 9 and integrates with MCP-enabled assistants for seamless automation.

How to use

You connect your MCP client to the WeChat ADB Server to perform two core actions: sending messages to a specific contact or chat and saving a screenshot from the emulator. After the server is running, you can instruct your MCP-powered assistant with natural language prompts like “send a message to Alice” or “take a screenshot.” The assistant will translate these prompts into the available MCP tools and return results such as confirmation messages or the saved screenshot file path.

How to install

Prerequisites you need before starting: Windows 10/11, Python 3.13 or newer, LDPlayer 9 with WeChat installed and logged in, and ADB debugging enabled in the emulator. Ensure the LDPlayer directory path contains no spaces.

# Step 1 — Install LDPlayer and configure basics
#  - Install LDPlayer 9 and set resolution to 1600x900
#  - Install WeChat inside LDPlayer and log in
#  - Verify ADB is accessible from the emulator and note the port

# Step 2 — Set up the Python environment
# Create a Python 3.13 environment (conda recommended)
conda create -n mcp-wechat python=3.13
conda activate mcp-wechat

# Or use uvx to create a virtual environment and install the MCP CLI
uv venv
uv pip install "mcp[cli]"

# Step 3 — Prepare configuration in code
# Ensure the LDPlayer directory is set and the ADB device is reachable
# The server will expose an HTTP MCP endpoint at http://127.0.0.1:8000/sse

# Step 4 — Run the MCP server
python main.py

Additional setup and usage notes

The server exposes two primary tools that you can call through any MCP client configured to access the SSE endpoint.

Available tools: - send_wechat_message(name, message) — Sends a message to a specified contact or chat. Requires that WeChat is logged in on the emulator and the ADB input method is activated.

- screen_save() — Takes a screenshot on the emulator and saves it to the screens/ directory.

Configuration and important notes

Directory and file layout: - main.py is the MCP service entry point that registers tools and runs the SSE server. - wechat_example.py contains WeChat automation helpers (entering chats, typing, sending messages). - adb_utils.py provides basic ADB capabilities (connect, click, activate input method, screenshot, verify activities). - ADBKeyboard.apk is the input method APK required for Chinese input via ADB; it is automatically installed and activated on first use. - screens/ is the folder where screenshots are saved.

Important: Ensure the ADB keyboard APK is present and installed to enable Chinese input in LDPlayer. The server saves screenshots to the screens/ directory. To find the ADB port, run the ADB devices command and use the port reported for LDPlayer.

Contact and search considerations: The target contact or group names must be uniquely identifiable in WeChat so the assistant can open the correct chat. You can use WeChat notes/remarks to help the search process.

Troubleshooting and tips

If the server cannot connect to LDPlayer, confirm that ADB debugging is enabled and that the device port matches the one configured in your setup. Use the following commands to verify connectivity: `` <ldplayer_adb_path> devices <ldplayer_adb_path> connect 127.0.0.1:5555 <ldplayer_adb_path> shell screencap -p /sdcard/screen.png ``

Available tools

send_wechat_message

Sends a message to a specified contact or chat in WeChat on the LDPlayer emulator. Requires WeChat to be logged in and the ADB input method active.

screen_save

Captures a screenshot from the emulator and saves it to the screens/ directory.