- Explore MCP Servers
- go-promptpay-mcp
Go Promptpay Mcp
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.
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.
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 IDamount
(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
- Clone the repository
- Install dependencies:
go mod download
- Run the server:
go run main.go
Dependencies
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -am 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Create a new Pull Request
License
MIT License