@wenyan-md/mcp 1.0.3 → 1.0.6

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 CHANGED
@@ -1,8 +1,21 @@
1
+ ![logo](data/wenyan-mcp.png)
2
+
1
3
  # 文颜 MCP Server
2
4
 
3
- ![logo](data/wenyan-mcp.png)
5
+ [![npm](https://img.shields.io/npm/v/@wenyan-md/mcp)](https://www.npmjs.com/package/@wenyan-md/mcp)
6
+ [![License](https://img.shields.io/github/license/caol64/wenyan-mcp)](LICENSE)
7
+ ![NPM Downloads](https://img.shields.io/npm/dm/%40wenyan-md%2Fmcp)
8
+ [![Stars](https://img.shields.io/github/stars/caol64/wenyan-mcp?style=social)](https://github.com/caol64/wenyan-mcp)
9
+
10
+ 「文颜」是一款多平台排版美化工具,让你将 Markdown 一键发布至微信公众号、知乎、今日头条等主流写作平台。
4
11
 
5
- ## Overview
12
+ **文颜**现已推出多个版本:
13
+
14
+ * [macOS App Store 版](https://github.com/caol64/wenyan) - MAC 桌面应用
15
+ * [跨平台版本](https://github.com/caol64/wenyan-pc) - Windows/Linux 跨平台桌面应用
16
+ * [CLI 版本](https://github.com/caol64/wenyan-cli) - CI/CD 或脚本自动化发布公众号文章
17
+ * [MCP 版本](https://github.com/caol64/wenyan-mcp) - 让 AI 自动发布公众号文章
18
+ * [嵌入版本](https://github.com/caol64/wenyan-core) - 将文颜的核心功能嵌入 Node 或者 Web 项目
6
19
 
7
20
  文颜 MCP Server 是一个基于模型上下文协议(Model Context Protocol, MCP)的服务器组件,支持将 Markdown 格式的文章发布至微信公众号草稿箱,并使用与 [文颜](https://yuzhi.tech/wenyan) 相同的主题系统进行排版。
8
21
 
@@ -12,18 +25,26 @@ https://github.com/user-attachments/assets/2c355f76-f313-48a7-9c31-f0f69e5ec207
12
25
 
13
26
  - [让AI帮你管理公众号的排版和发布](https://babyno.top/posts/2025/06/let-ai-help-you-manage-your-gzh-layout-and-publishing/)
14
27
 
15
- 支持的主题效果预览:
16
-
17
- - [内置主题](https://yuzhi.tech/docs/wenyan/theme)
18
-
19
- ## Features
28
+ ## 功能
20
29
 
21
30
  - 列出并选择支持的文章主题
22
31
  - 使用内置主题对 Markdown 内容排版
23
32
  - 发布文章到微信公众号草稿箱
24
33
  - 自动上传本地或网络图片
25
34
 
26
- ---
35
+ ## 主题效果
36
+
37
+ 👉 [内置主题预览](https://yuzhi.tech/docs/wenyan/theme)
38
+
39
+ 文颜采用了多个开源的 Typora 主题,在此向各位作者表示感谢:
40
+
41
+ - [Orange Heart](https://github.com/evgo2017/typora-theme-orange-heart)
42
+ - [Rainbow](https://github.com/thezbm/typora-theme-rainbow)
43
+ - [Lapis](https://github.com/YiNNx/typora-theme-lapis)
44
+ - [Pie](https://github.com/kevinzhao2233/typora-theme-pie)
45
+ - [Maize](https://github.com/BEATREE/typora-maize-theme)
46
+ - [Purple](https://github.com/hliu202/typora-purple-theme)
47
+ - [物理猫-薄荷](https://github.com/sumruler/typora-theme-phycat)
27
48
 
28
49
  ## 使用方式
29
50
 
@@ -151,15 +172,11 @@ docker build --build-arg NPM_REGISTRY=https://mirrors.cloud.tencent.com/npm/ -t
151
172
  > * `WECHAT_APP_SECRET` 微信平台的 App Secret
152
173
  > * `HOST_IMAGE_PATH` 宿主机图片目录
153
174
 
154
- ---
155
-
156
175
  ## 微信公众号 IP 白名单
157
176
 
158
177
  请务必将服务器 IP 加入公众号平台的 IP 白名单,以确保上传接口调用成功。
159
178
  详细配置说明请参考:[https://yuzhi.tech/docs/wenyan/upload](https://yuzhi.tech/docs/wenyan/upload)
160
179
 
161
- ---
162
-
163
180
  ## 配置说明(Frontmatter)
164
181
 
165
182
  为了可以正确上传文章,需要在每一篇 Markdown 文章的开头添加一段`frontmatter`,提供`title`、`cover`两个字段:
@@ -177,8 +194,6 @@ cover: /Users/lei/Downloads/result_image.jpg
177
194
  * 如果正文有至少一张图片,可省略,此时将使用其中一张作为封面;
178
195
  * 如果正文无图片,则必须提供 cover。
179
196
 
180
- ---
181
-
182
197
  ## 关于图片自动上传
183
198
 
184
199
  * 支持图片路径:
@@ -186,8 +201,6 @@ cover: /Users/lei/Downloads/result_image.jpg
186
201
  * 本地路径(如:`/Users/lei/Downloads/result_image.jpg`)
187
202
  * 网络路径(如:`https://example.com/image.jpg`)
188
203
 
189
- ---
190
-
191
204
  ## 示例文章格式
192
205
 
193
206
  ```md
@@ -205,8 +218,6 @@ cover: /Users/lei/Downloads/result_image.jpg
205
218
  ![](https://mmbiz.qpic.cn/mmbiz_jpg/Jsq9IicjScDVUjkPc6O22ZMvmaZUzof5bLDjMyLg2HeAXd0icTvlqtL7oiarSlOicTtiaiacIxpVOV1EeMKl96PhRPPw/640?wx_fmt=jpeg)
206
219
  ```
207
220
 
208
- ---
209
-
210
221
  ## 如何调试
211
222
 
212
223
  使用 Inspector 进行简单调试:
@@ -235,14 +246,10 @@ npx @modelcontextprotocol/inspector
235
246
  6. 填入参数并点击 Run Tool
236
247
  7. 查看完整参数
237
248
 
238
- ---
239
-
240
249
  ## 赞助
241
250
 
242
251
  如果您觉得这个项目不错,可以给我家猫咪买点罐头吃。[喂猫❤️](https://yuzhi.tech/sponsor)
243
252
 
244
- ---
245
-
246
253
  ## License
247
254
 
248
255
  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",
3
+ "version": "1.0.6",
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": ["公众号", "markdown", "文颜", "wenyan", "wechat", "publishing", "renderer", "mcp"],
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,28 @@
12
21
  "files": [
13
22
  "dist"
14
23
  ],
15
- "scripts": {
16
- "build": "tsc",
17
- "watch": "tsc --watch",
18
- "inspector": "pnpx @modelcontextprotocol/inspector",
19
- "test": "pnpx vitest run",
20
- "prepublishOnly": "pnpm build"
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.3"
34
+ "@wenyan-md/core": "^1.0.12"
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",
46
+ "upgrade:core": "pnpm update @wenyan-md/core"
30
47
  }
31
- }
48
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG"}