mcpField
P
paypay-mcp

paypay-mcp

Local
github.com/mrslbtFinance0Updated 11w ago

About paypay-mcp

paypay-mcp connects MCP clients to the PayPay Open Payment API for QR-code payments. It supports payment status checks, cancellation, and refunds, with money-moving actions gated by configuration.

Key features

  1. 01Create dynamic PayPay QR codes
  2. 02Check and wait for payment status
  3. 03Invalidate unpaid QR codes
  4. 04Issue full or partial refunds
  5. 05Cancel payments in unclear states

Use cases

  1. 01Create a QR code for a PayPay payment
  2. 02Check whether a payment has completed
  3. 03Invalidate a QR code before payment
  4. 04Refund or cancel a payment when enabled

MCP support

Exposes PayPay payment tools and API reference resources to MCP clients. It supports stdio and Streamable HTTP transports; refund and cancel tools are disabled unless explicitly enabled.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"mrslbt-paypay": {
"command": "npx",
"args": [
"-y",
"paypay-mcp"
]
}
}
}
Run commandnpx -y paypay-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmpaypay-mcp0.2.1

Tools

4

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
amountintegerYesAmount in JPY (integer, no decimals). 金額(円、整数)。
code_typeenumNoQR code type. Currently only ORDER_QR is supported.ORDER_QR
order_itemsarrayNoOptional line-item breakdown shown in the PayPay app. 商品明細(任意)。
redirect_urlstringNoWhere to send the user after they complete payment in the PayPay app.
redirect_typeenumNoHow the redirect should open: browser (WEB_LINK) or app (APP_DEEP_LINK).WEB_LINK | APP_DEEP_LINK
is_authorizationbooleanNoIf true, this is a pre-auth (hold funds now, capture later). 事前承認(preauth)フラグ。
order_descriptionstringYesWhat the customer is paying for. 注文内容。
merchant_payment_idstringNoUnique ID for this payment. Auto-generated (UUID) if omitted. Reusing an ID for a different order will fail. 注文ごとの一意のID。省略時は自動生成。

Details

From the project 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:

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:

{
  "mcpServers": {
    "paypay": {
      "command": "npx",
      "args": ["-y", "paypay-mcp"],
      "env": {
        "PAYPAY_API_KEY": "a_...",
        "PAYPAY_API_SECRET": "...",
        "PAYPAY_MERCHANT_ID": "...",
        "PAYPAY_ENV": "sandbox"
      }
    }
  }
}
Claude Code
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.

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

git clone https://github.com/mrslbt/paypay-mcp.git
cd paypay-mcp
npm install
cp .env.example .env
npm run dev
npm test
npm run smoke
npm 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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.