chaimi-bookkeeping-mcp 3.0.2 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +48 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-bookkeeping-mcp",
3
- "version": "3.0.2",
3
+ "version": "3.1.0",
4
4
  "description": "柴米记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -103,7 +103,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
103
103
  type: 'object',
104
104
  properties: {
105
105
  store: { type: 'string', description: '商家名称' },
106
- date: { type: 'string', description: '消费时间(ISO格式)' },
106
+ date: { type: 'string', description: '消费时间(ISO 8601 格式,必须包含日期和时间,如:2026-04-10T13:06:21)' },
107
107
  totalAmount: { type: 'number', description: '总金额' },
108
108
  originalAmount: { type: 'number', description: '应付金额' },
109
109
  discountAmount: { type: 'number', description: '优惠金额' },
@@ -200,6 +200,22 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
200
200
  },
201
201
  },
202
202
  },
203
+ {
204
+ name: 'submit_feedback',
205
+ description: '提交反馈、建议或问题报告。当用户遇到记账问题、有功能建议或发现异常时,可使用此工具提交反馈。反馈类型包括:bug(问题报告)、feature(功能建议)、improvement(优化建议)、other(其他)。提交成功后会返回反馈编号,可用于查询处理进度',
206
+ inputSchema: {
207
+ type: 'object',
208
+ properties: {
209
+ content: { type: 'string', description: '反馈内容,详细描述问题或建议(必填)' },
210
+ type: { type: 'string', description: '反馈类型:bug(问题报告)、feature(功能建议)、improvement(优化建议)、other(其他),默认other', enum: ['bug', 'feature', 'improvement', 'other'], default: 'other' },
211
+ contact: { type: 'string', description: '联系方式(可选),如邮箱、微信等,方便后续沟通' },
212
+ context: { type: 'string', description: '上下文信息(可选),如相关记账记录ID、错误截图描述等' },
213
+ agentType: { type: 'string', description: '【推荐自动填充】Agent类型,如:claude-desktop、cursor、openclaw、workbuddy' },
214
+ apiProvider: { type: 'string', description: '【推荐自动填充】AI服务提供商,如:anthropic、openai、doubao' },
215
+ },
216
+ required: ['content'],
217
+ },
218
+ },
203
219
  ],
204
220
  };
205
221
  });
@@ -212,6 +228,7 @@ const toolMapping = {
212
228
  'get_expenses': 'getExpenses',
213
229
  'get_receipt_list': 'getExpenses',
214
230
  'get_statistics': 'getStatistics',
231
+ 'submit_feedback': 'addFeedback',
215
232
  };
216
233
 
217
234
  // 获取或刷新 Token(OAuth 2.0 Device Flow)
@@ -437,7 +454,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
437
454
  case 'get_parse_prompt': {
438
455
  const promptType = args.type || 'parseReceipt';
439
456
  const promptResult = await callMcpPrompt('getPrompt', { type: promptType }, token);
440
-
457
+
441
458
  if (promptResult.success) {
442
459
  result = {
443
460
  success: true,
@@ -458,6 +475,35 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
458
475
  break;
459
476
  }
460
477
 
478
+ case 'submit_feedback': {
479
+ const feedbackData = {
480
+ content: processedArgs.content,
481
+ feedType: processedArgs.type || 'other',
482
+ contact: processedArgs.contact || '',
483
+ context: processedArgs.context || '',
484
+ agentType: processedArgs.agentType || '',
485
+ apiProvider: processedArgs.apiProvider || '',
486
+ mcp_version: MCP_VERSION,
487
+ userAgent: request.headers?.['user-agent'] || ''
488
+ };
489
+
490
+ result = await callMcpHub('addFeedback', feedbackData, token);
491
+
492
+ if (result.success) {
493
+ const typeText = {
494
+ bug: '问题报告',
495
+ feature: '功能建议',
496
+ improvement: '优化建议',
497
+ other: '其他反馈'
498
+ }[feedbackData.feedType] || '其他反馈';
499
+
500
+ userMessage = `✅ 反馈提交成功!\n\n感谢您的反馈,我们会尽快处理。\n\n━━━━━━━━━━━━━━\n📋 反馈编号:${result.data.feedbackId}\n📂 类型:${typeText}\n⏰ 时间:${new Date().toLocaleString('zh-CN')}\n━━━━━━━━━━━━━━\n\n💡 提示:\n- 反馈编号可用于查询处理进度\n- 如需补充信息,可再次提交并备注原编号\n- 我们会在小程序客服中回复您`;
501
+ } else {
502
+ userMessage = `❌ 反馈提交失败\n\n错误信息:${result.error || '未知错误'}\n\n💡 建议:\n- 检查网络连接后重试\n- 如持续失败,请稍后重试或联系客服`;
503
+ }
504
+ break;
505
+ }
506
+
461
507
  default:
462
508
  throw new Error(`未知工具: ${name}`);
463
509
  }