@wenyan-md/mcp 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -21
- package/dist/index.js +1 -1
- package/dist/types/index.d.ts +10 -0
- package/package.json +26 -10
- package/dist/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
「文颜」是一款多平台排版美化工具,让你将 Markdown 一键发布至微信公众号、知乎、今日头条等主流写作平台。
|
|
6
|
+
|
|
7
|
+
**文颜**现已推出多个版本:
|
|
8
|
+
|
|
9
|
+
* [macOS App Store 版](https://github.com/caol64/wenyan) - MAC 桌面应用
|
|
10
|
+
* [Windows + Linux 版](https://github.com/caol64/wenyan-pc) - 跨平台桌面应用
|
|
11
|
+
* [CLI 版本](https://github.com/caol64/wenyan-cli) - CI/CD 或脚本自动化发布公众号文章
|
|
12
|
+
* [MCP 版本](https://github.com/caol64/wenyan-mcp) - 让 AI 自动发布公众号文章
|
|
6
13
|
|
|
7
14
|
文颜 MCP Server 是一个基于模型上下文协议(Model Context Protocol, MCP)的服务器组件,支持将 Markdown 格式的文章发布至微信公众号草稿箱,并使用与 [文颜](https://yuzhi.tech/wenyan) 相同的主题系统进行排版。
|
|
8
15
|
|
|
@@ -12,18 +19,26 @@ https://github.com/user-attachments/assets/2c355f76-f313-48a7-9c31-f0f69e5ec207
|
|
|
12
19
|
|
|
13
20
|
- [让AI帮你管理公众号的排版和发布](https://babyno.top/posts/2025/06/let-ai-help-you-manage-your-gzh-layout-and-publishing/)
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- [内置主题](https://yuzhi.tech/docs/wenyan/theme)
|
|
18
|
-
|
|
19
|
-
## Features
|
|
22
|
+
## 功能
|
|
20
23
|
|
|
21
24
|
- 列出并选择支持的文章主题
|
|
22
25
|
- 使用内置主题对 Markdown 内容排版
|
|
23
26
|
- 发布文章到微信公众号草稿箱
|
|
24
27
|
- 自动上传本地或网络图片
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
## 主题效果
|
|
30
|
+
|
|
31
|
+
👉 [内置主题预览](https://yuzhi.tech/docs/wenyan/theme)
|
|
32
|
+
|
|
33
|
+
文颜采用了多个开源的 Typora 主题,在此向各位作者表示感谢:
|
|
34
|
+
|
|
35
|
+
- [Orange Heart](https://github.com/evgo2017/typora-theme-orange-heart)
|
|
36
|
+
- [Rainbow](https://github.com/thezbm/typora-theme-rainbow)
|
|
37
|
+
- [Lapis](https://github.com/YiNNx/typora-theme-lapis)
|
|
38
|
+
- [Pie](https://github.com/kevinzhao2233/typora-theme-pie)
|
|
39
|
+
- [Maize](https://github.com/BEATREE/typora-maize-theme)
|
|
40
|
+
- [Purple](https://github.com/hliu202/typora-purple-theme)
|
|
41
|
+
- [物理猫-薄荷](https://github.com/sumruler/typora-theme-phycat)
|
|
27
42
|
|
|
28
43
|
## 使用方式
|
|
29
44
|
|
|
@@ -151,15 +166,11 @@ docker build --build-arg NPM_REGISTRY=https://mirrors.cloud.tencent.com/npm/ -t
|
|
|
151
166
|
> * `WECHAT_APP_SECRET` 微信平台的 App Secret
|
|
152
167
|
> * `HOST_IMAGE_PATH` 宿主机图片目录
|
|
153
168
|
|
|
154
|
-
---
|
|
155
|
-
|
|
156
169
|
## 微信公众号 IP 白名单
|
|
157
170
|
|
|
158
171
|
请务必将服务器 IP 加入公众号平台的 IP 白名单,以确保上传接口调用成功。
|
|
159
172
|
详细配置说明请参考:[https://yuzhi.tech/docs/wenyan/upload](https://yuzhi.tech/docs/wenyan/upload)
|
|
160
173
|
|
|
161
|
-
---
|
|
162
|
-
|
|
163
174
|
## 配置说明(Frontmatter)
|
|
164
175
|
|
|
165
176
|
为了可以正确上传文章,需要在每一篇 Markdown 文章的开头添加一段`frontmatter`,提供`title`、`cover`两个字段:
|
|
@@ -177,8 +188,6 @@ cover: /Users/lei/Downloads/result_image.jpg
|
|
|
177
188
|
* 如果正文有至少一张图片,可省略,此时将使用其中一张作为封面;
|
|
178
189
|
* 如果正文无图片,则必须提供 cover。
|
|
179
190
|
|
|
180
|
-
---
|
|
181
|
-
|
|
182
191
|
## 关于图片自动上传
|
|
183
192
|
|
|
184
193
|
* 支持图片路径:
|
|
@@ -186,8 +195,6 @@ cover: /Users/lei/Downloads/result_image.jpg
|
|
|
186
195
|
* 本地路径(如:`/Users/lei/Downloads/result_image.jpg`)
|
|
187
196
|
* 网络路径(如:`https://example.com/image.jpg`)
|
|
188
197
|
|
|
189
|
-
---
|
|
190
|
-
|
|
191
198
|
## 示例文章格式
|
|
192
199
|
|
|
193
200
|
```md
|
|
@@ -205,8 +212,6 @@ cover: /Users/lei/Downloads/result_image.jpg
|
|
|
205
212
|

|
|
206
213
|
```
|
|
207
214
|
|
|
208
|
-
---
|
|
209
|
-
|
|
210
215
|
## 如何调试
|
|
211
216
|
|
|
212
217
|
使用 Inspector 进行简单调试:
|
|
@@ -235,14 +240,10 @@ npx @modelcontextprotocol/inspector
|
|
|
235
240
|
6. 填入参数并点击 Run Tool
|
|
236
241
|
7. 查看完整参数
|
|
237
242
|
|
|
238
|
-
---
|
|
239
|
-
|
|
240
243
|
## 赞助
|
|
241
244
|
|
|
242
245
|
如果您觉得这个项目不错,可以给我家猫咪买点罐头吃。[喂猫❤️](https://yuzhi.tech/sponsor)
|
|
243
246
|
|
|
244
|
-
---
|
|
245
|
-
|
|
246
247
|
## License
|
|
247
248
|
|
|
248
249
|
Apache License Version 2.0
|
package/dist/index.js
CHANGED
|
@@ -76,7 +76,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
76
76
|
// });
|
|
77
77
|
const content = String(request.params.arguments?.content || "");
|
|
78
78
|
const themeId = String(request.params.arguments?.theme_id || "");
|
|
79
|
-
const gzhContent = await getGzhContent(content, themeId, "solarized-light", true);
|
|
79
|
+
const gzhContent = await getGzhContent(content, themeId, "solarized-light", true, true);
|
|
80
80
|
const title = gzhContent.title ?? "this is title";
|
|
81
81
|
const cover = gzhContent.cover ?? "";
|
|
82
82
|
const response = await publishToDraft(title, gzhContent.content, cover);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* This is a template MCP server that implements a simple notes system.
|
|
4
|
+
* It demonstrates core MCP concepts like resources and tools by allowing:
|
|
5
|
+
* - Listing notes as resources
|
|
6
|
+
* - Reading individual notes
|
|
7
|
+
* - Creating new notes via a tool
|
|
8
|
+
* - Summarizing all notes via a prompt
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenyan-md/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "MCP server for Wenyan, a Markdown formatting tool that allows AI assistants to apply elegant built-in themes and publish articles directly to 微信公众号.",
|
|
5
5
|
"author": "Lei <caol64@gmail.com> (https://github.com/caol64)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"keywords": [
|
|
7
|
+
"keywords": [
|
|
8
|
+
"公众号",
|
|
9
|
+
"markdown",
|
|
10
|
+
"文颜",
|
|
11
|
+
"wenyan",
|
|
12
|
+
"wechat",
|
|
13
|
+
"publishing",
|
|
14
|
+
"renderer",
|
|
15
|
+
"mcp"
|
|
16
|
+
],
|
|
8
17
|
"type": "module",
|
|
9
18
|
"bin": {
|
|
10
19
|
"wenyan-mcp": "./dist/index.js"
|
|
@@ -12,20 +21,27 @@
|
|
|
12
21
|
"files": [
|
|
13
22
|
"dist"
|
|
14
23
|
],
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
"homepage": "https://github.com/caol64/wenyan-mcp#readme",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/caol64/wenyan-mcp.git"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/caol64/wenyan-mcp/issues"
|
|
21
31
|
},
|
|
22
32
|
"dependencies": {
|
|
23
33
|
"@modelcontextprotocol/sdk": "0.6.0",
|
|
24
|
-
"@wenyan-md/core": "^1.0.
|
|
34
|
+
"@wenyan-md/core": "^1.0.11"
|
|
25
35
|
},
|
|
26
36
|
"devDependencies": {
|
|
27
37
|
"@types/node": "^20.11.24",
|
|
28
38
|
"typescript": "^5.3.3",
|
|
29
39
|
"vitest": "^3.2.3"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc",
|
|
43
|
+
"watch": "tsc --watch",
|
|
44
|
+
"inspector": "pnpm build && node ./run-inspector.js",
|
|
45
|
+
"test": "pnpx vitest run"
|
|
30
46
|
}
|
|
31
|
-
}
|
|
47
|
+
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG"}
|