Skip to main content

wxautox4-mcp

wxautox4 全功能微信自动化 MCP 服务器,覆盖 wxautox4 所有公开 API,共 48 个工具。

功能概览

分类 工具数 说明
系统管理 6 初始化、状态、账号信息、关闭、显示窗口、工具列表
消息操作 9 发送文本/链接/语音/文件/批量消息、@所有人、获取消息/历史/新消息
聊天操作 6 切换聊天/页面、获取聊天信息/弹窗、关闭聊天
联系人操作 5 获取好友/新好友、添加好友、编辑好友、标签联系人
群组操作 7 创建群、添加成员、修改群名/公告/昵称/备注、获取群列表
朋友圈 2 获取朋友圈、发布朋友圈
会话操作 3 获取会话/未读会话、筛选会话
监听操作 4 添加/移除监听、开始/停止监听
文件操作 3 发送图片、发送目录文件、检查文件
子窗口操作 3 获取子窗口/所有子窗口、加载缓存

安装

方式一:pip 安装(推荐)

pip install wxautox4-mcp

方式二:从源码安装

git clone <repo-url>
cd wxautox4-mcp
pip install -e .

方式三:拷贝安装

将整个 wxautox4-mcp 目录拷贝到目标电脑,然后:

cd wxautox4-mcp
pip install -e .

前置条件

  • 操作系统:Windows(微信桌面版仅支持 Windows)
  • Python:>= 3.9
  • 微信桌面版:已安装并登录
  • wxautox4:已安装并已授权
pip install wxautox4

配置

Claude Desktop / Claude Code

在 MCP 配置文件中添加:

{
  "mcpServers": {
    "wxautox4": {
      "command": "python",
      "args": ["-m", "wxautox4_mcp.server"]
    }
  }
}

配置文件位置:

  • Claude Desktop:%APPDATA%\Claude\claude_desktop_config.json
  • Claude Code:项目目录下 .mcp.json 或全局 ~/.claude/mcp.json

Trae IDE

在 Trae 的 MCP 设置中添加同样的配置。

SSE 模式(多客户端共享)

启动 HTTP 服务器:

wxautox4-mcp --transport sse --host 0.0.0.0 --port 8000

客户端配置:

{
  "mcpServers": {
    "wxautox4": {
      "url": "http://<服务器IP>:8000/sse"
    }
  }
}

使用方法

1. 初始化

首次使用必须先调用 wechat_initialize:

请帮我初始化微信自动化

2. 常用操作示例

# 发送消息
给张三发送"你好"

# 获取未读消息
查看我的未读消息

# 发送文件
给李四发送文件 C:\Users\doc.pdf

# 获取好友列表
查看我的好友列表

# 创建群聊
创建一个群聊,成员是张三、李四,群名叫"测试群"

# 发布朋友圈
发布朋友圈"今天天气真好"

# @所有人
在"工作群"里@所有人,消息是"明天开会"

工具详细说明

系统管理

工具 参数 说明
wechat_initialize resize(bool), debug(bool) 初始化微信实例,首次使用必须调用
wechat_get_status 无 获取微信运行状态
wechat_get_my_info 无 获取当前账号信息
wechat_shutdown 无 关闭微信客户端
wechat_show 无 显示微信窗口
wechat_list_tools 无 列出所有可用工具

消息操作

工具 参数 说明
send_message msg, who, at, exact 发送文本消息
send_url_card url, who, exact 发送链接卡片
send_audio filepath, who, exact 发送语音(silk格式)
send_files filepath, who, exact 发送文件(多文件逗号分隔)
send_bulk_messages messages(JSON) 批量发送消息
at_all msg, who, exact @所有人
get_messages 无 获取当前聊天所有消息
get_history n 获取历史消息
get_next_new_message filter_mute 获取下一个新消息

聊天操作

工具 参数 说明
switch_chat who, exact 切换到指定聊天
switch_to_chat 无 切换到聊天页面
switch_to_contact 无 切换到联系人页面
chat_info 无 获取当前聊天信息
get_dialog 无 获取当前弹窗
close_chat 无 关闭聊天窗口

联系人操作

工具 参数 说明
get_friends n, save_avatar 获取好友列表
get_new_friends 无 获取新好友请求
add_new_friend who, msg, exact 添加新好友
edit_friend_info who, remark, tags, exact 编辑好友信息
get_tag_contacts tag 获取标签联系人

群组操作

工具 参数 说明
create_group members, name 创建群聊
add_group_members who, members, exact 添加群成员
set_group_name who, name, exact 修改群名
set_group_announcement who, announcement, exact 设置群公告
set_group_nickname who, nickname, exact 设置群昵称
set_group_remark who, remark, exact 设置群备注
get_recent_groups 无 获取最近群聊

朋友圈

工具 参数 说明
get_moments 无 获取朋友圈
publish_moment content, images 发布朋友圈

会话操作

工具 参数 说明
get_sessions 无 获取会话列表
get_unread_sessions 无 获取未读会话
filter_sessions has_unread, ismute 筛选会话

监听操作

工具 参数 说明
add_listen_chat who, savepic 添加监听聊天
remove_listen_chat who 移除监听聊天
start_listening 无 开始监听
stop_listening 无 停止监听

文件操作

工具 参数 说明
send_image filepath, who 发送图片
send_directory_files directory, who, pattern 发送目录下文件
check_file_exists filepath 检查文件是否存在

子窗口操作

工具 参数 说明
get_sub_window nickname 获取子窗口
get_all_sub_windows 无 获取所有子窗口
load_more_cache 无 加载更多缓存

许可证

MIT

Metadata

Release files for wxautox4-mcp 1.0.6

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

Source distribution (sdist)

Source distribution for wxautox4-mcp 1.0.6
File Size Uploaded Provenance Actions
wxautox4_mcp-1.0.6.tar.gz 20.0 kB Without provenance Details for wxautox4_mcp-1.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wxautox4-mcp 1.0.6
File Interpreter ABI Platform Actions
wxautox4_mcp-1.0.6-py3-none-any.whl Python 3 none any Details for wxautox4_mcp-1.0.6-py3-none-any.whl

Total release size: 34.8 kB

Release files / wxautox4_mcp-1.0.6.tar.gz

Download URL wxautox4_mcp-1.0.6.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
355923115d8c2e734dd2527ccc93a74abb9fe16c93106f054de32afe7d49709f
BLAKE2b-256 checksum
How to use checksums
a6cfb81ff6e3ebce5a0e8d6343d2d5840d5c52b0746bace91cd7e1b5d6789a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / wxautox4_mcp-1.0.6-py3-none-any.whl

Download URL wxautox4_mcp-1.0.6-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4dce4b8dc198a3c547db2c71c097dd04adf6875f4792bb1276f06de7c33ef86
BLAKE2b-256 checksum
How to use checksums
a7137f620603c8140a57aa7e866be0f16010fb0dde11a7620299009b46d68358
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Security for wxautox4-mcp 1.0.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.0.6 This release

2 release files No 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