WenYan MCP Server: A Game-Changer for WeChat Public Account Content Management
In today’s digital age, WeChat Public Accounts remain a vital platform for creators to share knowledge and insights. However, the process of formatting, managing images, and publishing content can be quite cumbersome. This is where WenYan MCP Server comes into play, offering a streamlined solution for content creators. In this blog post, we will delve into what WenYan MCP Server is, its key features, and how to effectively use it to enhance your content management process.
What is WenYan MCP Server?
WenYan MCP Server is a server component based on the Model Context Protocol (MCP). It enables the conversion of Markdown formatted articles into a format suitable for WeChat Public Accounts, complete with automatic image uploads and theme management. By leveraging WenYan’s theme system, it allows you to select from a variety of stylish themes to enhance the appearance of your articles, making them stand out on the platform.
Why Choose WenYan MCP Server?
There are several reasons why WenYan MCP Server stands out among other public account auxiliary tools:
-
Smart Theme Management: With a rich library of built-in themes, it caters to different article types and styles, ensuring your content looks professional and appealing. -
Automatic Image Upload: It supports both local and online images, eliminating the need for manual image handling and saving you valuable time. -
Markdown Support: For those familiar with Markdown, it allows you to continue using this format, ensuring compatibility with WeChat Public Accounts. -
Seamless Integration: It integrates effortlessly with MCP Client, creating a smooth workflow from writing to publishing.
How to Install and Configure WenYan MCP Server
Method 1: Local Installation (Suitable for Technical Users)
If you are comfortable with programming and command-line operations, local installation is a great option. Follow these steps:
-
Environment Preparation: Ensure Node.js is installed on your computer. You can download the latest version from the Node.js official website. -
Clone the Project: Open your terminal or command-line tool and run the following commands to clone the WenYan MCP Server code repository:
git clone https://github.com/caol64/wenyan-mcp.git
cd wenyan-mcp
3. **Install Dependencies and Compile**: In the project directory, run the following commands to install dependencies and compile the project:
```bash
npm install
npx tsc -b && npm run copy-assets
-
Configure MCP Client: Add the following content to your MCP configuration file to enable MCP Client to recognize and invoke WenYan MCP Server:
{
“mcpServers”: {
“wenyan-mcp”: {
“name”: “Public Account Assistant”,
“command”: “node”,
“args”: [
“Your/path/to/wenyan-mcp/dist/index.js”
],
“env”: {
“WECHAT_APP_ID”: “your_app_id”,
“WECHAT_APP_SECRET”: “your_app_secret”
}
}
}
}
Note that `WECHAT_APP_ID` and `WECHAT_APP_SECRET` are the developer credentials obtained from the WeChat Public Platform.
### Method 2: Using Docker (Recommended for Server Deployment)
For most users, especially those deploying on a server or integrating with a local AI toolchain, using Docker is a simpler and more stable choice.
1. **Build the Image**: In the WenYan MCP Server project directory, run the following command to build the Docker image:
```bash
docker build -t wenyan-mcp .
-
Configure MCP Client: Add the following content to your MCP configuration file:
{
“mcpServers”: {
“wenyan-mcp”: {
“name”: “Public Account Assistant”,
“command”: “docker”,
“args”: [
“run”,
“–rm”,
“-i”,
“-v”, “/your/host/image/path:/mnt/host-downloads”,
“-e”, “WECHAT_APP_ID=your_app_id”,
“-e”, “WECHAT_APP_SECRET=your_app_secret”,
“-e”, “HOST_IMAGE_PATH=/your/host/image/path”,
“wenyan-mcp”
]
}
}
}
Here are some key points to note:
* The `-v` parameter is used to mount the host directory. Replace `/your/host/image/path` with the actual path to your local image storage directory so that the Docker container can access and upload these images.
* The `-e` parameter sets environment variables, where `WECHAT_APP_ID` and `WECHAT_APP_SECRET` are the developer credentials from the WeChat Public Platform.
* The `HOST_IMAGE_PATH` environment variable must match the directory mounted with `-v` to ensure correct image path configuration.
## WeChat Public Platform IP Whitelist Configuration
Before using WenYan MCP Server, it is essential to add the public IP address of the server running WenYan MCP Server to the IP whitelist on the WeChat Public Platform. This step ensures smooth communication between WenYan MCP Server and the WeChat Public Platform interfaces, allowing successful article and image uploads.
Follow these steps for configuration:
1. Log in to the WeChat Public Platform backend. Navigate to "Development Management" -> "Server Configuration" to locate the IP whitelist settings.
2. Add the server's public IP address to the whitelist.
3. Save the settings and await WeChat's review (which typically takes a few minutes to several hours).
If you are unsure how to obtain the server's public IP address, run the following command in the server terminal:
```bash
curl http://ip-api.com/json
This command will return the server’s IP address and related information, from which you can extract and use the public IP address.
Article Configuration: Using Frontmatter
To ensure articles are correctly uploaded to the WeChat Public Platform draft box, you need to add a segment called Frontmatter at the beginning of each Markdown article. This acts like an “ID card” for the article, providing essential information and formatting requirements.
A typical Frontmatter example is as follows:
---
title: Running a Local Large Language Model (2) - Providing an External Knowledge Base for the Model
cover: /Users/lei/Downloads/result_image.jpg
---
There are two key fields here:
-
title
: The article title, which is mandatory. This is the title that will be displayed on the WeChat Public Platform. -
cover
: The path to the article’s cover image. It can be a local path, such as the example/Users/lei/Downloads/result_image.jpg
, or a URL to an online image.
If your article contains at least one image in the main text, you can omit the cover
field, and the system will automatically select one as the cover. However, if your article has no images, the cover
field is required; otherwise, article upload may fail.
Automatic Image Upload Feature
The automatic image upload feature of WenYan MCP Server is one of its standout advantages, greatly simplifying image management in articles.
Supported Image Path Types
-
Local Paths: You can use local file system paths similar to /Users/lei/Downloads/result_image.jpg
. As long as these images are stored in the directory specified in the Docker configuration, WenYan MCP Server will be able to locate and upload them. -
Online Paths: For online images, you can directly use their URLs, such as https://example.com/image.jpg
. WenYan MCP Server will download these images to the local environment before uploading them to the WeChat Public Platform.
How It Works
When publishing an article via WenYan MCP Server, it automatically scans the image paths referenced in the article. For local images, it reads the content from the specified directory and uploads it; for online images, it downloads them first and then uploads. The entire process is fully automated, requiring no manual intervention.
Example Article: A Hands-On Guide to Using WenYan MCP Server
Here is a complete example article to help you better understand how to use WenYan MCP Server:
---
title: Running a Local Large Language Model (2) - Providing an External Knowledge Base for the Model
description: Make your local large language models (LLMs) smarter! This guide shows how to use LangChain and RAG to enable them to retrieve data from external knowledge bases, improving answer accuracy.
cover: /Users/lei/Downloads/result_image.jpg
---
In [the previous article](https://babyno.top/posts/2024/02/running-a-local-large-language-model/), we demonstrated how to run large language models locally. This article will introduce how to allow models to retrieve customized data from external knowledge bases, enhancing answer accuracy and making them appear more "intelligent."
## Preparing the Model
Visit the `Ollama` model page, search for `qwen`, and we will use the " [Qwen:7b](https://ollama.com/library/qwen:7b) " model, which supports Chinese semantics, for experimentation.

In this example, you can see:
-
The use of Frontmatter to define the article’s title, description, and cover image. -
The main text includes content, hyperlinks, and an online image. -
WenYan MCP Server automatically processes this content and converts it into a format suitable for WeChat Public Accounts.
Frequently Asked Questions (FAQ)
Here are some common questions and answers to help you troubleshoot issues when using WenYan MCP Server:
Q1: My server IP is on the whitelist, but I still cannot upload articles. What should I do?
A1: First, check your network connection to ensure the server can access the WeChat Public Platform interfaces. Then, review the WenYan MCP Server log output for specific error messages. Common issues may include:
-
Network firewalls blocking communication with WeChat servers. -
Incorrect configuration of WeChat Public Platform App ID or App Secret. -
Significant discrepancies between server time and actual time, affecting interface call signature verification.
Q2: How can I update the built-in themes of WenYan MCP Server?
A2: Updates to WenYan MCP Server’s built-in themes typically require waiting for new releases from the project team. You can monitor the project’s GitHub repository (WenYan MCP Server GitHub) for updates. After a new version is released, reinstall dependencies or pull the new Docker image following the installation steps to apply the updated themes.
Q3: Is custom theme support available?
A3: Currently, WenYan MCP Server primarily supports built-in themes. If you have custom theme requirements, you can submit a Feature Request on the GitHub repository, detailing your theme needs. The project developers will consider adding this feature based on community feedback.
Q4: How to resolve Node.js version compatibility issues during local installation?
A4: If you encounter Node.js version compatibility issues during local installation, try the following steps:
-
Check the official documentation of WenYan MCP Server to confirm the recommended Node.js version. -
Use a Node.js version management tool (such as nvm) to switch to the appropriate Node.js version. -
Reinstall project dependencies and recompile.
Q5: After publishing an article, I cannot see the desired effect on the public platform. What should I do?
A5: First, confirm whether the article has been successfully uploaded to the draft box. If uploaded but the formatting is not as expected, possible reasons include:
-
Incorrect configuration information in Frontmatter. -
Incompatibility between the selected theme and article content. -
Image path errors or failed image uploads.
You can troubleshoot with the following steps:
-
Review the Frontmatter configuration of the article to ensure the title and cover are correctly filled out. -
Verify that all images are properly displayed on the public platform backend. -
Try publishing the article with a different theme to see if the issue improves.
Additional Reading and Resources
For further exploration of WenYan MCP Server’s features or related technical backgrounds, the following resources may be helpful:
-
WenYan MCP Server Official GitHub Repository: The official code repository of the project. You can access the latest versions, submit issues, or contribute code here. -
WenYan Theme System Documentation: Detailed introduction to the themes supported by WenYan, helping you choose the style that best suits your articles. -
WeChat Public Platform Development Documentation: Official WeChat development guidelines, including detailed information on interface calls and IP whitelist settings.
Conclusion
WenYan MCP Server is a powerful tool for WeChat Public Account creators, offering efficient content management and publishing capabilities. With its automatic image upload, intelligent theme formatting, and seamless integration with MCP Client, it significantly enhances your productivity, allowing you to focus more on content creation.
Whether you are writing technical blogs, lifestyle essays, or academic analyses, WenYan MCP Server ensures your articles are presented professionally and attractively on WeChat Public Accounts. I hope this guide helps you quickly get started with this excellent tool and embark on a more efficient content creation journey.
If you encounter any issues or have suggestions during usage, feel free to submit them via the GitHub repository of WenYan MCP Server. Exchange ideas with developers and other users to make your content creation path smoother and more enjoyable.
WenYan MCP Server is a server component based on the Model Context Protocol (MCP). Its core functionality is to convert Markdown formatted articles into a format suitable for WeChat Public Accounts, leveraging the same theme system as WenYan for styling.
Use cases:
Supported theme effects preview:
Features
-
List and select supported article themes -
Format Markdown content using built-in themes -
Publish articles to the WeChat Public Account draft box -
Automatically upload local or online images
How to Use It
Method 1: Local Operation
Compilation
Ensure you have the Node.js environment installed:
git clone https://github.com/caol64/wenyan-mcp.git
cd wenyan-mcp
npm install
npx tsc -b && npm run copy-assets
Integration with MCP Client
Add the following content to your MCP configuration file:
{
"mcpServers": {
"wenyan-mcp": {
"name": "Public Account Assistant",
"command": "node",
"args": [
"Your/path/to/wenyan-mcp/dist/index.js"
],
"env": {
"WECHAT_APP_ID": "your_app_id",
"WECHAT_APP_SECRET": "your_app_secret"
}
}
}
}
Notes:
WECHAT_APP_ID
refers to the App ID on the WeChat Public PlatformWECHAT_APP_SECRET
refers to the App Secret on the WeChat Public Platform
Method 2: Using Docker (Recommended)
Suitable for server deployment or integration with local AI toolchains.
Building the Image
docker build -t wenyan-mcp .
Integration with MCP Client
Add the following content to your MCP configuration file:
{
"mcpServers": {
"wenyan-mcp": {
"name": "Public Account Assistant",
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v", "/your/host/image/path:/mnt/host-downloads",
"-e", "WECHAT_APP_ID=your_app_id",
"-e", "WECHAT_APP_SECRET=your_app_secret",
"-e", "HOST_IMAGE_PATH=/your/host/image/path",
"wenyan-mcp"
]
}
}
}
Notes:
The -v
parameter mounts the host directory, enabling the container to access local images. Ensure the local images are stored in this directory, as the container cannot access images outside of it.The -e
parameter injects environment variables into the Docker container:WECHAT_APP_ID
refers to the App ID on the WeChat Public PlatformWECHAT_APP_SECRET
refers to the App Secret on the WeChat Public PlatformHOST_IMAGE_PATH
refers to the host image directory
WeChat Public Platform IP Whitelist
Please ensure that the server IP is added to the WeChat Public Platform’s IP whitelist to guarantee successful interface calls for uploads. For detailed configuration instructions, refer to: https://yuzhi.tech/docs/wenyan/upload
Configuration Instructions (Frontmatter)
To enable successful article uploads, add a segment called frontmatter
at the beginning of each Markdown article, providing the title
and cover
fields:
---
title: Running a Local Large Language Model (2) - Providing an External Knowledge Base for the Model
cover: /Users/lei/Downloads/result_image.jpg
---
-
title
is the article title and is required. -
cover
is the article cover image, supporting both local paths and online images:-
If the main text contains at least one image, cover
can be omitted, and one of the images will be used as the cover; -
If the main text contains no images, cover
is mandatory.
-
About Automatic Image Uploads
-
Supported image paths:
-
Local paths (e.g.,
/Users/lei/Downloads/result_image.jpg
) -
Online paths (e.g.,
https://example.com/image.jpg
)
Example Article Format
---
title: Running a Local Large Language Model (2) - Providing an External Knowledge Base for the Model
description: Make your local large language models (LLMs) smarter! This guide shows how to use LangChain and RAG to enable them to retrieve data from external knowledge bases, improving answer accuracy.
cover: /Users/lei/Downloads/result_image.jpg
---
In [the previous article](https://babyno.top/posts/2024/02/running-a-local-large-language-model/), we demonstrated how to run large language models locally. This article will introduce how to allow models to retrieve customized data from external knowledge bases, enhancing answer accuracy and making them appear more "intelligent."
## Preparing the Model
Visit the `Ollama` model page, search for `qwen`, and we will use the " [Qwen:7b](https://ollama.com/library/qwen:7b) " model, which supports Chinese semantics, for experimentation.
