56 lines
1.1 KiB
Markdown
56 lines
1.1 KiB
Markdown
# 客户风险成本 MCP 服务器
|
||||
|
|
|
|||
|
|
## 功能
|
|||
|
|
|
|||
|
|
提供获取客户风险成本率的工具,用于定价计算。
|
|||
|
|
|
|||
|
|
## 工具
|
|||
|
|
|
|||
|
|
### get_customer_risk_cost
|
|||
|
|
|
|||
|
|
获取客户的风险成本率(%)。
|
|||
|
|
|
|||
|
|
**输入参数**:
|
|||
|
|
- `company_name` (string, 必需): 客户的企业名称
|
|||
|
|
|
|||
|
|
**输出**:
|
|||
|
|
```json
|
|||
|
|
{
|
|||
|
|
"company_name": "某某科技有限公司",
|
|||
|
|
"risk_cost_rate": 1.8765,
|
|||
|
|
"unit": "%",
|
|||
|
|
"description": "客户\"某某科技有限公司\"的风险成本率为 1.8765%",
|
|||
|
|
"timestamp": "2026-01-29T12:00:00.000Z"
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**风险成本率范围**:1.2% ~ 2.5%
|
|||
|
|
|
|||
|
|
## 安装
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
cd mcp-servers/risk-cost-server
|
|||
|
|
npm install
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 运行
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
npm start
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 配置到 Spring AI
|
|||
|
|
|
|||
|
|
在 `application.properties` 中添加:
|
|||
|
|
|
|||
|
|
```properties
|
|||
|
|
spring.ai.mcp.client.risk-cost.command=node
|
|||
|
|
spring.ai.mcp.client.risk-cost.args=D:/project/spring-ai-skill/mcp-servers/risk-cost-server/index.js
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 测试
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
# 测试工具调用
|
|||
|
|
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_customer_risk_cost","arguments":{"company_name":"测试企业"}}}' | node index.js
|
|||
|
|
```
|