Skip to main content

自动操作微信MCP服务

Project description

微信消息发送服务器

这是一个基于 MCP (Micro Controller Protocol) 的微信消息发送服务器,通过命令行参数可以灵活配置服务器运行模式和日志级别。

快速开始(本地运行)

  • 本步骤主要是为了本地测试自动操作微信的MCP服务功能
# 先安装服务
pip install xmcp-server-wxauto

# 以默认配置启动服务
xmcp-server-wxauto

# 指定日志级别和传输方式
xmcp-server-wxauto --log-level=INFO --transport=sse --port=8080

使用UVX配置MCP服务

  • 给AI模型提供自动操作微信的MCP服务
{
  "mcpServers": {
    "wechat": {
      "command": "uvx",
      "args": [
        "xmcp-server-wxauto"
      ],
      "env": {}
    }
  }
}

命令行参数

日志级别 (--log-level)

设置服务器的日志输出级别,可选值:

  • DEBUG:详细的调试信息,用于开发和问题排查
  • INFO:正常运行的信息,显示关键操作
  • WARNING:警告信息,可能影响功能但不影响运行
  • ERROR:错误信息,功能无法正常执行
  • CRITICAL:严重错误,可能导致程序崩溃

默认值ERROR

示例

xmcp-server-wxauto --log-level=DEBUG

传输方式 (--transport)

设置服务器与客户端之间的通信协议,可选值:

  • stdio:使用标准输入输出进行通信,适用于进程间通信
  • sse:使用 Server-Sent Events 进行实时通信,适用于网络环境

默认值stdio

注意

  • stdio 模式下日志不会输出到控制台,避免干扰通信
  • sse 模式需要指定端口参数

示例

xmcp-server-wxauto --transport=sse

服务器端口 (--port)

当使用 sse 传输方式时,指定服务器监听的端口号。

默认值8000

示例

xmcp-server-wxauto --transport=sse --port=8080

完整示例

启动一个具有详细日志记录的网络服务器:

xmcp-server-wxauto --log-level=INFO --transport=sse --port=8080

启动一个用于进程间通信的服务器(无日志输出):

xmcp-server-wxauto --transport=stdio

常见问题

  1. 为什么 stdio 模式下看不到日志?

    • stdio 模式使用标准输入输出进行通信,日志输出会干扰通信协议,因此默认禁用控制台日志。
  2. 如何在后台运行服务器?

    • 可以使用 nohupsystemd 等工具将服务器作为守护进程运行。
  3. 端口被占用怎么办?

    • 使用 --port 参数指定其他可用端口,或使用 lsof 命令查找并关闭占用端口的进程。
# 查找占用8000端口的进程
lsof -i:8000

# 终止进程(PID为进程ID)
kill -9 <PID>

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

xmcp_server_wxauto-0.1.2.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

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

xmcp_server_wxauto-0.1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file xmcp_server_wxauto-0.1.2.tar.gz.

File metadata

  • Download URL: xmcp_server_wxauto-0.1.2.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for xmcp_server_wxauto-0.1.2.tar.gz
Algorithm Hash digest
SHA256 133031bbdc093d503e9cbb7f9520a376e0cd894e525c8d6e83780abc5bde47e8
MD5 42787b8068b584b1f92bc89ba873f9e7
BLAKE2b-256 37ecd177c1551e6685209f3704b0272f46cdfc92f790c9bcf4e625d152161c64

See more details on using hashes here.

File details

Details for the file xmcp_server_wxauto-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for xmcp_server_wxauto-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6c3a2ad9e683b60a6073695885ce033dd135886928e33338569cc9e3699ea15b
MD5 3f91e5e4470e5ad96ed4f97208b65f07
BLAKE2b-256 9dfaa39706021d7fff43c12aa20c463cde67a929bcaf52e49cee168b6c62811a

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