Skip to main content

wxautox4 full-featured MCP Server - 微信自动化全功能 MCP 服务器

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wxautox4_mcp-1.0.2.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wxautox4_mcp-1.0.2-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file wxautox4_mcp-1.0.2.tar.gz.

File metadata

  • Download URL: wxautox4_mcp-1.0.2.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for wxautox4_mcp-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4db7ccecc8eeb5e195f062bac22919fc93b133c3294934d1fb6f10a9f1dd6f4d
MD5 a20c242dcbe78e1fbcd86e4957539c78
BLAKE2b-256 bd046f4650dc61e82f0181bfcfe1d4cb5ff21e5148529ab6b1da4bebf1be6d4a

See more details on using hashes here.

File details

Details for the file wxautox4_mcp-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: wxautox4_mcp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for wxautox4_mcp-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 21338c36de571943ce201649b84483ce02ca1c63e3203a0232136da5e0fac628
MD5 a44233aaf3eb9dd5f0a14e70167d81c9
BLAKE2b-256 a2262989a0c2e79ed77a6625cd2a1af2056820931ce0e103c3f268fa95a45f51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page