xiatian-pay-mcp
Provides tools for Alipay payment integration, including RSA2 signing of request parameters, precreate orders for QR code payments, building PC/mobile website payment URLs, and verifying asynchronous payment notifications.
Provides tools for WeChat Pay V3 integration, including generating Authorization signature headers, creating Native and JSAPI orders, verifying callback signatures, and decrypting AES-256-GCM encrypted notification resources.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xiatian-pay-mcp 生成支付宝当面付二维码,订单 A001,金额 9.9 元"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
夏天pay全球通 MCP Server · xiatian-pay-mcp
让 AI 助手(Trae / Cursor / Claude Desktop / Dify / Coze 等任何 MCP 客户端)一句话完成微信支付 V3与支付宝的签名、下单、回调验签。零依赖、纯本地运行、不触碰任何资金。
合规定位:本工具是开发者技术工具,只生成签名/请求与校验回调;资金始终在商户自己的微信/支付宝商户号内结算,本工具不参与资金清算(无「二清」)。
能力(11 个工具)
工具 | 作用 | 是否联网 |
| 离线生成微信 V3 Authorization 签名头 | 否 |
| Native 扫码下单,返回 | execute=true 时联网 |
| JSAPI/小程序下单,返回 wx.invoke 调起参数 | execute=true 时联网 |
| 微信异步通知 RSA-SHA256 验签 | 否 |
| 回调 resource AES-256-GCM 解密 | 否 |
| 支付宝 RSA2 参数签名 | 否 |
| 当面付预下单,返回 | execute=true 时联网 |
| 电脑网站/手机网站支付跳转链接 | 否 |
| 支付宝异步通知验签 | 否 |
| 托管平台免凭证建单(可选 SaaS) | 是 |
| 托管平台查单 | 是 |
Related MCP server: Antom MCP Server
安装与接入
要求 Node.js ≥ 18。
npm install -g xiatian-pay-mcp # 发布后;当前可直接用源码目录MCP 客户端配置(Trae / Claude Desktop 等的 mcp.json):
{
"mcpServers": {
"xiatian-pay": {
"command": "npx",
"args": ["-y", "xiatian-pay-mcp"],
"env": {
"XIATIAN_WX_MCHID": "1900000001",
"XIATIAN_WX_APPID": "wxxxxxxxx",
"XIATIAN_WX_CERT_SERIAL": "证书序列号",
"XIATIAN_WX_PRIVATE_KEY_PATH": "C:/certs/apiclient_key.pem",
"XIATIAN_WX_PLATFORM_CERT_PATH": "C:/certs/wx_platform_cert.pem",
"XIATIAN_WX_APIV3_KEY": "32位APIv3密钥",
"XIATIAN_ALIPAY_APPID": "2021000000000001",
"XIATIAN_ALIPAY_PRIVATE_KEY_PATH": "C:/certs/alipay_app_private.pem",
"XIATIAN_ALIPAY_PUBLIC_KEY_PATH": "C:/certs/alipay_public.pem",
"XIATIAN_PLATFORM_URL": "https://pay.your-domain.com",
"XIATIAN_API_KEY": "托管平台API密钥(可选)"
}
}
}
}所有环境变量均可省略,改为调用工具时在
cred参数内传入(PEM 全文或 .pem 文件路径均可)。建议生产环境用环境变量/文件路径,避免密钥出现在对话上下文中。
使用示例(对 AI 说的话)
「帮我生成微信 Native 扫码下单请求,订单号 T1001,金额 199.00 元,商品‘降噪耳机’,回调 https://example.com/cb」
「这是微信回调的 headers 和原始 body,帮我验签并解密 resource」
「用支付宝当面付给订单 A20260916001(9.9 元)生成二维码链接,沙箱环境」
「生成支付宝电脑网站支付跳转链接,return_url 是 https://example.com/ok」
「校验这段支付宝异步通知的签名是不是真的」
测试
node test/run-tests.js内置 32 项协议级测试:MCP 握手/工具清单/真实 RSA 签名验签/篡改检测/AES-GCM 加解密闭环/离线下单构造/错误处理,全部离线可跑。
凭证准备指引
微信支付:pay.weixin.qq.com → 账户中心 → API 安全 → 设置 APIv3 密钥、申请 API 证书(apiclient_key.pem + 证书序列号);平台证书通过
/v3/certificates获取;另需已开通 Native/JSAPI 产品与 AppID。支付宝:open.alipay.com → 创建网页/移动应用 → 用密钥工具生成 RSA2 密钥对,上传应用公钥,保存支付宝公钥;签约当面付/电脑网站/手机网站支付;沙箱网关自动支持。
安全与边界
本项目不存储、不上传任何商户密钥;除显式下单工具外全部离线计算。
不提供资金代收、代付、清算能力;不持有支付牌照,不做「二清」。
商户需自行承担微信/支付宝平台资质、ICP、税务合规义务。
License
MIT
Available Tools
11 toolsalipay_build_pay_urlA
支付宝生成支付跳转链接(离线,不发起请求):product=page 电脑网站 alipay.trade.page.pay;wap 手机网站 alipay.trade.wap.pay。
Inputs: order (required), product (required), cred, quitUrl, +3 more.
alipay_precreateA
支付宝当面付预下单:execute=false 仅返回已签名请求规格;true 真实调用返回 qr_code 二维码链接。
Inputs: order (required), cred, execute, sandbox, +1 more.
alipay_sign_paramsA
支付宝:对业务参数做 RSA2 签名,返回带 sign 的完整参数(可直接 POST 到网关)。
Inputs: method (required), bizContent (required), cred, extra, +1 more.
alipay_verify_notifyA
支付宝异步通知验签:传入全部回调参数(含 sign),用支付宝公钥校验。返回 {valid:boolean}。
Inputs: params (required), cred.
platform_create_orderA
夏天pay托管平台:免商户凭证建单(需要环境变量 XIATIAN_PLATFORM_URL + XIATIAN_API_KEY)。返回订单号与收银台链接。
Inputs: subject (required), amountYuan (required), mchNo, scene, +1 more.
platform_query_orderA
夏天pay托管平台:按订单号查询实时支付状态(pending/success/failed/expired/refunded)。
Inputs: orderNo (required).
wechat_build_authorizationA
微信支付V3:离线构造 Authorization 请求头(RSA-SHA256 签名),不发起网络请求。用于自建 HTTP 调用。
Inputs: url (required), method (required), body, cred, +2 more.
wechat_create_jsapi_orderB
微信支付V3 JSAPI 下单(微信内/小程序):返回 prepay_id 与 wx.invoke("getBrandWCPayRequest") 调起参数。
Inputs: order (required), openid (required), notifyUrl (required), cred, +1 more.
wechat_create_native_orderA
微信支付V3 Native 扫码下单:execute=false 仅返回已签名的请求规格;true 真实调用微信 API 返回 code_url(二维码内容)。
Inputs: order (required), notifyUrl (required), cred, execute.
wechat_decrypt_callbackB
微信支付V3 回调 resource 解密:AES-256-GCM,密钥为 APIv3。返回交易明文 JSON。
Inputs: nonce (required), ciphertext (required), cred, associatedData.
wechat_verify_callbackA
微信支付V3 异步通知验签:用微信支付平台证书校验 Wechatpay-Signature。返回 {valid:boolean}。
Inputs: nonce (required), rawBody (required), signature (required), timestamp (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Provider prefixes (wechat_, alipay_, platform_) cleanly separate the three domains, and each tool has a distinct action. Minor ambiguity exists because wechat_create_native_order and alipay_precreate both have an execute=false mode that returns signed request specs, overlapping somewhat with the dedicated signing utilities.
Names generally follow a provider_verb_noun snake_case pattern, such as platform_create_order, wechat_decrypt_callback, and alipay_verify_notify. The pattern is slightly weakened by alipay_precreate (verb only) and the mix of verbs like build, sign, create, and precreate, but the names remain readable and predictable.
11 tools is well-scoped for a multi-provider payment server, covering WeChat Pay, Alipay, and the hosted platform with no obvious redundancy. Each tool earns its place and the count supports practical agent workflows without overwhelming selection.
The server covers order creation, querying, signing, and callback verification well, but lacks refund or close/cancel operations for both WeChat Pay and Alipay. This leaves a notable gap in the common payment lifecycle, forcing agents to handle refunds outside the MCP server.
Related MCP Connectors
Hong Kong payments for AI agents — Alipay / WeChat Pay via Stripe. Never holds funds.
Taiwan payments (ECPay 綠界 + NewebPay 藍新) & e-invoices for AI agents. Stateless, never holds funds.
Vietnam payments for AI agents — MoMo wallet QR, ATM, cards. Zero-setup sandbox. Never holds funds.
Pakistan payments for AI agents — Safepay checkout via Safepay. Never holds funds.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to interact with multiple payment providers (Stripe, Paystack) through a unified API. Supports payment initialization, verification, refunds, customer management, and invoicing without requiring knowledge of specific provider implementations.2-

Antom MCP Serverofficial
AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) compatible server that integrates Ant International's Antom payment APIs, enabling AI assistants to handle payment and refund operations seamlessly.532MIT
AlipayPlus MCP Serverofficial
AlicenseAqualityDmaintenanceIntegrates Ant International's AlipayPlus payment APIs, enabling AI assistants to handle payment and refund operations seamlessly.623 PyPI8MIT- AlicenseAqualityBmaintenanceAn MCP server that exposes Alipay AI Pay capabilities to AI agents, enabling skill discovery, payment integration guides, and merchant onboarding workflows via Alipay's payment APIs.4114 npmMIT