Get the FREE Ultimate OpenClaw Setup Guide →

WeChat

WeChat-MCP: let Claude/ChatGPT and other AI assistants read and reply to WeChat for you

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio biboyqg-wechat-mcp python -m wechat_mcp_server

How to use

This MCP server provides programmatic control over WeChat for macOS via the Accessibility API and screen capture. After installing the Python package, you can run the built-in CLI (wechat-mcp) to expose a transport layer (stdio, HTTP, or SSE) that your client tools or IDEs can use to issue MCP-style commands. The server enables a range of capabilities: it can fetch recent messages from any chat (contacts or groups), send automated replies based on chat history, publish text-only Moments posts (with an option to draft-only), and add contacts using a WeChat ID with configurable privacy settings. It also exposes a Claude Code subsystem with five specialized sub-agents to assist with summarization, auto-replies, search, multi-chat monitoring, and relationship insights. You can access detailed API documentation to see exact tool signatures and usage patterns.

When you run the server, you can use the available MCP tools such as fetch_messages_by_chat to retrieve recent chat history, reply_to_messages_by_chat to send replies, add_contact_by_wechat_id to extend your contact list, and publish_moment_without_media to share text-only Moments posts. These tools are designed to integrate with LLM-driven workflows, allowing you to automate conversations, data extraction, and content publishing within WeChat.

How to install

Prerequisites:

  • macOS
  • WeChat for Mac installed and running
  • Python 3.12+ (recommended via pyenv or system Python)
  • Accessibility permissions configured for the terminal app

Installation steps:

  1. Install the MCP server package from PyPI:

    pip install wechat-mcp-server
    
  2. Verify installation and run the MCP server (example using stdio transport by default):

    wechat-mcp --transport stdio
    
  3. If you plan to develop or test with Claude Code or UV, you can use the development flow shown in the repository docs to run via uv:

    # Install uv (if not already available)
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Run the server with uv (assuming the package provides the wechat-mcp executable/script via uv integration)
    uv run wechat-mcp --transport stdio
    
  4. For integration with Claude-based tooling, follow the examples in the README to set up the appropriate transport and directory references.

Tips:

  • Ensure WeChat is running and accessible while the MCP server is active.
  • Grant macOS Accessibility permissions to your terminal when prompted.
  • Choose the transport that best fits your workflow (stdio for local CLI, HTTP or SSE for networked clients).
  1. If you encounter issues, consult the detailed API docs and Sub-Agents guide located in the repository docs.

Additional notes

Tips and considerations:

  • macOS Accessibility permissions are required for the server to interact with WeChat; ensure they are granted to your terminal app (Terminal.app, iTerm2, etc.).
  • The server relies on WeChat for Mac being installed and actively running; unexpected UI changes from WeChat updates may require a server restart or minor adjustments.
  • Available MCP transports include stdio (local CLI), HTTP (streamable-http), and SSE; choose the one that fits your integration pattern.
  • The package exposes 5 Claude Code sub-agents to facilitate chat summarization, auto-replies, search, multi-chat monitoring, and insights; explore them via the Sub-Agents Guide.
  • When publishing Moments, you can publish text-only posts or draft-only posts using the publish_moment_without_media tool with a publish flag.
  • Environment variables are supported if you need to customize paths or behavior; see your deployment environment for details.

Related MCP Servers

Sponsor this space

Reach thousands of developers