mta-mcp 3.0.0 → 3.1.0

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.
@@ -128,5 +128,22 @@ get_standard_by_id({ ids: ['flutter', 'flutter-ui-system'] })
128
128
 
129
129
  ---
130
130
 
131
+ ## 🚀 Skills 工具(扩展能力)
132
+
133
+ MTA 已集成以下 Skills,可直接调用:
134
+
135
+ | 工具 | 用途 | 调用示例 |
136
+ |------|------|----------|
137
+ | `http_request` | 发送 HTTP 请求(API 测试) | `http_request({ url: "https://api.example.com/data", method: "GET" })` |
138
+ | `list_skills` | 查看所有可用 Skills | `list_skills()` |
139
+
140
+ ### 使用场景
141
+
142
+ - 测试后端 API 接口
143
+ - 获取外部数据进行分析
144
+ - 验证 API 响应格式
145
+
146
+ ---
147
+
131
148
  **维护团队**: MTA工作室
132
149
  **设计理念**: Agent 只提供获取指引,详细规范由 MCP 工具从 npm 包动态获取
@@ -159,5 +159,22 @@ get_standard_by_id({ ids: ['vue3-composition', 'element-plus', 'i18n'] })
159
159
 
160
160
  ---
161
161
 
162
+ ## 🚀 Skills 工具(扩展能力)
163
+
164
+ MTA 已集成以下 Skills,可直接调用:
165
+
166
+ | 工具 | 用途 | 调用示例 |
167
+ |------|------|----------|
168
+ | `http_request` | 发送 HTTP 请求(API 测试) | `http_request({ url: "https://api.example.com/users", method: "GET" })` |
169
+ | `list_skills` | 查看所有可用 Skills | `list_skills()` |
170
+
171
+ ### 使用场景
172
+
173
+ - 需要测试后端接口时,直接调用 `http_request` 发送请求
174
+ - 获取外部 API 数据进行分析
175
+ - 验证接口返回格式是否正确
176
+
177
+ ---
178
+
162
179
  **维护团队**: MTA工作室
163
180
  **设计理念**: Agent 只提供获取指引,详细规范由 MCP 工具从 npm 包动态获取
package/bin/mta.cjs CHANGED
@@ -69,6 +69,11 @@ if (args.includes('--list-agents')) {
69
69
  const files = readdirSync(agentsDir).filter(f => f.endsWith('.agent.md') && !f.endsWith('.bak'));
70
70
 
71
71
  for (const file of files) {
72
+ // 跳过 mta.agent(内部使用,不对外暴露)
73
+ if (file === 'mta.agent.md') {
74
+ continue;
75
+ }
76
+
72
77
  try {
73
78
  const content = readFileSync(join(agentsDir, file), 'utf-8');
74
79
  const lines = content.split('\n');
@@ -115,6 +120,99 @@ if (args.includes('--list-agents')) {
115
120
  process.exit(0);
116
121
  }
117
122
 
123
+ // --list-skills: 列出所有 Skills(供 VSCode 插件调用)
124
+ if (args.includes('--list-skills')) {
125
+ const skillsPath = join(packageRoot, 'skills.json');
126
+
127
+ if (!existsSync(skillsPath)) {
128
+ console.log(JSON.stringify({ error: 'skills.json 不存在', skills: [] }));
129
+ process.exit(1);
130
+ }
131
+
132
+ try {
133
+ const registry = JSON.parse(readFileSync(skillsPath, 'utf-8'));
134
+ const skills = Object.entries(registry.skills).map(([id, config]) => ({
135
+ id,
136
+ ...config
137
+ }));
138
+
139
+ console.log(JSON.stringify({
140
+ version: registry.version,
141
+ lastCheck: registry.lastCheck,
142
+ skills,
143
+ categories: registry.categories
144
+ }, null, 2));
145
+ } catch (e) {
146
+ console.log(JSON.stringify({ error: `读取 Skills 失败: ${e.message}`, skills: [] }));
147
+ process.exit(1);
148
+ }
149
+
150
+ process.exit(0);
151
+ }
152
+
153
+ // --check-skills: 检测 Skills 版本
154
+ if (args.includes('--check-skills')) {
155
+ // tsup 保留目录结构:dist/skills/versionChecker.js
156
+ const esmPath = join(packageRoot, 'dist', 'skills', 'versionChecker.js');
157
+
158
+ if (!existsSync(esmPath)) {
159
+ console.error('[MCP Error] Skills 模块未构建,请运行: npm run build');
160
+ process.exit(1);
161
+ }
162
+
163
+ const esmUrl = pathToFileURL(esmPath).href;
164
+ import(esmUrl).then(async (mod) => {
165
+ const results = await mod.checkSkillsVersions();
166
+ console.log(mod.formatVersionCheckResult(results));
167
+ process.exit(0);
168
+ }).catch(err => {
169
+ console.error('[MCP Error] 检测失败:', err.message);
170
+ process.exit(1);
171
+ });
172
+
173
+ // 阻止继续执行
174
+ return;
175
+ }
176
+
177
+ // --update-skills [skill-id]: 更新 Skills 版本
178
+ const updateSkillsIndex = args.indexOf('--update-skills');
179
+ if (updateSkillsIndex !== -1) {
180
+ const skillId = args[updateSkillsIndex + 1];
181
+ // tsup 保留目录结构:dist/skills/versionChecker.js
182
+ const esmPath = join(packageRoot, 'dist', 'skills', 'versionChecker.js');
183
+
184
+ if (!existsSync(esmPath)) {
185
+ console.error('[MCP Error] Skills 模块未构建,请运行: npm run build');
186
+ process.exit(1);
187
+ }
188
+
189
+ const esmUrl = pathToFileURL(esmPath).href;
190
+ import(esmUrl).then(async (mod) => {
191
+ const skillIds = skillId ? [skillId] : undefined;
192
+ const result = await mod.updateSkillsVersions(skillIds);
193
+
194
+ if (result.updated.length > 0) {
195
+ console.log(`✅ 已更新 ${result.updated.length} 个 Skills:`);
196
+ result.updated.forEach(id => console.log(` - ${id}`));
197
+ } else {
198
+ console.log('✅ 所有 Skills 已是最新版本');
199
+ }
200
+
201
+ if (result.failed.length > 0) {
202
+ console.log(`⚠️ ${result.failed.length} 个 Skills 更新失败:`);
203
+ result.failed.forEach(id => console.log(` - ${id}`));
204
+ }
205
+
206
+ process.exit(0);
207
+ }).catch(err => {
208
+ console.error('[MCP Error] 更新失败:', err.message);
209
+ process.exit(1);
210
+ });
211
+
212
+ // 阻止继续执行
213
+ return;
214
+ }
215
+
118
216
  // 默认行为:启动 MCP 服务器
119
217
  const esmPath = join(packageRoot, 'dist', 'index.js');
120
218