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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@juno_ch/allinpay-syb-mcp-server

v0.1.1

Published

Allinpay SYB MCP Server (stdio). Mirrors Java SDK capabilities and exposes one tool per ApiMethod for Cursor/LLM clients.

Readme

Allinpay SYB MCP Server (Node.js)

基于 Node.js 的通联支付收银宝 SDK 封装,已对齐 Java SDK 全量 ApiMethod 枚举,通过数据驱动方式映射生产/测试域名和前后台类型。当前以 MCP Server (stdio) 形态运行,不暴露 HTTP 路由。MCP 实现基于通用的 vscode-jsonrpc(可走国内 npm 镜像)。

特性

  • 支持多商户配置,按 merchantId 动态路由请求。
  • 对齐 Java SDK 的 API 方法注册表,数据驱动,便于新增或变更。
  • 内置 MD5、RSA/RSA2、SM2 签名;提供 SM4 加解密(内置敏感字段自动加密,需配置 sm4Key)。
  • REST 风格调用入口 /execute,同时提供方法和商户管理辅助接口。

快速开始

  1. 安装依赖
    cd allinpay-syb-mcp-server
    pnpm install # 或 npm install / yarn
  2. 配置商户
    • 复制 config/merchants.example.jsonconfig/merchants.json,填入商户密钥、签名算法、环境等。
    • 或通过环境变量 MERCHANTS_JSON 传入数组配置。
  3. 启动 MCP Server(stdio)
    pnpm dev          # tsx watch src/mcpServer.ts
    # 或生产构建后
    pnpm build && pnpm start   # node dist/mcpServer.js
  4. 在客户端(如 Cursor)中,连接本地 MCP server 并调用工具:
    • list-methods:列举 ApiMethod
    • <ApiMethod>:工具名直接对齐 Java SDK ApiMethod 枚举常量,例如:
      • 交易:UNITORDER_PAYTRANX_QUERY
      • 商户:MERCHANT_ADDMERCHANT_QUERY
      • 收银台:H5_UNIONPAY_ORDER

目录结构

  • src/apiMethods.ts:API 枚举表,对齐 Java SDK 全量接口。
  • src/client.ts:核心请求/签名逻辑。
  • src/merchantStore.ts:商户配置加载(文件 + 环境变量)。
  • src/signers.ts:签名工具(MD5、RSA、RSA2、SM2;含 SM4 加解密)。
  • src/mcp/registerMcp.ts:MCP 协议实现(initialize/tools/list/tools/call)。
  • src/mcp/toolRegistry.ts:按 ApiMethod 生成工具定义与参数 schema(字段 + Javadoc 说明;工具按模块命名)。
  • src/introspect/javaRequestMeta.ts:解析 Java Request 源码,提取字段与 @EncryptField(用于参数 schema + 精准 SM4 加密)。
  • src/mcpServer.ts:MCP Server 入口(stdio)。

MCP 说明

当前以 MCP Server 形式(stdio)对外,无需暴露 HTTP 路由。商户配置需在启动前通过文件或环境变量准备好。

待办/扩展建议

  • 丰富错误处理、重试与回调验签工具。
  • 添加自动化测试与接口契约校验。