Content

# Wenyan MCP Server
[](https://www.npmjs.com/package/@wenyan-md/mcp)
[](LICENSE)

[](https://hub.docker.com/r/caol64/wenyan-mcp)
[](https://github.com/caol64/wenyan-mcp)
"Wenyan" is a multi-platform typesetting and beautification tool that allows you to publish Markdown content to mainstream writing platforms such as WeChat Official Accounts, Zhihu, and Toutiao with one click.
**Wenyan** has released several versions:
* [macOS App Store version](https://github.com/caol64/wenyan) - MAC desktop application
* [Cross-platform version](https://github.com/caol64/wenyan-pc) - Windows/Linux cross-platform desktop application
* [CLI version](https://github.com/caol64/wenyan-cli) - CI/CD or script automation for publishing WeChat Official Account articles
* [MCP version](https://github.com/caol64/wenyan-mcp) - Allows AI to automatically publish WeChat Official Account articles
* [Embedded version](https://github.com/caol64/wenyan-core) - Embeds Wenyan's core functionality into Node or Web projects
Wenyan MCP Server is a server component based on the Model Context Protocol (MCP), supporting the publication of Markdown formatted articles to the WeChat Official Account draft box, and using the same theming system as [Wenyan](https://yuzhi.tech/wenyan) for typesetting.
https://github.com/user-attachments/assets/2c355f76-f313-48a7-9c31-f0f69e5ec207
Usage scenarios:
- [Let AI help you manage your WeChat Official Account's layout and publishing](https://babyno.top/posts/2025/06/let-ai-help-you-manage-your-gzh-layout-and-publishing/)
## Features
- List and select supported article topics
- Format Markdown content using built-in themes
- Publish articles to WeChat Official Account (微信公众号) draft box
- Automatically upload local or online images
## Theme Effects
👉 [Built-in Theme Preview](https://yuzhi.tech/docs/wenyan/theme)
Wenyan adopts multiple open-source Typora themes, and we would like to express our gratitude to the authors:
- [Orange Heart](https://github.com/evgo2017/typora-theme-orange-heart)
- [Rainbow](https://github.com/thezbm/typora-theme-rainbow)
- [Lapis](https://github.com/YiNNx/typora-theme-lapis)
- [Pie](https://github.com/kevinzhao2233/typora-theme-pie)
- [Maize](https://github.com/BEATREE/typora-maize-theme)
- [Purple](https://github.com/hliu202/typora-purple-theme)
- [Physical Cat - Mint](https://github.com/sumruler/typora-theme-phycat)
## Usage
### Method 1: Local Installation (Recommended)
```
npm install -g @wenyan-md/mcp
```
#### Integration with MCP Client
Add the following content to your MCP configuration file:
```json
{
"mcpServers": {
"wenyan-mcp": {
"name": "Public Account Assistant",
"command": "wenyan-mcp",
"env": {
"WECHAT_APP_ID": "your_app_id",
"WECHAT_APP_SECRET": "your_app_secret"
}
}
}
}
```
> Note:
>
> * `WECHAT_APP_ID` is the App ID of the WeChat Official Account platform
> * `WECHAT_APP_SECRET` is the App Secret of the WeChat platform
### Method 2: Compile and Run
#### Compilation
Make sure that the [Node.js](https://nodejs.org/) environment is installed:
```bash
git clone https://github.com/caol64/wenyan-mcp.git
cd wenyan-mcp
npm install
npx tsc -b
```
#### Integration with MCP Client
Add the following content to your MCP configuration file:
```json
{
"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:
>
> * `WECHAT_APP_ID` is the App ID of the WeChat Official Account platform
> * `WECHAT_APP_SECRET` is the App Secret of the WeChat platform
---
### Method 3: Running with Docker (Recommended)
Suitable for deployment in server environments or integration with local AI toolchains.
#### You can directly download the compiled Docker image
```bash
docker pull caol64/wenyan-mcp
```
#### Or Build the Image Yourself
```bash
docker build -t wenyan-mcp .
```
# Domestic users can specify the `npm` mirror source.
```bash
docker build --build-arg NPM_REGISTRY=https://mirrors.cloud.tencent.com/npm/ -t wenyan-mcp .
```
#### Integration with MCP Client
Add the following content to your MCP configuration file:
```json
{
"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"
]
}
}
}
```
> Note:
>
> * `-v` mounts the host directory, allowing the container to access local images. This should be consistent with the environment variable `HOST_IMAGE_PATH`. All local images in your `Markdown` articles should be placed in this directory, and Docker will automatically map them into the container. The container cannot read images outside of this directory.
> * `-e` injects environment variables into the Docker container:
> * `WECHAT_APP_ID` App ID of the WeChat Official Account platform
> * `WECHAT_APP_SECRET` App Secret of the WeChat platform
> * `HOST_IMAGE_PATH` Directory for images on the host
## WeChat Official Account IP Whitelist
Please make sure to add the server IP to the IP whitelist of the official account platform to ensure successful calls to the upload interface. For detailed configuration instructions, please refer to: [https://yuzhi.tech/docs/wenyan/upload](https://yuzhi.tech/docs/wenyan/upload)
## Configuration Instructions (Frontmatter)
To correctly upload an article, you need to add a section of `frontmatter` at the beginning of each Markdown article, providing the `title` and `cover` fields:
```md
---
title: Running a Large Language Model Locally (2) - Providing External Knowledge to the Model
cover: /Users/lei/Downloads/result_image.jpg
---
```
* `title` is the article title and is required.
* `cover` is the article cover, supporting both local paths and online images:
* If there is at least one image in the main content, this can be omitted, and one of the images will be used as the cover;
* If there are no images in the main content, the cover must be provided.
## About Automatic Image Upload
* Supported image paths:
* Local path (e.g.: `/Users/lei/Downloads/result_image.jpg`)
* Network path (e.g.: `https://example.com/image.jpg`)
## Example Article Format
```md
---
title: Running a Large Language Model Locally (2) - Providing External Knowledge Base to the Model
cover: /Users/lei/Downloads/result_image.jpg
---
In the [previous article](https://babyno.top/posts/2024/02/running-a-large-language-model-locally/), we demonstrated how to run a large language model locally. This article will introduce how to enable the model to retrieve customized data from an external knowledge base, improving answer accuracy and making it appear more "intelligent."
```
## Prepare the Model
Visit the `Ollama` model page and search for `qwen`. We will use the “[通义千问](https://ollama.com/library/qwen:7b)” model, which supports Chinese semantics, for our experiments.

## How to Debug
Use the Inspector for simple debugging:
```
npx @modelcontextprotocol/inspector
```
If the startup is successful, you will see a message like this:
```
🔗 Open inspector with token pre-filled:
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=761c05058aa4f84ad02280e62d7a7e52ec0430d00c4c7a61492cca59f9eac299
(Auto-open is disabled when authentication is enabled)
```
Access the above link to open the debugging page.

1. Correctly fill in the startup command
2. Add environment variables
3. Click Connect
4. Select Tools -> List Tools
5. Choose the interface to debug
6. Fill in the parameters and click Run Tool
7. View the complete parameters
## Sponsorship
If you think this project is great, you can buy some canned food for my cat. [Feed the cat ❤️](https://yuzhi.tech/sponsor)
## License
Apache License Version 2.0
Connection Info
You Might Also Like
semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
repomix
📦 Repomix is a powerful tool that packs your entire repository into a...
Serena
A powerful coding agent toolkit providing semantic retrieval and editing...
cui
A web UI for Claude Code agents
cui
CUI is a modern web UI for managing agents, accessible via browser.
MySQL
A Model Context Protocol (MCP) server that enables secure interaction with...