- Lfwin Payment Mcp
Lfwin Payment Mcp
LFWin Payment MCP Server 是一个面向 AI Agent 的支付能力服务,通过标准 MCP 协议,将创建支付订单、查询支付状态、发起退款、查询退款状态等能力开放给 Cursor、Cline、Claude Desktop、企业智能助手和自研 Agent 应用。
LFWin Payment MCP Server is a payment capability service for AI Agents. Adhering to the standard MCP protocol, it exposes capabilities including creating payment orders, checking payment status, initiating refunds and querying refund status for Cursor, Cline, Claude Desktop, enterprise intelligent assistants and self-developed Agent applications.
Overview
LFWin 支付 MCP Server - AI原生支付网关(收银台/退款/查单)
LFWin Payment MCP Server 是一个面向 AI Agent 的支付能力服务,通过标准 MCP 协议,将创建支付订单、查询支付状态、发起退款、查询退款状态等能力开放给 Cursor、Cline、Claude Desktop、企业智能助手和自研 Agent 应用。
项目同时保留两种实现:
- Python 版:位于
payment_mcp/,适合已有 Python 环境的用户。 - Node.js 版:位于
node-mcp/,适合通过npx快速启动,推荐给普通 MCP 使用者。
两种实现提供相同的 MCP 工具能力,用户可以按自己的环境选择安装方式。
获取支付权限或密钥,请联系服务商客服。
功能
create_payment_order:创建统一收银台支付订单query_payment_order:查询支付订单状态refund_payment_order:发起退款query_refund_status:查询退款状态
创建支付订单时只会调用统一收银台接口生成一次订单,并返回支付链接和二维码图片:
pay_url:统一收银台支付跳转链接qrcode:同pay_url,用于兼容需要扫码内容的调用方pay_qrcode_image:基于pay_url生成的二维码 PNG 图片data:image/png;base64,...地址pay_qrcode_markdown:可直接展示的 Markdown 图片文本
环境变量
两种实现都需要以下环境变量:
PAYMENT_API_KEY=your_api_key_here
PAYMENT_SIGN_KEY=your_sign_key_here
通常只需要配置 PAYMENT_API_KEY 和 PAYMENT_SIGN_KEY。
安装方式一:Node.js 版
推荐普通用户使用 Node.js 版。发布到 npm 后,可以直接通过 npx 启动:
npx -y @litsen/lfwin-payment-mcp
Cursor 配置示例:
{
"mcpServers": {
"payment-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@litsen/lfwin-payment-mcp"],
"env": {
"PAYMENT_API_KEY": "your_api_key_here",
"PAYMENT_SIGN_KEY": "your_sign_key_here"
}
}
}
}
本地源码调试 Node.js 版:
cd node-mcp
npm install
npm run build
node dist/index.js
更多说明见 node-mcp/README.md。
安装方式二:Python 版
如果你已经有 Python 3.12 或更高版本,也可以使用 Python 版。
从 GitHub 安装:
pip install git+https://github.com/litsen/lfwin-payment-mcp.git
安装完成后会得到 MCP 启动命令:
payment-mcp
Cursor 配置示例:
{
"mcpServers": {
"payment-mcp": {
"type": "stdio",
"command": "cmd",
"args": ["/c", "payment-mcp"],
"env": {
"PAYMENT_API_KEY": "your_api_key_here",
"PAYMENT_SIGN_KEY": "your_sign_key_here"
}
}
}
}
源码开发时也可以这样运行:
pip install -r requirements.txt
python -m payment_mcp.mcp_stdio
Cline 配置
Node.js 版:
{
"mcpServers": {
"payment-mcp": {
"command": "npx",
"args": ["-y", "@litsen/lfwin-payment-mcp"],
"env": {
"PAYMENT_API_KEY": "your_api_key_here",
"PAYMENT_SIGN_KEY": "your_sign_key_here"
},
"disabled": false
}
}
}
Python 版:
{
"mcpServers": {
"payment-mcp": {
"command": "cmd",
"args": ["/c", "payment-mcp"],
"env": {
"PAYMENT_API_KEY": "your_api_key_here",
"PAYMENT_SIGN_KEY": "your_sign_key_here"
},
"disabled": false
}
}
}
工具参数
create_payment_order
创建支付订单。
参数:
merchant_order_no:商户订单号,必须唯一amount:支付金额,单位为元currency:币种,默认CNYchannel:支付渠道,默认commsubject:订单说明notify_url:异步通知地址,可选
返回结果中的 pay_qrcode_markdown 可以直接让 AI 输出给用户,用于扫码支付。
query_payment_order
查询支付订单状态。
参数:
order_no:平台订单号
refund_payment_order
发起退款。
参数:
order_no:平台订单号refund_amount:退款金额,单位为元reason:退款原因mch_refund_no:商户退款单号,必须唯一
query_refund_status
查询退款状态。
参数:
order_no:平台订单号mch_refund_no:商户退款单号,可选
发布
Python 版构建 wheel 包:
pip install build
python -m build
Node.js 版发布 npm 包:
cd node-mcp
npm login
npm publish --access public
安全说明
- 不要把真实的
PAYMENT_API_KEY、PAYMENT_SIGN_KEY提交到 GitHub。 - 建议通过环境变量、IDE Secret 或服务器密钥管理系统注入密钥。
- 本项目默认使用
stdio方式作为本地 MCP 服务运行。 - 如果要部署成远程 MCP 服务,请自行增加认证、租户隔离、访问控制和 Origin 校验。
演示示例
如Cursor安装后,可选择启用哪些能力
智能体调用时会自动生成对应的支付订单,可引导用户扫码完成支付
发起支付:
发起退款:
Project Info
Created At
13 days agoUpdated At
7 days agoAuthor Name
litsenStar
-Language
-License
-Recommend Servers
View AllShotapi
@smallhandsome
9 hours ago
Crevio
a day ago
Playwright Mcp
@microsoft
Playwright MCP server
TypeScript
10 months ago
Airtreks Mcp
@SEKeener
10 hours ago
Serper MCP Server
@garymengcom
A Serper MCP Server
Python
a year ago