pix-mcp
Enables AI agents to generate static Pix QR codes for Brazilian payments using natural language, with EMV 4.0 compliance and no external API required.
README
Pix MCP Server v2.1.0
A lightweight Model Context Protocol (MCP) server that enables AI agents (Claude, Cursor, Windsurf) to generate static Pix QR codes via natural-language prompts.
🚀 Features
- 🔧 MCP Tool:
generateStaticPix- Generate static Pix QR codes for any Pix key (no API required)
- 🚀 Production-ready: Comprehensive error handling and logging
- 🔒 Type-safe: Full TypeScript implementation with Zod validation
- 📱 QR Code generation: Automatic QR code creation for Pix payments
- 📦 Zero Dependencies: No external API keys or services required
- 🌍 Open & Accessible: Works without any registration or credentials
- ✅ EMV 4.0 Compliant: Follows BACEN PIX standards with proper CRC16-CCITT validation
🚀 Quick Start
# Install globally
npm install -g pix-mcp
# Run in MCP mode (for Claude Desktop)
pix-mcp
# Run in HTTP mode (for web services)
MCP_MODE=http pix-mcp
🔧 Usage
MCP Mode (Default)
# Start in MCP mode for Claude Desktop integration
pix-mcp
HTTP Mode
# Start in HTTP mode on port 3000
MCP_MODE=http pix-mcp
Making Requests
HTTP API
curl -X POST http://localhost:3000/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "generateStaticPix",
"arguments": {
"pixKey": "10891990909",
"amount": 100.50,
"recipientName": "Franco Camelo Aguzzi",
"recipientCity": "Florianopolis"
}
}'
MCP Tool
const result = await mcpClient.callTool('generateStaticPix', {
pixKey: '10891990909',
amount: 100.5,
recipientName: 'Franco Camelo Aguzzi',
recipientCity: 'Florianopolis',
});
🚀 Deployment
Railway
⚠️ Important: After deploying to Railway, add these environment variables in the Railway dashboard:
MCP_MODE=httpNODE_ENV=production(optional)
Manual Deployment
# Clone the repository
git clone https://github.com/Regenerating-World/pix-mcp.git
cd pix-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Start the server in HTTP mode
MCP_MODE=http NODE_ENV=production node dist/index.js
📝 License
MIT
🔧 Configuration
Environment Variables
MCP_MODE: Server mode (stdiofor MCP,httpfor HTTP API) - Default:stdioNODE_ENV: Environment (development/production) - Default:developmentPORT: HTTP port when in HTTP mode - Default:3000
🤖 Usage with AI Tools
Claude Desktop
- Install the package globally:
npm install -g pix-mcp
- Add to your Claude Desktop MCP configuration (
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS or%APPDATA%/Claude/claude_desktop_config.jsonon Windows):
{
"mcpServers": {
"pix-mcp": {
"command": "npx",
"args": ["pix-mcp"],
"env": {
"MCP_MODE": "stdio"
}
}
}
}
- Restart Claude Desktop and start using:
Create a Pix charge for R$25.50 to Maria Silva for lunch
Cursor (with MCP support)
Add to your Cursor MCP settings:
{
"mcpServers": {
"pix-mcp": {
"command": "pix-mcp"
}
}
}
Windsurf (with MCP support)
Configure in Windsurf MCP settings:
{
"pix-mcp": {
"command": "npx pix-mcp",
"args": []
}
}
Any MCP-compatible tool
Your tool should support MCP servers. Configure using:
- Command:
npx pix-mcporpix-mcp(if installed globally) - Protocol: stdio
- Environment:
MCP_MODE=stdio
🔨 Available Tools
generateStaticPix
Creates a static Pix payment QR code following BACEN EMV 4.0 standards.
Parameters:
pixKey(string): Valid Pix key (email, phone, CPF, CNPJ, or random key)amount(number): Payment amount in BRL (0.01 to 999,999.99)recipientName(string): Name of the payment recipient (max 25 chars)recipientCity(string): City of the payment recipient (max 15 chars)
Returns:
- Payment details (amount, recipient, city)
- Pix copy-paste code (EMV format)
- QR code image (base64 data URL)
- Success status and message
Supported Pix Key Types:
- 📧 Email:
example@email.com - 📱 Phone:
+5511999999999 - 👤 CPF:
12345678901(11 digits) - 🏢 CNPJ:
12345678000195(14 digits) - 🔑 Random Key:
123e4567-e89b-12d3-a456-426614174000(UUID format)
🏗️ Development
# Development mode with hot reload
npm run dev
# Run tests
npm test
# Build for production
npm run build
# Lint code
npm run lint
# Format code
npm run format
🗺️ Roadmap
Phase 1: MVP ✅
- [x]
generateStaticPixtool - [x] Static Pix QR code generation
- [x] QR code generation
- [x] Claude Desktop compatibility
- [x] EMV 4.0 compliance
- [x] CRC16-CCITT validation
- [x] All Pix key types support
- [x] Public deployment
- [x] MCP server configuration files
- [x] Multi-tool compatibility
Phase 2: MCP Discovery
- [ ] Register with MCP registry
- [ ] Add to community MCP directories
- [ ] Integration examples for more tools
🔒 Security & Validation
- ✅ EMV 4.0 standard compliance
- ✅ CRC16-CCITT checksum validation
- ✅ Input validation with Zod schemas
- ✅ Pix key format validation
- ✅ Comprehensive error handling
- ✅ Type-safe TypeScript implementation
⚠️ Important Notes
- CPF/CNPJ Keys: Must be valid and registered as Pix keys
- Test Data: Avoid using fake CPFs like
12345678900- they will be rejected by banks - Static Codes: No expiration, recipient must check payments manually
- Validation: All codes are EMV-compliant and pass bank validation
📝 License
MIT License - see LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📞 Support
- GitHub Issues: Report bugs or request features
- Documentation: Available in this README
Made with ❤️ for the Brazilian Pix ecosystem
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。