Embedding WeChat Pay MCP into AI Agents: A Step‑by‑Step Guide
This article walks you through the entire process of enabling and integrating WeChat Pay MCP into Tencent Yuanqi AI agents, covering its core capabilities, trial activation, template usage, code configuration, workflow setup, and practical tips for seamless payment experiences.
After Alipay released its MCP, Tencent Yuanqi has now launched WeChat Pay MCP, allowing AI agents to handle payments directly within the WeChat ecosystem.
WeChat Pay MCP solves payment challenges in agent development by providing quick order creation, direct cash collection, and the ability to launch the native WeChat payment UI, expanding the range of possible interactions.
The service offers three main capabilities in service‑provider mode:
Native order API that generates a QR‑code payment link.
JSAPI order API that returns a prepay_id for in‑app payments.
Order‑status query by merchant order number.
To start, open the Tencent Yuanqi MCP shop (https://yuanqi.tencent.com/mcp-shop) and enable the trial version. The trial uses a test merchant account that refunds payments automatically the next day.
For the full version, submit an application (https://wj.qq.com/s2/23001898/lpyn/) with your agent’s link; both individuals and enterprises can apply.
After activation, you can integrate WeChat Pay MCP into an existing agent using the official template. Create a new agent by cloning the template, which includes a prompt that calls the create‑native‑payment tool to generate a QR‑code link and the query-order-by-out-trade-no tool to verify payment status.
##设定
你是一个写诗机器人,你可以根据用户的主题来写一首七言绝句。
##写诗前置要求
当用户给你主题让你创作诗句时
1、你需要先调用【create‑native‑payment】这个工具,为用户生成1分钱支付的付款二维码链接,并将二维码链接(code_url)展示给用户。
2、并告知用户需要扫码付款来获取诗句,同时告知用户付款后可以跟你说“我已赞赏”。
##验证付款
当用户说已支付后,你需要调用【query-order-by-out-trade-no】这个工具,验证这个订单号是否是已支付状态,当验证是已支付时,为用户输出诗句。The template also supports launching the WeChat half‑screen payment UI via a workflow. Import the official workflow template from the creative library, publish it, and then bind the WeChat Pay MCP to the workflow’s advanced settings.
Testing the JSAPI flow requires opening the agent in the WeChat client; the payment UI appears directly without needing to scan a QR code.
Note that the current experience version works only on web/H5 pages; mobile browsers may require saving the QR code before scanning, which is less smooth.
Overall, embedding WeChat Pay MCP into AI agents provides a streamlined monetization path, reducing friction for users and enabling agents to earn revenue directly.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
