Wenyan is a multi-platform Markdown typesetting and publishing tool, with the goal of "letting writers focus on content, rather than typesetting and platform adaptation". It supports one-click conversion of Markdown and publishing to multiple content platforms, and covers different usage scenarios in various forms: the macOS App Store version (MAC desktop app), the cross-platform desktop version (Windows/Linux), the CLI version (command line / CI automated publishing), and the Wenyan MCP Server introduced in this entry.
[Purpose] The Wenyan MCP Server opens up a channel between "AI writing" and "publishing to WeChat Official Accounts". Based on the MCP protocol, AI clients such as Claude Desktop can directly call Wenyan's typesetting engine. After finishing an article, there is no need to repeatedly copy and paste in a third-party editor; you can directly have the AI typeset it and put it into the WeChat draft box. Its features include: bypassing typesetting tools (AI-generated Markdown is directly converted into WeChat rich text and uploaded, saving intermediate steps); conversational typesetting (communicate directly with the AI, such as "switch to an orange-style theme", and the style takes effect automatically); completing the closed loop without leaving the window (finish "think of a topic -> write the article -> adjust the typesetting -> save the draft" in the same chat box).
[Main Capabilities]
- One-click publishing of Markdown to the WeChat Official Account draft box.
- Supports remote Server publishing (bypassing IP whitelist restrictions).
- Provides a standard MCP Tool interface.
- Supports automatic AI invocation: rendering Markdown, theme management, and publishing drafts.
- Theme management: can register new themes and delete themes. Example: register https://wenyan.yuzhi.tech/manhua.css as a new Official Account theme named xiuluochang; delete the Official Account theme named xiuluochang.
- Publishing example: use the phycat theme to publish an article to the WeChat Official Account: ./tests/publish.md.
- Image processing: before publishing, Wenyan automatically processes all images in the article according to WeChat requirements and uploads them to the Official Account material library, supporting local hard drive absolute paths (such as /Users/xxx/image.jpg), network paths (such as https://example.com/image.jpg)、当前文章的相对路径(如 ./assets/image.png).
- Image message publishing: the difference from graphic-text message publishing is that the image list must be specified in the frontmatter. Method one (recommended): set type: image, and the CLI automatically extracts all images from the body; method two: manually specify image_list. image_list supports at most 20 images, and the first image is the cover.
[Usage]
- Environment variables and IP whitelist: Environment variables such as WECHAT_APP_SECRET must be configured when MCP starts, otherwise the upload interface call will fail; at the same time, you must ensure that the IP of the machine running Wenyan has been added to the IP whitelist in the WeChat Official Account backend, otherwise the upload interface call will fail. Configuration documentation:https://yuzhi.tech/docs/wenyan/upload。
- frontmatter: Each Markdown file must include frontmatter at the top to be uploaded correctly. If no cover is specified, the first image in the body is automatically used as the cover; cover supports local paths and network URLs; type and image_list are used for publishing image messages.
- Local mode (Stdio Mode): MCP directly calls the WeChat Official Account API to complete image upload and draft publishing. Claude Desktop configuration is written to claude_desktop_config.json.
- Remote client mode (Client–Server Mode): MCP acts as a client and sends publishing requests to the Wenyan Server deployed on a cloud server, and the Server completes the WeChat Official Account API calls. The two modes run exactly the same; choose according to the runtime environment and network conditions. Suitable for users without a local static IP who need to frequently add IP whitelist entries, and supports automatic publishing by AI Agents. The server mode must be used to use the multi-official-account publishing feature; configure multiple WeChat credentials on the server side, and after the MCP client connects to the server, you can specify the official account for publishing, for example: use the phycat theme to publish this article to the WeChat Official Account (your_app_id): ./tests/publish.md.
- Docker method: Suitable for users who do not want to install the Node.js environment. The mounted directory (-v) must mount the host machine's file/image directory to /mnt/host-downloads inside the container; the environment variable HOST_FILE_PATH must be consistent with the path of the host machine's mounted file/image directory. The principle is that local images referenced in Markdown files/articles should be placed in this directory, and Docker will automatically map them so the container can read and upload them.
- Debugging: It is recommended to use the official Inspector for debugging; visit the corresponding link to open the debugging page, select Tools -> List Tools, fill in the parameters, and click Run Tool.
[Use Cases] Writers and Official Account operators who want to use AI clients (such as Claude Desktop) to complete Official Account article formatting and draft publishing; users who need multi-official-account publishing or who have no local static IP and need to bypass IP whitelist restrictions; users who wantto publish content via command line/CI automation; and users who do not want to install Node.js and prefer to use Docker.
[Restrictions and Notes]
- Environment variables such as WECHAT_APP_SECRET must be configured correctly, and the IP of the machine running Wenyan must be in the WeChat Official Account backend IP whitelist; otherwise, upload API calls will fail.
- Each Markdown file must include frontmatter at the top; otherwise, it cannot be uploaded correctly.
- The server mode must be used to use the multi-official-account publishing feature.
- In the Docker method, the mounted directory and the environment variable HOST_FILE_PATH must be consistent.
- The image_list for image messages can contain at most 20 images.
- The project is licensed under the Apache License Version 2.0.
[Project Information] Repository URL:https://github.com/caol64/wenyan-mcp;赞助链接:https://yuzhi.tech/sponsor。