mp-publish-mcp 0.1.4

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/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 novlan1
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # 小程序发布工具
2
+
3
+ `mp-publish-mcp` - 小程序发布 MCP 工具
4
+
5
+ ## 功能特性
6
+
7
+ - ✅ **触发发布流水线**: 通过 MCP 工具触发小程序发布流水线
8
+ - ✅ **自动获取 Git 信息**: 自动从当前目录获取仓库地址和分支名称
9
+ - ✅ **发布原因记录**: 支持记录发布原因,方便追溯历史
10
+ - ✅ **参数校验**: 自动校验必填参数,确保发布信息完整
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ npm install mp-publish-mcp
16
+ # or
17
+ pnpm add mp-publish-mcp
18
+ ```
19
+
20
+ ## MCP 工具调用规则
21
+
22
+ ### 小程序发布工具 (`mp-publish`)
23
+
24
+ **🔴【强制调用规则】**:
25
+
26
+ - 当用户需要发布小程序时,AI 助手必须调用此 MCP 工具
27
+ - 会自动从当前 Git 目录获取仓库地址和分支信息
28
+ - 返回流水线触发结果
29
+
30
+ **参数说明:**
31
+
32
+ | 参数 | 类型 | 必填 | 说明 |
33
+ |------|------|------|------|
34
+ | `subProjectName` | string | ✅ | 子工程名,用于多工程仓库场景 |
35
+ | `publishReason` | string | release分支必填 | 发布原因,用于记录本次发布的目的 |
36
+ | `repo` | string | ❌ | Git 仓库地址,不传则自动获取 |
37
+ | `branch` | string | ❌ | Git 分支名称,不传则自动获取 |
38
+ | `cwd` | string | ❌ | 工作目录路径,用于执行 git 命令获取 repo 和 branch |
39
+
40
+ **🔴【校验规则】**:
41
+
42
+ 1. `subProjectName` 为必填参数,必须提供子工程名
43
+ 2. 当 `branch` 为 `release` 时,`publishReason` 为必填参数
44
+
45
+ ## 使用示例
46
+
47
+ ### 基本发布(自动获取 Git 信息)
48
+
49
+ ```json
50
+ {
51
+ "subProjectName": "weapp-main"
52
+ }
53
+ ```
54
+
55
+ ### 带发布原因(非 release 分支)
56
+
57
+ ```json
58
+ {
59
+ "subProjectName": "weapp-main",
60
+ "publishReason": "修复首页加载问题"
61
+ }
62
+ ```
63
+
64
+ ### release 分支发布(必须带发布原因)
65
+
66
+ ```json
67
+ {
68
+ "subProjectName": "weapp-main",
69
+ "publishReason": "v1.2.0 正式版发布",
70
+ "branch": "release"
71
+ }
72
+ ```
73
+
74
+ ### 指定仓库和分支
75
+
76
+ ```json
77
+ {
78
+ "subProjectName": "weapp-main",
79
+ "repo": "git@git.aow.com:example/miniprogram.git",
80
+ "branch": "feature/new-feature"
81
+ }
82
+ ```
83
+
84
+ ### 指定工作目录
85
+
86
+ ```json
87
+ {
88
+ "subProjectName": "weapp-main",
89
+ "cwd": "/path/to/project"
90
+ }
91
+ ```
92
+
93
+ ## 开发
94
+
95
+ ```bash
96
+ # 构建
97
+ pnpm --filter "mp-publish-mcp" build
98
+ ```
99
+
100
+ ## 许可证
101
+
102
+ MIT