payu-mcp-server
Integrates PayU payment services with AI tools through the Model Context Protocol, enabling payment link creation, transaction retrieval, and settlement analysis.
README
PayU MCP Server
Seamlessly integrate PayU payment services with your AI tools through Model Context Protocol
Overview
PayU MCP Server provides specialized integration that enables AI tools to securely access PayU payment APIs through the Model Context Protocol (MCP). This integration allows AI assistants to create payment links, retrieve transaction details, access invoice information, manage refunds, and analyze settlement data directly, making your payment workflows smarter and more efficient.
What is the Model Context Protocol (MCP)?
The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
Available Tools
| Tool Name | Description |
|---|---|
| create-payment-link | Generate a new payment link for your customers |
| get-invoice-details | Retrieve comprehensive details for any invoice ID |
| get-transaction-details | Access complete transaction information |
| transactions-list | Get detailed transactions list with advanced filtering options |
| transactions-summary | Retrieve transaction summaries with comprehensive analytics |
| search-refunds-data | Search and filter refund transactions |
| refunds-summary-data | Get refund summaries and analytics |
| settlement-details | Access settlement information and details |
Getting Started
Prerequisites
- Python 3.10 or higher
- PayU Merchant Account with API access
- MCP-compatible AI client (Claude AI, etc.)
Installation
Option 1: Standard Installation
1. Clone the Repository
git clone https://github.com/payu-intrepos/payu-mcp-server.git
cd payu-mcp-server
2. Install Dependencies
We recommend using uv for Python dependency management. Install uv from Astral.
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment and activate it
uv venv
source .venv/bin/activate
# Install dependencies
uv add "mcp[cli]" httpx python-dotenv
Alternatively, you can use pip:
pip install -r requirements.txt
Option 2: Docker Installation
1. Clone the Repository
git clone https://github.com/payu-intrepos/payu-mcp-server.git
cd payu-mcp-server
2. Build Docker Image
docker build -t payu-mcp-server .
3. Run Docker Container
Run the container with your PayU credentials:
docker run -p 8888:8888 \
-e CLIENT_ID="YOUR_CLIENT_ID" \
-e CLIENT_SECRET="YOUR_CLIENT_SECRET" \
-e AUTH_TOKEN="YOUR_BEARER_TOKEN" \
-e MERCHANT_ID="YOUR_MERCHANT_ID" \
-e PORT=8888 \
payu-mcp-server python server.py --sse --port 8888
3. Add Server to MCP Client Configuration
Example for Claude AI Desktop Client:
Location of configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
For Standard Installation:
Add the following to your configuration:
{
"mcpServers": {
"payu-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/payu-mcp-server",
"run",
"server.py"
],
"env": {
"CLIENT_ID": "YOUR_CLIENT_ID",
"CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"AUTH_TOKEN": "YOUR_BEARER_TOKEN",
"MERCHANT_ID": "YOUR_MERCHANT_ID"
}
}
}
}
For Docker Installation:
Configure your MCP client to connect to the Docker container:
{
"mcpServers": {
"payu-mcp-server": {
"url": "http://localhost:8888"
}
}
}
API Credentials
To obtain your API credentials, visit the PayU Developer Portal.
Required credentials:
- CLIENT_ID: Your PayU client ID
- CLIENT_SECRET: Your PayU client secret
- AUTH_TOKEN: Your PayU bearer token (preferred method)
- MERCHANT_ID: Your PayU merchant identifier
Additional Permission Scopes
When configuring your API access, ensure you have the following permission scopes:
-
read_transactions:
- Provides access to transaction history and details
- Allows retrieval of transaction metadata.
- Enables detailed transaction analysis and tracking
-
read_invoices:
- Enables fetching comprehensive invoice details
- Provides access to invoice status, amounts, and related transaction information
- Read-only permission ensures secure access to invoice data
-
read_refunds:
- Access to refund transaction data
- Enables refund status tracking and analytics
-
read_settlements:
- Access to settlement information
- Enables settlement tracking and reporting
Note: Contact PayU support to confirm these specific scopes are available and properly configured for your merchant account.
Usage Examples
Creating a Payment Link
Once configured, your MCP Client can create payment links with a natural language request:
- Payment link with contacts
Create a payment link for ₹5000 for Web Development Services and send to ABC
- Payment link with email
Create a payment link for ₹5000 for Web Development Services and send to <abc@example.com>
Fetching transactions for Invoice Number/Payment Link
Once configured, your AI assistant can help you fetch invoice number details with a natural language request:
Get the invoice details for <Invoice-ID>
Fetching details for any transaction
Once configured, your AI assistant can help you fetch transaction details with a natural language request:
Provide the transaction details for <Transaction-ID>
Get Transactions List
Get transactions list from 2024-01-01 00:00:00 to 2024-01-31 23:59:59 with status captured
Get Transactions Summary
Get transactions summary from 2024-01-01 00:00:00 to 2024-01-31 23:59:59 for UPI payments
Search Refunds
Search refunds from 2024-01-01 to 2024-01-31 with status success
Get Refunds Summary
Get refunds summary from 2024-01-01 to 2024-01-31
Get Settlement Details
Get settlement details for settlement ID <SETTLEMENT_ID>
Advanced Features
Transaction Filtering Options
The enhanced transaction tools support comprehensive filtering:
- Status Filters: captured, failed, pending, cancelled, etc.
- Payment Modes: UPI, CC, DC, NB, EMI, etc.
- Payment Sources: pg, button, paymentLink, apiIntInvoice, etc.
- Amount Ranges: min/max amount filtering
- Currency Filters: USD, AED, AUD, CAD, GBP, OTH
- Date Ranges: Flexible date range queries
- Additional Filters: IVR, mobile, web, chargeback, etc.
Refund Management
- Search refunds by date range and status
- Get refund summaries and analytics
- Support for multiple refund statuses: requested, success, failure, queued, pending, user_cancelled
Settlement Tracking
- Access settlement details by settlement ID
- Support for UTR references and transaction IDs
- Multiple settlement status tracking
License
This project is licensed under the MIT License - see the LICENSE file for details.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。