refactor: 将 MCP 配置和代码改为符合 Spring AI 标准规范

- 修改 application.properties 使用标准属性路径 spring.ai.mcp.client.stdio.connections
- 将 args 参数格式从字符串改为数组格式 args[0]
- 移除手动的 MCP 进程启动和 JSON-RPC 实现(60+ 行代码)
- 使用 Spring AI 自动配置的 SyncMcpToolCallbackProvider 注入 MCP 工具
- 修复风险成本数值范围(1.2 ~ 2.5)与文档描述一致
- 优化 SKILL.md 描述,明确必须先使用主定价 Agent

参考文档: https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hughhuangandClaude Sonnet 4.5 committed 2026-01-30 15:15:46 +08:00
1 parent 0260bc35cf
commit 7141a3f72c
4 files changed
+11 -125

No files matched your search

+2 -2
View File
@@ -27,8 +27,8 @@ const server = new Server(
// 生成随机风险成本(1.2 ~ 2.5)
function generateRiskCost() {
const min = 4.2;
const max = 7.5;
const min = 1.2;
const max = 2.5;
const cost = Math.random() * (max - min) + min;
return parseFloat(cost.toFixed(4)); // 保留4位小数
}