Skip to main content

WeChat Desktop MCP Server

PyPI Python version Platform Tests License: MIT

An MCP server that sends WeChat messages in the background from the Windows desktop client

简体中文 | English


Lets an AI assistant send WeChat (微信 / Weixin) messages for you, now or later, through the desktop client on your PC, without taking over your mouse or keyboard. Windows 10/11 and WeChat 4.0 or later only. Works with any MCP client that runs stdio servers, such as Claude Desktop, Claude Code, Cursor, opencode, DeepSeek Harness, or Codex in the ChatGPT app.

For example: "Send 'on my way' to File Transfer", or "Remind the family group about dinner in 30 minutes".

Setup

Requires the WeChat desktop client, running and logged in. The window can be minimized or covered, but not closed to the system tray.

Install uv, then add the server to your client's MCP configuration (for Claude Desktop: %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "wechat": {
      "command": "uvx",
      "args": ["wechat-desktop-mcp"]
    }
  }
}

For Claude Code:

claude mcp add wechat -- uvx wechat-desktop-mcp

For opencode:

opencode mcp add wechat --global -- uvx wechat-desktop-mcp

For DeepSeek Harness (dsh), add this entry to an agent preset:

- id: mcp-wechat
  name: '@deepseek-ai/dsh-mcp-client'
  config:
    serverName: wechat
    transport: stdio
    command: uvx
    args: ['wechat-desktop-mcp']

Without uv, install Python 3.9+, run pip install wechat-desktop-mcp and use "command": "wechat-desktop-mcp" with no args.

From source

git clone https://github.com/hhuangpanda/wechat-desktop-mcp.git
cd wechat-desktop-mcp
pip install -e .

Then use "command": "wechat-desktop-mcp" as above.

Tools

send_wechat_message

Name Type Description
contact_name string Contact or group name
message string Text to send

The chat is opened from the chat list if it is visible there, otherwise through WeChat's search. A search picks the result whose name matches exactly, or the first result if none does, so a partial name such as File reaches File Transfer, but a vague name can reach the wrong chat.

Returns Message sent and verified in chat '<chat name>', plus (retried: ...) if a step needed a retry. On failure the result has isError: true and text such as Failed to send message (stage=open_chat, reason=contact_not_found_or_chat_not_opened, ...), where stage is one of find_window, version_check, open_chat, set_text, click_send, verify.

schedule_wechat_message

Same parameters as send_wechat_message, plus delay_seconds (number).

Returns Message scheduled for <local time> (in <n> seconds). If WeChat isn't running or is in the tray at that moment, it adds Warning (wechat_not_running) or Warning (wechat_window_not_found); the message stays scheduled, but WeChat must be open by the send time.

show_scheduled_wechat_messages

No parameters. Returns pending messages and the results of the last 20 that fired. Only messages scheduled by this server process are listed, and they are lost when it exits.

{
  "pending": [{"contact_name": "File", "message": "...", "scheduled_for": "2026-11-01T15:00:00-05:00", "seconds_remaining": 30}],
  "recent": [{"contact_name": "File", "message": "...", "scheduled_for": "2026-11-01T14:30:00-05:00", "result": "Message sent and verified in chat 'File Transfer'"}]
}

Background behavior

  • Clicks and typing go to WeChat as window messages, so the mouse, keyboard and other windows are left alone while a message is sent.
  • WeChat itself asks to come to the front when a chat is picked from the list or the search closes. Windows usually refuses and flashes WeChat's taskbar button instead; when it allows it, focus is handed back to your window right away.
  • Messages with emoji or line breaks are pasted, and the clipboard is restored afterwards and kept out of clipboard history. If the clipboard holds something that cannot be restored exactly (such as copied files), the text is typed instead.
  • An unsent draft in the recipient's chat is cleared first. If WeChat is minimized, it is shown without focus during the send and minimized again.
  • Clicking into WeChat yourself during a send can interrupt it; the tool then reports a failure rather than sending the wrong text.
  • WeChat builds that expose no accessibility tree fall back to keyboard input, which needs the foreground and cannot verify delivery.

Testing

tests/test_server.py, tests/test_show_scheduled.py, tests/test_stdio.py and tests/test_detection.py send nothing. These send real messages to File Transfer:

python tests/test_send_chinese.py
python examples/mcp_client_example.py
python tests/e2e_interference.py

The e2e test opens its own window over WeChat and sends real mouse clicks and keystrokes to it while messages are sent, to check that WeChat never takes the foreground and no keystrokes are lost. It moves your cursor, so don't use the mouse or keyboard while it runs.

Troubleshooting

  • stage=find_window: reason=wechat_not_running means WeChat isn't running; wechat_window_not_found means it's running but has no window, usually because it was closed to the tray.
  • stage=version_check: WeChat is older than 4.0; update it.
  • Send failed: stage shows the step. open_chat usually means the name matched no chat; check it as WeChat displays it.
  • Client can't connect: check that uvx (or wechat-desktop-mcp) is on the client's PATH; the server logs to stderr.

Disclaimer

This project has no affiliation with Tencent or WeChat. Automating WeChat may break its terms of service and get your account restricted or banned, and a WeChat update can break this project at any time. Don't use it for bulk messages, spam or harassment. You use it at your own risk.

Acknowledgements

Based on 1052666/WeChat-MCP-Server, reworked here to send in the background and verify delivery.

License

MIT. Bug reports and pull requests are welcome through Issues.

Metadata

Release files for wechat-desktop-mcp 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wechat-desktop-mcp 1.1.0
File Size Uploaded Provenance Actions
wechat_desktop_mcp-1.1.0.tar.gz 39.9 kB With provenance Details for wechat_desktop_mcp-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wechat-desktop-mcp 1.1.0
File Interpreter ABI Platform Actions
wechat_desktop_mcp-1.1.0-py3-none-any.whl Python 3 none any Details for wechat_desktop_mcp-1.1.0-py3-none-any.whl

Total release size: 61.9 kB

Release files / wechat_desktop_mcp-1.1.0.tar.gz

Download URL wechat_desktop_mcp-1.1.0.tar.gz
Size 39.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e7a4c2d085f907854eef504b6a8bd6389a01f1937c4be62bb2d3b3683bdce077
BLAKE2b-256 checksum
How to use checksums
a315a31d8df00adcf70a37ee4b3a170154c380bd78e48047944ec4da200a7fbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / wechat_desktop_mcp-1.1.0-py3-none-any.whl

Download URL wechat_desktop_mcp-1.1.0-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e7d59a9f31157b8a3ce17c170074cd178615293876f2353bd7a802186f51f6f
BLAKE2b-256 checksum
How to use checksums
95fa33e0b4b9bb675593d59eee48ba6e60381339d4d024b379af8c6049d9873c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for wechat-desktop-mcp 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wechat_desktop_mcp-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page