MCP ExplorerExplorer

Go Promptpay Mcp

@naruebaeton 12 days ago
1 MIT
FreeCommunity
AI Systems
A Go server for generating PromptPay QR codes compliant with MCP.

Overview

What is Go Promptpay Mcp

go-promptpay-mcp is a Model Context Protocol (MCP) server implementation designed to generate PromptPay QR code payloads using the Go programming language.

Use cases

Use cases include generating QR codes for payments in retail environments, facilitating peer-to-peer transactions, and integrating with mobile payment applications.

How to use

To use go-promptpay-mcp, install it via ‘go install github.com/naruebaet/go-promptpay-mcp’, set up your workspace with a configuration file, and utilize the ‘generate_promptpay_code’ tool to create QR codes by providing the required parameters.

Key features

Key features include generating PromptPay QR codes compliant with EMVCo standards, support for phone numbers and Thai national ID numbers, optional amount specification, MCP compliance, and robust input validation and error handling.

Where to use

go-promptpay-mcp can be used in financial applications, payment processing systems, and any service that requires generating PromptPay QR codes for transactions in Thailand.

Content

Go PromptPay MCP

A Model Context Protocol (MCP) server implementation for generating PromptPay QR codes payload in Go.

License: MIT
Go Reference

Features

  • 🔄 Generate PromptPay QR codes with EMVCo standard
  • 📱 Support for phone numbers (with proper formatting)
  • 🆔 Support for Thai national ID numbers
  • 💰 Optional amount specification with decimal support
  • 🚀 MCP compliant server implementation
  • ✅ Input validation and error handling

Prerequisites

  • Go 1.16 or higher
  • Basic understanding of MCP (Model Context Protocol)

Installation

go install github.com/naruebaet/go-promptpay-mcp

Use in vscode workspace

  • Setup in your workspace
    mkdir .vscode
    touch mcp.json
    
  • Insert this value to mcp.json and start server from here.
    {
      "servers": {
        "go-promptpay-mcp": {
          "type": "stdio",
          "command": "go-promptpay-mcp",
          "args": []
        }
      }
    }

Usage

The server implements one tool:

generate_promptpay_code

Generates a PromptPay QR code payload.

Parameters:

  • accountType (required): Type of account (“phone” or “id”)
  • accountNumber (required): Phone number or Thai ID
  • amount (optional): Payment amount in THB

Example request:

{
  "tool": "generate_promptpay_code",
  "arguments": {
    "accountType": "phone",
    "accountNumber": "0812345678",
    "amount": 100.5
  }
}

Example success response:

{
  "success": true,
  "data": {
    "payload": "00020101021229370016A000000677010111011300668123456785802TH53037645406100.506304A14F"
  }
}

Example error response:

{
  "success": false,
  "error": {
    "message": "Invalid account number format"
  }
}

Development

  1. Clone the repository
  2. Install dependencies: go mod download
  3. Run the server: go run main.go

Dependencies

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -am 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Create a new Pull Request

License

MIT License

Tools

No tools

Comments