global-antom-mcp
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"antom-mcp-server": {
"args": [
"ant-intl-antom-mcp"
],
"command": "uvx",
"env": {
"ALIPAY_PUBLIC_KEY": "your_alipay_public_key_here",
"CLIENT_ID": "your_client_id_here",
"GATEWAY_URL": "https://open-sea-global.alipay.com",
"MERCHANT_PRIVATE_KEY": "your_merchant_private_key_here",
"PAYMENT_NOTIFY_URL": "https://your-domain.com/payment/notify",
"PAYMENT_REDIRECT_URL": "/"
}
}
}
}
该服务需要配置环境变量:ALIPAY_PUBLIC_KEY、CLIENT_ID、GATEWAY_URL、MERCHANT_PRIVATE_KEY、PAYMENT_NOTIFY_URL、PAYMENT_REDIRECT_URL
可用工具 (5 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
create_payment_session 4 个参数 需填 4 项
The tool is used to create a payment session which helps you complete the payment process and eliminate intermediate page redirections throughout the entire payment process. Args: payment_request_id: The unique ID assigned by a merchant to identify a payment request. Maximum length: 64 characters order_amount_currency: The transaction currency that is specified in the contract. A 3-letter currency code that follows the ISO 4217 standard.Maximum length: 3 characters order_amount_value: The amount to charge as a positive integer in the smallest currency unit. (That is, 100 cents to charge $1.00, or 100 to charge JPY 100, a 0-decimal currency).Value range: 1 - unlimited order_description: Summary description of the order, which is used for user consumption records display or other further actions.Maximum length: 256 characters
必填参数:payment_request_id、order_amount_currency、order_amount_value、order_description
query_payment_detail 1 个参数 需填 1 项
The tool is used to inquire about the transaction status and other information about a previously submitted payment request. Args: payment_request_id: The unique ID that is assigned by a merchant to identify a payment request.Maximum length: 64 characters
必填参数:payment_request_id
cancel_payment 1 个参数 需填 1 项
The tool is used to cancel the payment if the payment result is not returned after a long time. The cancellation cannot be performed if being out of the cancellable period specified in the contract. Args: payment_request_id: The unique ID that is assigned by a merchant to identify a payment request.Maximum length: 64 characters
必填参数:payment_request_id
create_refund 4 个参数 需填 4 项
The tool is used to initiate a refund against a successful payment. The refund can be full or partial. A transaction can have multiple refunds as long as the total refund amount is less than or equal to the original transaction amount. If the refund request is out of the refund window determined in the contract, the refund request will be declined. Args: refund_request_id: The unique ID assigned by the merchant to identify a refund request.Maximum length: 64 characters payment_id: The unique ID assigned by Antom for the original payment to be refunded.Maximum length: 64 characters refund_amount_currency: The currency used for the corresponding payment of the refund. The value is a 3-letter currency code that follows the ISO 4217 standard. refund_amount_value: The amount to charge as a positive integer in the smallest currency unit. (That is, 100 cents to charge $1.00, or 100 to charge JPY 100, a 0-decimal currency).Value range: 1 - unlimited
必填参数:refund_request_id、payment_id、refund_amount_currency、refund_amount_value
query_refund_detail 1 个参数 需填 1 项
The tool is used to inquire about the refund status of a previously submitted refund request. Args: refund_request_id: The unique ID assigned by the merchant to identify a refund request.Maximum length: 64 characters
必填参数:refund_request_id
服务介绍
Antom MCP 服务器
一个与模型上下文协议 (MCP) 兼容的服务器,集成了蚂蚁国际的 Antom 支付 API,使 AI 助手能够无缝处理支付和退款操作。
概述
Antom MCP 服务器将蚂蚁国际的 Antom 支付 API 包装成标准化的 MCP 工具,允许 AI 助手在对话过程中安全地处理与支付相关的操作。通过该服务器,您可以直接通过 AI 交互创建支付会话、查询交易状态、处理退款等。
特性
💳 支付操作
- 创建支付会话 (
create_payment_session):生成用于客户端 SDK 集成的支付会话 - 查询支付详情 (
query_payment_detail):检索已提交支付请求的交易状态和信息 - 取消支付 (
cancel_payment):当结果未在预期时间内返回时取消支付
💰 退款操作
- 创建退款 (
create_refund):针对成功的支付发起全额或部分退款 - 查询退款详情 (
query_refund_detail):检查之前提交的退款请求的状态
前提条件
在使用 Antom MCP 服务器之前,请确保您具备以下条件:
- Python 3.11 或更高版本
- uv(推荐的包管理器)或 pip
- 有效的 Antom 商户账户,包含:
- 商户客户端 ID (CLIENT_ID)
- 商户 RSA 私钥 (MERCHANT_PRIVATE_KEY)
- 支付宝 RSA 公钥 (ALIPAY_PUBLIC_KEY)
- 支付重定向返回 URL (PAYMENT_REDIRECT_URL)
- 支付通知回调 URL (PAYMENT_NOTIFY_URL)
快速开始
1. 安装
使用 uvx 直接使用(推荐)
uvx ant-intl-antom-mcp
从源代码安装
git clone https://github.com/alipay/global-antom-mcp.git
cd global-antom-mcp
uv install
2. MCP 客户端配置
将以下配置添加到您的 MCP 客户端中:
{
"mcpServers": {
"antom-mcp-server": {
"command": "uvx",
"args": ["ant-intl-antom-mcp"],
"env": {
"GATEWAY_URL": "https://open-sea-global.alipay.com",
"CLIENT_ID": "your_client_id_here",
"MERCHANT_PRIVATE_KEY": "your_merchant_private_key_here",
"ALIPAY_PUBLIC_KEY": "your_alipay_public_key_here",
"PAYMENT_REDIRECT_URL": "/",
"PAYMENT_NOTIFY_URL": "https://your-domain.com/payment/notify"
}
}
}
}
3. 环境变量
| 变量 | 是否必需 | 描述 |
|---|---|---|
GATEWAY_URL |
❌ | Antom API 网关 URL(默认为 https://open-sea-global.alipay.com) |
CLIENT_ID |
✅ | 用于身份验证的商户客户端 ID |
MERCHANT_PRIVATE_KEY |
✅ | 用于请求签名的商户 RSA 私钥 |
ALIPAY_PUBLIC_KEY |
✅ | 用于响应验证的支付宝 RSA 公钥 |
PAYMENT_REDIRECT_URL |
❌ | 支付完成后用户被重定向到的 URL |
PAYMENT_NOTIFY_URL |
❌ | 支付结果通知回调 URL |
集成示例
以下是如何将 Antom MCP 服务器与您的 AI 代理集成(以 QwenAgent 为例):
import os
from qwen_agent.agents import Assistant
# Configure the MCP server as a tool
tools = [{
"mcpServers": {
"antom-mcp-server": {
"command": "uvx",
"args": ["ant-intl-antom-mcp"],
"env": {
"CLIENT_ID": os.getenv('CLIENT_ID'),
"MERCHANT_PRIVATE_KEY": os.getenv('MERCHANT_PRIVATE_KEY'),
"ALIPAY_PUBLIC_KEY": os.getenv('ALIPAY_PUBLIC_KEY'),
"GATEWAY_URL": "https://open-sea-global.alipay.com",
"PAYMENT_REDIRECT_URL": "/",
"PAYMENT_NOTIFY_URL": "https://your-domain.com/notify"
}
}
}
}]
# Create your AI assistant with payment capabilities
bot = Assistant(
llm={'model': 'qwen-max', 'api_key': 'your-api-key'},
function_list=tools,
system_message="You are a helpful assistant with payment processing capabilities."
)
更新日志
请参阅 CHANGELOG.md 获取详细的更改历史记录。
许可证
本项目采用 MIT 许可证。
致谢
- Model Context Protocol 提供的标准
- Antom Integration 提供的 Antom 支付平台