LFWin Payment MCP Server (KuShouYin Payment MCP) is a payment capability service for AI Agents that exposes payment-related capabilities to Cursor, Cline, Claude Desktop, enterprise intelligent assistants, and self-developed Agent applications through the standard MCP protocol.
Purpose and main capabilities The project provides four MCP tools: create_payment_order (create a unified cashier payment order), query_payment_order (query payment order status), refund_payment_order (initiate a refund), and query_refund_status (query refund status). When a payment order is created, it returns pay_url (the unified cashier payment redirect link), qrcode (the same as pay_url, for compatibility with callers that need scan content), pay_qrcode_image (a QR code PNG data URL generated based on pay_url), pay_qrcode_base64 (raw base64), pay_qrcode_mime_type (fixed as image/png), pay_qrcode_markdown (Markdown image text that can be displayed directly), and payment_display_examples (display examples for scenarios such as Markdown, HTML/img, MCP image content, and payment link fallback). The Node.js version additionally returns a PNG content block with type: "image" in the MCP tool result, making it convenient for MCP clients that support image rendering to display the QR code directly.
Order number and status handling merchant_order_no is the merchant order number (corresponding to mch_orderid in the API documentation), order_no is the platform order number (corresponding to orderid), and order_time is the order creation time (format yyyyMMddHHmmss). If order_no_available=true and order_no is not empty, subsequent queries, refunds, and refund queries should preferentially use order_no; if order_no is empty, payment status polling should use merchant_order_no + order_time. When using merchant_order_no + order_time to query and the user has not yet scanned the code, the underlying layer may return raw_status=3040, which this MCP normalizes to status=PENDING and returns pending_reason=WAITING_FOR_USER_SCAN_OR_PAYMENT_ORDER_CREATION. A payment query returning status=10000 and paystatus=1 indicates successful payment, paystatus=0 indicates pending payment, and paystatus=2 indicates payment failure. A refund request returning status=4001 or status=10000 only indicates that the request has been accepted or is being processed, and query_refund_status must continue to be called; a refund query with status=4001 indicates processing, status=10000 with refund_status=1 indicates a successful refund, and refund_status=2 indicates a failed refund. When multiple partial refunds are made for the same order, a different mch_refund_no should be used each time.
Usage The Node.js version is located in node-mcp, and ordinary MCP users are recommended to launch it quickly via npx; the Python version is located in payment_mcp, suitable for users who already have a Python 3.12 or higher environment or need secondary development. The API domain is usually https://api2.lfwin.com,一般不需要额外配置接口域名和签名方式。PAYMENT_SIGN_KEY Only used when generating request signatures locally on the MCP Server; it is not sent to the API as a request field and does not appear in tool return results. The project runs by default using stdio as a local MCP service. The repository root provides mcp.json for Open Plugins / Cursor Directory recognition, and also provides glama.json, Dockerfile, LICENSE, SECURITY.md, and GitHub Actions CI. After pushing a v* tag, the Release workflow automatically builds the .mcpb and uploads it to the GitHub Release; the .mcpb is a zip package containing the local MCP Server and manifest.json, suitable for one-click installation in clients that support MCPB, such as Claude Desktop. During installation, the user is prompted to enter the Payment API Key and Payment Sign Key, which are injected as PAYMENT_API_KEY and PAYMENT_SIGN_KEY via the manifest's user_config.
Use cases and limitations Suitable for scenarios in AI conversations or agents where payment orders are created directly and users are guided to scan a QR code to pay, payment status is polled, refunds are initiated, and refund results are queried. To obtain payment permissions or keys, contact the service provider's customer service. Do not commit real PAYMENT_API_KEY or PAYMENT_SIGN_KEY to GitHub; it is recommended to inject them via environment variables, IDE Secrets, or a server secret management system. To deploy as a remote MCP service, you need to add authentication, tenant isolation, access control, and Origin validation yourself. When facing users, display the QR code and keep pay_url as a backup link; do not merely state that the order has been created.