Content
<div align="center">
<img alt = "logo" src="https://media.githubusercontent.com/media/caol64/wenyan-mcp/main/data/wenyan-mcp.png" />
</div>
# 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)
## Introduction
**Wenyan** is a multi-platform Markdown typesetting and publishing tool that supports one-click conversion and publishing of Markdown to:
- WeChat Official Account
- Zhihu
- Toutiao
- And other content platforms (continuously expanding)
Wenyan's goal is to: **Let writers focus on content, not typesetting and platform adaptation**.
## Different Versions of Wenyan
Wenyan currently offers multiple forms to cover different usage scenarios:
- [macOS App Store Version](https://github.com/caol64/wenyan) - MAC Desktop Application
- [Cross-Platform Desktop Version](https://github.com/caol64/wenyan-pc) - Windows/Linux
- [CLI Version](https://github.com/caol64/wenyan-cli) - Command Line / CI Automated Publishing
- 👉 [MCP Version](https://github.com/caol64/wenyan-mcp) - This project
- [Core Library](https://github.com/caol64/wenyan-core) - Embed in Node / Web Projects
This repository is the **MCP Server version of Wenyan**, based on the Model Context Protocol, designed to enable AI assistants (such as Claude Desktop) to automatically typeset and publish official account articles.
- **Deep Integration with AI**: [Let AI help you manage the typesetting and publishing of your official account](https://babyno.top/posts/2025/06/let-ai-help-you-manage-your-gzh-layout-and-publishing/)
<video src="https://github.com/user-attachments/assets/2c355f76-f313-48a7-9c31-f0f69e5ec207"></video>
> [!TIP]
>
> If you encounter problems with AI integration, you can refer to the complete call examples in [test/list.js](./test/list.js) and [test/publish.js](./test/publish.js).
## Installation and Integration
Wenyan MCP Server supports multiple running methods, please choose according to your environment.
### Method 1: npm Installation (Recommended)
Install directly to your local machine:
```bash
npm install -g @wenyan-md/mcp
```
**Configure MCP Client (e.g., Claude Desktop):**
Add the following to your MCP configuration file:
```json
{
"mcpServers": {
"wenyan-mcp": {
"name": "Official Account Assistant",
"command": "wenyan-mcp",
"env": {
"WECHAT_APP_ID": "your_app_id",
"WECHAT_APP_SECRET": "your_app_secret"
}
}
}
}
```
### Method 2: Docker Run (Recommended)
Suitable for deploying to a server environment or users who want environment isolation.
**Pull the image:**
```bash
docker pull caol64/wenyan-mcp
```
**Configure MCP Client:**
```json
{
"mcpServers": {
"wenyan-mcp": {
"name": "Official Account Assistant",
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v", "/your/host/file/path:/mnt/host-downloads",
"-e", "WECHAT_APP_ID=your_app_id",
"-e", "WECHAT_APP_SECRET=your_app_secret",
"-e", "HOST_FILE_PATH=/your/host/file/path",
"caol64/wenyan-mcp"
]
}
}
}
```
> **Special Instructions for Docker Configuration:**
>
> * **Mount Directory (`-v`)**: You must mount the host's file/image directory to `/mnt/host-downloads` inside the container.
> * **Environment Variable (`HOST_FILE_PATH`)**: Must be consistent with the file/image directory path mounted on the host machine.
> * **Principle**: The local images referenced in your Markdown files/articles should be placed in this directory, and Docker will automatically map them so that the container can read and upload them.
## Basic Usage
### List Themes
Say to AI
> What official account themes are currently available for you to use?
AI replies:
```
Currently, I support the following official account themes. Each theme has a unique style and color scheme, suitable for different content tones:
1. **Default**
Simple and classic typesetting, suitable for long reads, with strong versatility.
2. **OrangeHeart**
Warm orange tones, elegant and vibrant, suitable for emotional and lifestyle content.
...
```
### Register Theme
Say to AI
> Help me register this css(https://wenyan.yuzhi.tech/manhua.css) as a new official account theme, named: xiuluochang
AI replies:
```
Okay, the CSS stylesheet has been successfully registered as a new official account theme, with the theme name: **xiuluochang**.
You can now select this theme in the official account backend for application, and the style will be rendered according to the definition of `https://wenyan.yuzhi.tech/manhua.css`.
If you need to further customize or change the theme, feel free to let me know!
```
### Delete Theme
Say to AI
> Delete the official account theme named "xiuluochang"
AI replies:
```
The official account theme "xiuluochang" has been successfully deleted.
```
### Publish Article
Say to AI
> Publish this article to the WeChat official account using the phycat theme: `./tests/publish.md`
AI replies:
```
The article has been successfully published to the WeChat official account draft box! 🎉
- **Theme**: phycat
- **Media ID**: xxx
You can log in to the WeChat official account backend, view and edit the article in the "Drafts" section, and publish it with one click after confirming that it is correct. If you need further typesetting optimization, add a cover or set a summary, I can also assist you!
Do you need me to help you generate a release copy or cover suggestion? 😊
```
## About Automatic Image Upload
Supports the following image sources:
- Local path (e.g., `/Users/lei/Downloads/result_image.jpg`)
- Network path (e.g., `https://example.com/image.jpg`)
## Environment Variable Description
Regardless of which method you use, you need to configure the following environment variables to connect to the WeChat official account platform:
- `WECHAT_APP_ID`: App ID of the WeChat official account platform
- `WECHAT_APP_SECRET`: App Secret of the WeChat official account platform
## Markdown Frontmatter Description (Required)
In order to upload articles correctly, each Markdown file needs to include frontmatter at the top:
```md
---
title: Running a Large Language Model Locally (2) - Providing the Model with External Knowledge Base
cover: /Users/xxx/image.jpg
---
```
Field description:
- `title` Article title (required)
- `cover` Article cover
- Local path or network image
- If there is at least one image in the body, it can be omitted, and one of them will be used as the cover
- If there is no image in the body, the cover must be provided
## WeChat Official Account IP Whitelist
> [!IMPORTANT]
>
> Please ensure that the IP of the machine running Wenyan MCP Server has been added to the IP whitelist of the WeChat official account backend, otherwise the upload interface will fail.
Configuration documentation: [https://yuzhi.tech/docs/wenyan/upload](https://yuzhi.tech/docs/wenyan/upload)
## Example Article Format
```md
---
title: Running a Large Language Model Locally (2) - Providing the Model with External Knowledge Base
cover: /Users/lei/Downloads/result_image.jpg
---
In [the previous article](https://babyno.top/posts/2024/02/running-a-large-language-model-locally/), we showed how to run a large language model locally. This article will introduce how to let the model retrieve customized data from an external knowledge base, improve the accuracy of answering questions, and make it look more "intelligent".
## Prepare the Model
Visit the `Ollama` model page, search for `qwen`, and we will use the "[Tongyi Qianwen](https://ollama.com/library/qwen:7b)" model that supports Chinese semantics for the experiment.

```
## How to Debug
It is recommended to use the official Inspector for debugging:
```bash
npx @modelcontextprotocol/inspector <command>
```
A similar prompt appears after successful startup:
```bash
🔗 Open inspector with token pre-filled:
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=761c05058aa4f84ad02280e62d7a7e52ec0430d00c4c7a61492cca59f9eac299
(Auto-open is disabled when authentication is enabled)
```
Visit the above link to open the debugging page.

1. Fill in the startup command correctly
2. Add environment variables
3. Click Connect
4. Select Tools -> List Tools
5. Select the interface to debug
6. Fill in the parameters and click Run Tool
7. View complete parameters
## Sponsor
If you think Wenyan is helpful to you, you can buy some canned food for my cat ❤️
[https://yuzhi.tech/sponsor](https://yuzhi.tech/sponsor)
## License
Apache License Version 2.0
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
continue
Continue is an open-source project for seamless server management.
semantic-kernel
Build and deploy intelligent AI agents with Semantic Kernel's orchestration...