Connect SGPayNowQR to Claude, ChatGPT, Cursor & VS Code (MCP)
Step-by-step setup for Claude Code, Claude, ChatGPT, Cursor, VS Code, Windsurf, Codex and Gemini CLI, so your AI assistant can generate PayNow QR codes with the generate_qr tool.
SGPayNowQR runs a hosted Model Context Protocol server with one tool, generate_qr. Connect it once and your AI assistant can create PayNow QR codes from a plain request, with no integration code.
Endpoint: https://developers.sgpaynowqr.com/api/mcp (Streamable HTTP, no OAuth).
1. Get an API key
Sign up free (50 QR codes/month), then create a key on the API Keys page. It’s the same key as the REST API and SDK.
2. Add it to your client
Most clients send the key as an X-API-Key header. ChatGPT only accepts a URL, so it uses a personal URL with the key at the end: https://developers.sgpaynowqr.com/api/mcp/sgpn_…. Claude accounts that don’t have the Request headers option yet can use the personal URL too.
Goes in: Terminal
- Run this once. Add
--scope userto make it available in every project. - Start
claudeand run/mcpto confirm sgpaynowqr is connected.
claude mcp add --transport http sgpaynowqr https://developers.sgpaynowqr.com/api/mcp \
--header "X-API-Key: sgpn_your_api_key_here"3. Try it
Ask in plain language. The model fills in the tool arguments for you:
- “Make a PayNow QR for UEN 201234567A, merchant My Company, $25, reference INV-102.”
- “Generate a PayNow QR to mobile 91234567 for $12.50 that expires in 2 hours.”
- “I need QR codes for invoices INV-201 to INV-203 at $80 each to UEN 201234567A (My Company).”
Each call returns the QR payload, an image_url link to the PNG, and the PNG itself. Some apps, including claude.ai, only show the image inside the collapsed tool call, so the assistant also gives you the link to open, download or print:
{
"qr_string": "00020101021226...6304A1B2",
"image_url": "https://developers.sgpaynowqr.com/api/v1/qr-image?d=...&sig=...",
"payment_type": "uen",
"amount": "25.00",
"currency": "SGD",
"reference": "INV-102",
"expiry": "24h"
}generate_qr accepts the same parameters as POST /api/v1/generate (see the API reference). Every call counts toward your monthly quota and shows up on the Usage page.
Troubleshooting
- 401 “Missing X-API-Key header” or “Invalid API key”
- The key is missing, mistyped, or revoked. Header clients need the exact header name
X-API-Key; URL clients need the full personal URL including thesgpn_key. Copy it again from the API Keys page. - Connected, but the model never calls the tool
- Make sure the connector or server is enabled for the current chat. Then ask for a PayNow QR explicitly and include the payment details.
- Tool returns “Monthly usage limit exceeded”
- MCP calls share your account’s monthly quota with REST calls. Check Usage or upgrade on Billing.
- 405 “only POST is supported” from mcp-remote
- The server is stateless and has no SSE stream. If you run
mcp-remoteyourself, pass--transport http-only. The@alexhalfborg/sgpaynowqr-mcpwrapper already does this.
Keeping your key safe
A personal URL works for anyone who has it, and URLs are more likely than headers to end up in logs or screenshots. Create a separate key for each connector (for example “Claude connector”) so you can revoke it on the API Keys page without affecting your other integrations.
Next steps
Not sure which payment type to use? Read Choosing a Payment Type. Writing code directly against the API instead? See TypeScript SDK Quickstart.