Agent-SafePay MCP 服务器
MCP(模型上下文协议)服务器适配,使AI代理能够与Agent-SafePay支付控件进行交互。
请参阅 https://github.com/Edidas02/agent-safepay-lite/blob/main/README.md 获取安装说明
可用工具
1. create_payment_intent
使用政策检查创建支付。
参数:
amount(数字):金额以分为单位(例如,2599表示25.99美元)currency(字符串): "USD"(美元)、"EUR"(欧元)或 "GBP"(英镑)merchant_id(字符串):商户ID(例如,“m_abc”)merchant_name(字符串):商户显示名称item_description(字符串):正在购买什么
返回值:
- 支付意图ID
- 状态:
blocked,requires_consent,或ready - 代理的下一步行动
2. submit_consent
提交一次性密码以获取同意批准。
参数:
intent_id(字符串):支付意图IDotp(字符串):来自用户的6位一次性密码(OTP)
返回值:
- 成功/失败状态
3. confirm_payment
执行支付。
参数:
intent_id(字符串):支付意图ID
返回值:
- 支付结果(成功/失败)
4. get_audit_log
查看交易审计轨迹。
参数:
intent_id(字符串):支付意图ID
返回值:
- HMAC签名的审计日志(ND-JSON格式)
示例代理流程
User: "Buy me a $30 gadget from Acme"
Agent: [calls create_payment_intent]
Response: "⚠️ This payment requires user consent.
Ask the user to check their server logs for the OTP code."
User: "The OTP is 483927"
Agent: [calls submit_consent with OTP]
Response: "✅ Consent granted! Payment intent is now ready."
Agent: [calls confirm_payment]
Response: "✅ Payment successful!"建筑学
AI Agent (Claude Desktop)
↓ MCP Protocol
MCP Server (this project)
↓ HTTP/JSON
Agent-SafePay API (:8080)
↓
Policy Engine + PSP Emulator