lfwin-payment-mcp

lfwin-payment-mcp

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.

Category
Visit Server

README

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_KEYPAYMENT_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:币种,默认 CNY
  • channel:支付渠道,默认 comm
  • subject:订单说明
  • 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_KEYPAYMENT_SIGN_KEY 提交到 GitHub。
  • 建议通过环境变量、IDE Secret 或服务器密钥管理系统注入密钥。
  • 本项目默认使用 stdio 方式作为本地 MCP 服务运行。
  • 如果要部署成远程 MCP 服务,请自行增加认证、租户隔离、访问控制和 Origin 校验。

演示示例

如Cursor安装后,可选择启用哪些能力 <img width="973" height="302" alt="image" src="https://github.com/user-attachments/assets/751e9f95-86ff-4d84-bc24-c3f6cd61d76a" />

智能体调用时会自动生成对应的支付订单,可引导用户扫码完成支付

发起支付: <img width="999" height="883" alt="image" src="https://github.com/user-attachments/assets/a84d961f-369b-49c2-9a7c-28732b300348" />

发起退款: <img width="975" height="767" alt="image" src="https://github.com/user-attachments/assets/36bf9cf8-0f72-4680-be8f-02cdf97d96b9" />

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured