mta-mcp 3.1.0 → 3.2.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.
@@ -87,6 +87,32 @@ get_compact_standards({ currentFile: "当前文件路径" })
87
87
 
88
88
  ---
89
89
 
90
+ ## 🛠️ 增强工具使用指南
91
+
92
+ > MTA 集成了以下增强工具,在特定场景下应主动使用
93
+
94
+ ### 知识图谱记忆
95
+
96
+ 当需要跨会话记住信息时使用:
97
+
98
+ | 场景 | 工具调用 |
99
+ |------|----------|
100
+ | 记住用户偏好/项目信息 | \`create_entities + add_observations\` |
101
+ | 查询历史记忆 | \`search_nodes\` 或 \`read_graph\` |
102
+ | 建立概念关联 | \`create_relations\` |
103
+
104
+ ### 顺序思考
105
+
106
+ 当面对复杂问题时使用:
107
+
108
+ | 场景 | 工具调用 |
109
+ |------|----------|
110
+ | 复杂问题分解 | \`sequentialthinking\` |
111
+ | 多步骤规划 | \`sequentialthinking\` |
112
+ | 需要修订推理 | \`sequentialthinking({ isRevision: true })\` |
113
+
114
+ ---
115
+
90
116
  **维护团队**: MTA工作室
91
117
  **设计理念**: Agent 只提供获取指引,详细规范由 MCP 工具从 npm 包动态获取
92
118
  ```
@@ -128,20 +128,26 @@ get_standard_by_id({ ids: ['flutter', 'flutter-ui-system'] })
128
128
 
129
129
  ---
130
130
 
131
- ## 🚀 Skills 工具(扩展能力)
131
+ ## 🧠 增强工具使用指南
132
132
 
133
- MTA 已集成以下 Skills,可直接调用:
133
+ > MTA 集成了 Memory 和 Sequential Thinking 能力,可在复杂场景中使用
134
134
 
135
- | 工具 | 用途 | 调用示例 |
136
- |------|------|----------|
137
- | `http_request` | 发送 HTTP 请求(API 测试) | `http_request({ url: "https://api.example.com/data", method: "GET" })` |
138
- | `list_skills` | 查看所有可用 Skills | `list_skills()` |
135
+ ### 知识图谱记忆(mcp_memory_*)
139
136
 
140
- ### 使用场景
137
+ | 场景 | 推荐工具 | 用法 |
138
+ |------|----------|------|
139
+ | 记录项目偏好 | `mcp_memory_create_entities` | 创建实体保存用户偏好、项目配置 |
140
+ | 关联技术栈 | `mcp_memory_create_relations` | 建立实体间关系(项目→使用→框架) |
141
+ | 查找历史 | `mcp_memory_search_nodes` | 搜索之前记录的信息 |
142
+ | 获取完整上下文 | `mcp_memory_read_graph` | 读取整个知识图谱 |
141
143
 
142
- - 测试后端 API 接口
143
- - 获取外部数据进行分析
144
- - 验证 API 响应格式
144
+ ### 顺序思考(mcp_sequential-th_sequentialthinking)
145
+
146
+ | 场景 | 何时使用 |
147
+ |------|----------|
148
+ | 复杂架构设计 | 需要多步骤推理时 |
149
+ | 疑难问题诊断 | 问题原因不明确时 |
150
+ | 大型重构规划 | 需要系统性思考时 |
145
151
 
146
152
  ---
147
153
 
@@ -74,5 +74,26 @@ get_compact_standards({ currentFile: "xxx.vue", scenario: "国际化" })
74
74
 
75
75
  ---
76
76
 
77
+ ## 🧠 增强工具使用指南
78
+
79
+ > MTA 集成了 Memory 和 Sequential Thinking 能力,可在复杂场景中使用
80
+
81
+ ### 知识图谱记忆(mcp_memory_*)
82
+
83
+ | 场景 | 推荐工具 | 用法 |
84
+ |------|----------|------|
85
+ | 记录翻译偏好 | `mcp_memory_create_entities` | 保存项目的翻译规范、术语表 |
86
+ | 关联语言包 | `mcp_memory_create_relations` | 建立键名与翻译的关系 |
87
+ | 查找术语 | `mcp_memory_search_nodes` | 搜索之前定义的术语 |
88
+
89
+ ### 顺序思考(mcp_sequential-th_sequentialthinking)
90
+
91
+ | 场景 | 何时使用 |
92
+ |------|----------|
93
+ | 批量提取翻译键 | 需要系统性整理时 |
94
+ | 多语言一致性检查 | 需要全面验证时 |
95
+
96
+ ---
97
+
77
98
  **维护团队**: MTA工作室
78
99
  **设计理念**: Agent 只提供获取指引,详细规范由 MCP 工具从 npm 包动态获取
@@ -93,5 +93,27 @@ register({
93
93
 
94
94
  ---
95
95
 
96
+ ## 🧠 增强工具使用指南
97
+
98
+ > MTA 集成了 Memory 和 Sequential Thinking 能力,可在复杂场景中使用
99
+
100
+ ### 知识图谱记忆(mcp_memory_*)
101
+
102
+ | 场景 | 推荐工具 | 用法 |
103
+ |------|----------|------|
104
+ | 记录节点配置 | `mcp_memory_create_entities` | 保存自定义节点类型、连线规则 |
105
+ | 关联流程结构 | `mcp_memory_create_relations` | 建立节点间的业务关系 |
106
+ | 查找节点定义 | `mcp_memory_search_nodes` | 搜索之前定义的节点模式 |
107
+
108
+ ### 顺序思考(mcp_sequential-th_sequentialthinking)
109
+
110
+ | 场景 | 何时使用 |
111
+ |------|----------|
112
+ | 流程逻辑设计 | 需要设计复杂业务流程时 |
113
+ | 节点类型规划 | 需要系统性设计节点体系时 |
114
+ | 连线规则分析 | 需要验证流程正确性时 |
115
+
116
+ ---
117
+
96
118
  **维护团队**: MTA工作室
97
119
  **设计理念**: Agent 只提供获取指引,详细规范由 MCP 工具从 npm 包动态获取
@@ -94,6 +94,22 @@ MTA 不是传统的"编码规范管理器",而是一个**智能编码助手技
94
94
  | `list_templates` | 列出可用模板 | 查看有哪些模板 |
95
95
  | `get_template` | 获取模板内容 | 应用特定模板 |
96
96
 
97
+ ### 知识图谱记忆类(Memory)
98
+
99
+ | 工具 | 用途 | 何时调用 |
100
+ |------|------|---------|
101
+ | `create_entities` | 创建记忆实体 | 需要跨会话记住信息 |
102
+ | `add_observations` | 添加观察/事实 | 补充实体信息 |
103
+ | `search_nodes` | 搜索记忆 | 查询历史信息 |
104
+ | `read_graph` | 读取全部记忆 | 了解完整上下文 |
105
+ | `create_relations` | 建立关联 | 连接概念/实体 |
106
+
107
+ ### 顺序思考类(Thinking)
108
+
109
+ | 工具 | 用途 | 何时调用 |
110
+ |------|------|---------|
111
+ | `sequentialthinking` | 分步推理 | 复杂问题分解、多步规划 |
112
+
97
113
  ---
98
114
 
99
115
  ## 📁 知识库结构
@@ -187,6 +203,25 @@ agents/ # 开发引导 Agent
187
203
  2. 填充框架特定的规范 ID
188
204
  3. 添加简要快速提示(10-20行)
189
205
  4. 详细规范放入 standards/ 目录
206
+ 5. ⚠️ 必须包含"增强工具使用指南"章节(见模板)
207
+ ```
208
+
209
+ **增强工具使用指南**(所有 Agent 必须包含):
210
+
211
+ ```markdown
212
+ ## 🛠️ 增强工具使用指南
213
+
214
+ ### 知识图谱记忆
215
+ | 场景 | 工具调用 |
216
+ |------|----------|
217
+ | 记住用户偏好/项目信息 | \`create_entities + add_observations\` |
218
+ | 查询历史记忆 | \`search_nodes\` 或 \`read_graph\` |
219
+
220
+ ### 顺序思考
221
+ | 场景 | 工具调用 |
222
+ |------|----------|
223
+ | 复杂问题分解 | \`sequentialthinking\` |
224
+ | 多步骤规划 | \`sequentialthinking\` |
190
225
  ```
191
226
 
192
227
  ### 添加问题诊断案例时
@@ -159,20 +159,26 @@ get_standard_by_id({ ids: ['vue3-composition', 'element-plus', 'i18n'] })
159
159
 
160
160
  ---
161
161
 
162
- ## 🚀 Skills 工具(扩展能力)
162
+ ## 🧠 增强工具使用指南
163
163
 
164
- MTA 已集成以下 Skills,可直接调用:
164
+ > MTA 集成了 Memory 和 Sequential Thinking 能力,可在复杂场景中使用
165
165
 
166
- | 工具 | 用途 | 调用示例 |
167
- |------|------|----------|
168
- | `http_request` | 发送 HTTP 请求(API 测试) | `http_request({ url: "https://api.example.com/users", method: "GET" })` |
169
- | `list_skills` | 查看所有可用 Skills | `list_skills()` |
166
+ ### 知识图谱记忆(mcp_memory_*)
170
167
 
171
- ### 使用场景
168
+ | 场景 | 推荐工具 | 用法 |
169
+ |------|----------|------|
170
+ | 记录项目偏好 | `mcp_memory_create_entities` | 创建实体保存用户偏好、项目配置 |
171
+ | 关联技术栈 | `mcp_memory_create_relations` | 建立实体间关系(项目→使用→框架) |
172
+ | 查找历史 | `mcp_memory_search_nodes` | 搜索之前记录的信息 |
173
+ | 获取完整上下文 | `mcp_memory_read_graph` | 读取整个知识图谱 |
172
174
 
173
- - 需要测试后端接口时,直接调用 `http_request` 发送请求
174
- - 获取外部 API 数据进行分析
175
- - 验证接口返回格式是否正确
175
+ ### 顺序思考(mcp_sequential-th_sequentialthinking)
176
+
177
+ | 场景 | 何时使用 |
178
+ |------|----------|
179
+ | 复杂架构设计 | 需要多步骤推理时 |
180
+ | 疑难问题诊断 | 问题原因不明确时 |
181
+ | 大型重构规划 | 需要系统性思考时 |
176
182
 
177
183
  ---
178
184
 
@@ -108,5 +108,27 @@ miniprogram/
108
108
 
109
109
  ---
110
110
 
111
+ ## 🧠 增强工具使用指南
112
+
113
+ > MTA 集成了 Memory 和 Sequential Thinking 能力,可在复杂场景中使用
114
+
115
+ ### 知识图谱记忆(mcp_memory_*)
116
+
117
+ | 场景 | 推荐工具 | 用法 |
118
+ |------|----------|------|
119
+ | 记录项目配置 | `mcp_memory_create_entities` | 保存小程序配置、API 接口信息 |
120
+ | 关联页面结构 | `mcp_memory_create_relations` | 建立页面间的跳转关系 |
121
+ | 查找配置 | `mcp_memory_search_nodes` | 搜索之前记录的配置信息 |
122
+
123
+ ### 顺序思考(mcp_sequential-th_sequentialthinking)
124
+
125
+ | 场景 | 何时使用 |
126
+ |------|----------|
127
+ | 页面架构设计 | 需要规划多页面应用时 |
128
+ | 性能优化分析 | 需要系统性排查性能问题时 |
129
+ | 业务逻辑梳理 | 需要理清复杂业务流程时 |
130
+
131
+ ---
132
+
111
133
  **维护团队**: MTA工作室
112
134
  **设计理念**: Agent 只提供获取指引,详细规范由 MCP 工具从 npm 包动态获取
package/bin/mta.cjs CHANGED
@@ -69,11 +69,6 @@ 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
-
77
72
  try {
78
73
  const content = readFileSync(join(agentsDir, file), 'utf-8');
79
74
  const lines = content.split('\n');
@@ -120,99 +115,6 @@ if (args.includes('--list-agents')) {
120
115
  process.exit(0);
121
116
  }
122
117
 
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
-
216
118
  // 默认行为:启动 MCP 服务器
217
119
  const esmPath = join(packageRoot, 'dist', 'index.js');
218
120