npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

partner-mcp-server

v1.0.1

Published

微信支付服务商MCP Server 体验版本

Readme

1. 简介

@tenpay/partner-mcp-server 是微信支付官方的 MCP Server(服务商模式),让你可以轻松将微信支付的下单、查单、退款等能力集成到你的 LLM 应用或智能工具中,快速实现具备支付能力的智能体。

2. 使用和配置

要使用微信支付 MCP Server,你需要具备微信支付服务商身份,并获取相关密钥和参数。

在 Cursor 中使用

在项目根目录的 .cursor/mcp.json 文件中加入如下配置:

{
  "mcpServers": {
    "wxpay-mcp": {
      "command": "npx",
      "args": ["-y", "partner-mcp-server"],
      "env": {
        "WECHATPAY_APP_ID": "wxdxxxxxxebe76",
        "WECHATPAY_MCHID": "24xxxxxx01",
        "WECHATPAY_SUB_MCHID": "24xxxxxx33",
        "WECHATPAY_MCH_SERIAL_NUMBER": "1B1DF2B3xxxxxB953F8",
        "WECHATPAY_PRIVATE_KEY": "xxxxxxx",
        "WECHATPAY_NOTIFY_CALLBACK_URL": "https://pay.weixin.qq.com/xxxxxxxxxxx"
      }
    }
  }
}

在 Cline 中使用

cline_mcp_settings.json 文件中加入:

{
  "mcpServers": {
    "wxpay-mcp": {
      "command": "npx",
      "args": ["-y", "partner-mcp-server"],
      "env": {
        "WECHATPAY_APP_ID": "wxdxxxxxxebe76",
        "WECHATPAY_MCHID": "24xxxxxx01",
        "WECHATPAY_SUB_MCHID": "24xxxxxx33",
        "WECHATPAY_MCH_SERIAL_NUMBER": "1B1DF2B3xxxxxB953F8",
        "WECHATPAY_PRIVATE_KEY": "xxxxxxx",
        "WECHATPAY_NOTIFY_CALLBACK_URL": "https://pay.weixin.qq.com/xxxxxxxxxxx"
      },
      "disable": false,
      "autoApprove": []
    }
  }
}

其他 MCP Client

只需合理配置 Server 启动命令 npx -y partner-mcp-server,并设置上述环境变量即可。


3. 启动方式

  • stdio 模式:先运行 npm run build,然后在 MCP Client 中用 node <path-to-dist/index.js> 启动。
  • http 模式:直接 npm run start:http,环境变量放在根目录 .env 文件中,自动读取。

4. 所有参数说明

微信支付 MCP Server 通过环境变量接收参数,主要包括:

| 变量名 | 说明 | 是否必需 | |--------|------|----------| | WECHATPAY_APP_ID | 微信开放平台 AppID | 必需 | | WECHATPAY_MCHID | 服务商商户号 | 必需 | | WECHATPAY_SUB_MCHID | 子商户号 | 必需 | | WECHATPAY_MCH_SERIAL_NUMBER | 商户API证书序列号 | 必需 | | WECHATPAY_PRIVATE_KEY | 商户API私钥 | 必需 | | WECHATPAY_NOTIFY_CALLBACK_URL | 支付/退款结果通知回调地址 | 必需 | | 其他参数 | 详见微信支付官方文档 | 视场景而定 |


5. 支持的能力

| 工具名称 | 描述 | 输入参数 | 输出 | |----------|------|----------|------| | create-native-payment | 创建微信 Native 支付订单,返回二维码链接,适合 PC/移动扫码支付 | - description: 商品描述- out_trade_no: 商户订单号- amount: 金额(分) | - code_url: 支付二维码链接 | | create-jsapi-payment | 创建微信 JSAPI 支付订单,返回支付链接,适合公众号/小程序内支付 | - description: 商品描述- out_trade_no: 商户订单号- sub_openid: 用户openid- amount: 金额(分) | - mweb_url: 支付跳转链接 | | query-order-by-out-trade-no | 查询订单支付状态 | - out_trade_no: 商户订单号 | - 订单状态、金额等 |


6. 如何选择合适的支付方式

  • Native 支付create-native-payment):适合桌面端/移动端扫码支付场景。推荐在 PC 网站、H5 页面等场景下使用。
  • JSAPI 支付create-jsapi-payment):适合在微信内(公众号、小程序)直接调起支付的场景。

建议在 Prompt 或产品文档中明确你的应用场景,帮助 LLM 智能体自动选择合适的支付方式。


7. 调试与开发建议

  • 推荐使用 MCP Inspector 工具进行本地调试,快速验证支付流程。
  • 各环境变量可通过 export 设置,或放入 .env 文件中自动加载。

8. 注意事项

  • 请妥善保管商户私钥,避免泄露。
  • 微信支付 MCP Server 处于持续迭代阶段,能力和接口可能会有调整。
  • 在开发和部署智能体服务时,务必了解并防范 Prompt 注入、命令执行等安全风险。
  • 更多最佳实践和常见问题,欢迎在微信支付开发者社区交流。

9. 使用协议

本工具基于微信支付开放平台能力,使用时请遵守微信支付开发者协议及相关法律法规。


如需进一步帮助或有建议,欢迎提交 issue 或参与社区讨论。