使用说明
基本能力
产品定位
银联MCP支付服务是一个基于MCP协议的支付工具,旨在为智能代理应用提供安全、便捷的银联支付接入能力。
核心功能
- 支付接入:支持各类智能代理应用接入银联支付能力。
- 自动化支付流程:通过智能代理应用自动完成订单生成、支付链接生成和支付确认。
- 多场景支持:适用于酒店预订、旅行规划等多种支付场景。
- 安全认证:支持商户签名证书、验证证书等安全机制。
适用场景
- 酒店预订:用户通过智能代理应用输入旅行需求,代理自动推荐酒店并完成支付。
- 旅行规划:代理根据用户需求自动规划行程并完成相关支付。
- 其他智能支付场景:任何需要接入银联支付的智能代理应用。
工具列表
- MCP Inspector:用于调试和了解银联MCP服务功能的工具。
使用教程
使用依赖
- 注册成为银联开放平台的收款商户并获取商户私钥。
安装教程
- 在Cursor项目中添加以下配置到
.cursor/mcp.json:
{
"mcpServers": {
"unionpay-mcp-server": {
"command": "npx",
"args": ["-y","unionpay-mcp-server"],
"env": {
"UP_ACQ_INS_CODE": "<Institution code, mandatory for acquirer institution access>",
"UP_ACCESS_TYPE": "<Mandatory, 0-Merchant direct connection|1-Acquirer institution access|2-Platform merchant access>",
"UP_MER_ID": "<Merchant ID, mandatory for merchant direct connection>",
"UP_TR_ID": "<trId, mandatory>",
"UP_TOKEN_TYPE": "<Token type, optional?>",
"UP_FRONT_URL": "<Front-end redirect URL, optional>",
"UP_FRONT_FAIL_URL": "<Failure redirect URL, optional>",
"UP_BACK_URL": "<Back-end notification URL, optional>",
"UP_SIGN_CERT_PATH": "<Absolute path of institution/merchant signature certificate, mandatory>",
"UP_SIGN_CERT_PWD": "<Signature certificate password, mandatory>",
"UP_VALIDATE_CERT_DIR": "<Absolute path of verification certificate, mandatory>",
"UP_NEED_ENCRYPT": "<Whether to encrypt sensitive information, 0-No encryption, 1-Encryption, optional, default is no encryption>",
"UP_ENCRYPT_CERT_PATH": "<If encryption is needed, absolute path of encryption certificate, optional>",
"UP_DECRYPT_CERT_PATH": "<If encryption/decryption is needed, absolute path of decryption certificate, optional>",
"UP_ENCRYPT_CERT_PWD": "<If encryption/decryption is needed, decryption certificate password, optional>",
"UP_LOG_DIR": "Log output directory, optional, logs are output to HOME directory by default"
}
}
}
}
- 在Cline设置中找到
cline_mcp_settings.json配置文件并添加类似配置。
调试方式
- 通过
export设置各种环境变量。 - 执行以下命令启动MCP Inspector:
npx -y @modelcontextprotocol/inspector && npx -y unionpay-mcp-server
- 在MCP Inspector WebUI中进行调试。