Paypay Mcp

io.github.mrslbt由 GitHub 账号 mrslbt 发布v0.2.1更新于 Oct 24, 2026

PayPay QR payments for AI agents: QR codes, status, refunds, cancels. Bilingual JP/EN.

已验证STDIO仅桌面金融商业与电商

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手创建 PayPay 二维码支付、查询支付状态,并可选地退款或取消支付。

可以做什么
创建动态 PayPay 二维码,返回支付链接、deeplink 和渲染的 PNG 图片,并可在付款前使二维码失效。查询支付详情,并轮询直到支付进入终态。发起全额或部分退款,以及取消状态不明的支付,两者均需显式开启。读取内置参考资源,了解 PayPay OPA API、支付生命周期和当前非敏感配置。使用内置提示完成单笔收款、退款上一笔支付和排查卡住的支付。
适用场景
适合已具备 PayPay Open Payment API 凭证的商户,让助手在聊天或代理流程中受理二维码支付、跟踪状态或处理退款与取消。在接入真实支付前应先在沙盒环境测试。
运行要求
通过 npm 在本地运行(Node.js 20+,需 TLS 1.2+)。需要来自 PayPay 开发者后台的 PAYPAY_API_KEY、PAYPAY_API_SECRET 和 PAYPAY_MERCHANT_ID。PAYPAY_ENV 默认为 sandbox;生产环境需完成 PayPay 商户入驻。可选 HTTP 模式使用 MCP_TRANSPORT、MCP_HTTP_PORT、MCP_HTTP_HOST、MCP_AUTH_TOKEN 和 MCP_HTTP_ALLOWED_ORIGINS。
安装前请注意
它可以通过 PayPay API 动用真实资金。退款和取消工具默认关闭,只有设置 PAYPAY_ENABLE_REFUNDS 或 PAYPAY_ENABLE_CANCELS 为 true 才会启用;仅在工具输入不受不可信内容影响的环境中开启。批准任何涉及资金的调用前请先审查。生产环境需设置 PAYPAY_ENV=production。公开 HTTP 绑定必须提供 MCP_AUTH_TOKEN。该服务器为非官方社区项目,与 PayPay 无关,作者不对资金损失承担责任。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Paypay Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

paypay-mcp

[npm version] [npm downloads] [MCP Badge] [License: MIT]

Model Context Protocol server for the PayPay Open Payment API.

Works with Claude Desktop, Claude Code, Cursor, Windsurf, Zed, ChatGPT Apps SDK, and any other MCP-compatible client. Tool descriptions are provided in English and Japanese.

Status

v0.2.x — production-capable, not yet battle-tested at scale.

The server runs cleanly against PayPay's production Open Payment API once PAYPAY_ENV=production is set with approved merchant credentials. It has not yet processed meaningful real-world volume. If you are routing real payments through it, pin the version and review the source first.

Tools

ToolDescription
create_qr_codeCreate a dynamic PayPay QR code. Returns the payment URL, deeplink, and a rendered PNG.
get_payment_detailsFetch the current status of a payment.
wait_for_paymentPoll until a payment reaches a terminal state.
delete_qr_codeInvalidate a QR code before payment.
refund_paymentFull or partial refund. Disabled unless PAYPAY_ENABLE_REFUNDS=true.
cancel_paymentCancel a payment when its state is unclear (timeout or error). Disabled unless PAYPAY_ENABLE_CANCELS=true.

Prompts

accept_single_payment, refund_last_payment, debug_stuck_payment.

Resources

URIDescription
paypay://docs/opa-referenceEndpoint map, auth scheme, and status vocabulary for the PayPay OPA API.
paypay://docs/payment-statesPayment lifecycle and the cancel-vs-refund decision rule.
paypay://config/currentNon-secret view of the active config (env, merchantId, baseUrl, transport).

Install

One-click:

[Install in Cursor] [Install in VS Code]

Or via npm:

bash
npm install -g paypay-mcp

Configuration

Credentials come from the PayPay Developer Dashboard.

VariableRequiredDescription
PAYPAY_API_KEYyesOPA API Key ID
PAYPAY_API_SECRETyesOPA API Key Secret
PAYPAY_MERCHANT_IDyesMerchant ID
PAYPAY_ENVnosandbox (default) or production
PAYPAY_ENABLE_REFUNDSnoSet to true to expose refund_payment. Disabled by default.
PAYPAY_ENABLE_CANCELSnoSet to true to expose cancel_payment. Disabled by default.
MCP_TRANSPORTnostdio (default) or http
MCP_HTTP_PORTnoPort when MCP_TRANSPORT=http. Default 3000.
MCP_HTTP_HOSTnoBind address. Default 127.0.0.1. Public binds require MCP_AUTH_TOKEN.
MCP_AUTH_TOKENnoBearer token required on inbound HTTP requests when set. Mandatory for non-loopback binds.
MCP_HTTP_ALLOWED_ORIGINSnoComma-separated CORS allowlist. Default: none.

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "paypay": {      "command": "npx",      "args": ["-y", "paypay-mcp"],      "env": {        "PAYPAY_API_KEY": "a_...",        "PAYPAY_API_SECRET": "...",        "PAYPAY_MERCHANT_ID": "...",        "PAYPAY_ENV": "sandbox"      }    }  }}

Claude Code

bash
claude mcp add paypay -e PAYPAY_API_KEY=... -e PAYPAY_API_SECRET=... -e PAYPAY_MERCHANT_ID=... -- npx -y paypay-mcp

Cursor

Add to ~/.cursor/mcp.json with the same shape as Claude Desktop.

Remote hosting

Run in HTTP mode. Public binds require MCP_AUTH_TOKEN; the server refuses to start otherwise.

bash
MCP_TRANSPORT=http \  MCP_HTTP_HOST=0.0.0.0 \  MCP_AUTH_TOKEN="$(openssl rand -hex 32)" \  MCP_HTTP_ALLOWED_ORIGINS="https://claude.ai,https://your-app.example.com" \  PAYPAY_ENV=sandbox \  PAYPAY_API_KEY=... PAYPAY_API_SECRET=... PAYPAY_MERCHANT_ID=... \  npx paypay-mcp

Endpoint: POST http(s)://<host>:3000/mcp (Streamable HTTP transport). Clients send Authorization: Bearer <MCP_AUTH_TOKEN>. CORS is closed by default.

For local testing the auth token can be omitted; the server binds to 127.0.0.1 and only accepts loopback connections.

Environments

Sandbox is the default. Production requires PayPay merchant onboarding (business verification and a contract) and must be enabled by explicitly setting PAYPAY_ENV=production.

Constraints

  • Amounts are integer JPY.
  • A payment can be canceled until 00:14:59 JST the day after the payment attempt. After that, use a refund.
  • A single order can receive multiple partial refunds, each with a unique merchantRefundId, up to the merchant-configured cap.
  • TLS 1.2+ required (Node 20+).

Development

bash
git clone https://github.com/mrslbt/paypay-mcp.gitcd paypay-mcpnpm installcp .env.example .envnpm run devnpm testnpm run smokenpm run build

Roadmap

v0.2: PreAuth + Capture, ContinuousPayments, DirectDebit, AccountLink QR, webhook signature verification, reconciliation tools.

v0.3: Native Payment (App Invoke + user JWT auth), Visa-partnership endpoints, OpenTelemetry tracing.

Safety

This server can move real money through the PayPay OPA API. Key safeguards:

  • Refund and cancel tools are disabled by default. refund_payment and cancel_payment are only registered when PAYPAY_ENABLE_REFUNDS=true or PAYPAY_ENABLE_CANCELS=true. Only enable them in trusted agent contexts where tool inputs cannot be influenced by untrusted content.
  • Sandbox is the default. Production requires an explicit PAYPAY_ENV=production, plus completed PayPay merchant onboarding. Always test against sandbox first.
  • Unique merchantPaymentId and merchantRefundId per call. PayPay deduplicates by these IDs, so reusing one will either fail or target an older payment. Generate a fresh ID for each new payment or refund.
  • Tools carry MCP safety annotations. Read-only tools (get_payment_details, wait_for_payment) are flagged readOnlyHint; money-moving and destructive tools (refund_payment, cancel_payment, delete_qr_code) are flagged destructiveHint so compatible clients can warn you before the call. These are advisory hints — the real guard is the gating above.

Even with these gates on, review any money-moving request before approving the tool call. Treat tool inputs derived from model output as untrusted.

Disclaimer

This is an unofficial, community-built MCP server. Not affiliated with, endorsed by, or sponsored by PayPay Corporation. PayPay is a registered trademark of its respective owners. Use at your own risk. The author accepts no liability for funds lost through misuse, prompt injection, or bugs.

License

MIT

来源:README.md,提交 36eea75

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分