wexin-push
wechat-push-mcp-server
claude mcp add --transport stdio jasonlat-dot-wexin-push-mcp-server java -Dspring.ai.mcp.server.stdio=true -Dfile.encoding=utf-8 -Dlogging.file.name=./data/mcp/${spring.application.name}.log -jar path/to/wexin-push-mcp-server-1.0.jar --wechat.api.original_id=gh_19674398cb20 --wechat.api.appid=wxae5eccc3b6930993 --wechat.api.appsecret=8fdec049feb30865cc9bb0e1c0b7dad3 --wechat.api.template_id=PhVVqJwyMustdEa2RKMRgl4mU4ZJgdm5hPtsDIns8ms --wechat.api.touser=oxd-l6lb0KOF5KRwBy7GDHxeXaeEHow to use
This MCP server implements the WeChat template message push service using the Model Context Protocol (MCP). It exposes a WeChat Notice capability that allows AI applications to send template messages to users via a standardized MCP interface. The server supports two MCP connection modes: STDIO (recommended for local development) and SSE (for HTTP-based clients). When running in STDIO mode, clients can launch the Java process and pass necessary wechat.api.* flags to configure the WeChat account, template, and recipient. For SSE mode, the server can be run in a container or as a jar and clients connect over HTTP to receive messages via Server-Sent Events.
How to install
Prerequisites:
- Java 17+ (JDK)
- Maven (for building from source)
Install steps:
- Clone the repository
- Build the project with Maven mvn clean package
- Run the MCP server (STDIO mode as an example)
java -Dspring.ai.mcp.server.stdio=true
-Dfile.encoding=utf-8
-Dlogging.file.name=./data/mcp/${spring.application.name}.log
-jar target/wexin-push-mcp-server-1.0.jar
--wechat.api.original_id=gh_19674398cb20
--wechat.api.appid=wxae5eccc3b6930993
--wechat.api.appsecret=8fdec049feb30865cc9bb0e1c0b7dad3
--wechat.api.template_id=PhVVqJwyMustdEa2RKMRgl4mU4ZJgdm5hPtsDIns8ms
--wechat.api.touser=oxd-l6lb0KOF5KRwBy7GDHxeXaeE
Optionally, you can containerize the server and run via Docker or use the SSE mode with a client configuration pointing to the server URL.
Additional notes
Tips:
- Ensure you have a valid WeChat sandbox/test account and have configured original_id, appid, appsecret, template_id, and touser before starting.
- The log file path is ./data/mcp/${spring.application.name}.log by default; make sure the directory exists or adjust the path.
- If using STDIO mode, the client must know the exact jar location and provide all required --wechat.api.* arguments.
- In SSE mode, you can deploy via Docker and expose the port (default 8102 in the README example) and configure the client with the server URL and type: sse.
- Security: avoid committing real appsecret or template IDs in public repositories; use environment variables or secret management where possible.