Juspay MCP Tools
Enables AI agents to interact with Juspay's payment processing APIs and merchant dashboard for managing orders, transactions, refunds, customers, gateways, and reporting through natural language.
README
Juspay MCP Tools
A Model Context Protocol (MCP) server to interact with Juspay APIs. This package enables AI agents and other tools to leverage Juspay's capabilities for core payment processing and merchant dashboard interactions.
Table of Contents
- Juspay MCP Tools
Introduction
The Juspay MCP (Model Context Protocol) server provides a standardized interface for AI agents and applications to interact with Juspay's payment processing infrastructure and merchant dashboard.
Model Context Protocol is an emerging standard for enabling AI models and agents to interact with external tools and APIs in a structured, discoverable way. This allows AI assistants like Claude to perform complex payment operations and dashboard management tasks through natural language.
Key Features
-
Dual API Coverage: Provides tools for both Juspay's Core Payment APIs and Dashboard APIs.
-
MCP Integration: Enables seamless integration with LLMs and AI agents via the Model Context Protocol.
-
Configurable Modes: Run the server specifically for Core APIs or Dashboard APIs using an environment variable.
Getting Started
Installation
Nix
# 1. Clone the repository
git clone https://github.com/juspay/juspay-mcp.git
cd juspay-mcp
# 2. Installing dependencies and setting up the environment
nix develop
Quick Start
- Set up your environment variables (see Configuration section)
- Start the server:
# With Nix to run the MCP server
nix run
# For standard HTTP server (normally)
python ./juspay_mcp/main.py
# For STDIO mode via nix
nix run .#stdio
# For STDIO mode via nix (standard method)
python ./juspay_mcp/stdio.py
Docker Images
Nix will build the docker image and copy it to the Docker Registry.
# Build main MCP image
nix run .#docker.copyToDockerDaemon
# Build SSE-enabled MCP image
nix run .#docker-sse.copyToDockerDaemon
# Build dashboard MCP image
nix run .#docker-dashboard.copyToDockerDaemon
# Build dashboard SSE-enabled MCP image
nix run .#docker-dashboard-sse.copyToDockerDaemon
Viewing Images
# List all juspay images
docker images | grep juspay
# List all Docker images
docker images
Running Images
# Run main MCP server
docker run -it juspay-mcp:latest
# Run SSE-enabled MCP server
docker run -it juspay-mcp-sse:latest
# Run dashboard MCP server
docker run -it juspay-dashboard-mcp:latest
# Run dashboard SSE-enabled MCP server
docker run -it juspay-dashboard-mcp-sse:latest
# Run with port mapping (example)
docker run -it -p 8080:8080 juspay-mcp-sse:latest
Clean Up
# Remove specific image
docker rmi juspay-mcp:latest
Usage with Claude and Other AI Assistants
Juspay Payments MCP
Add the following to your claude_desktop_config.json or equivalent configuration:
{
"mcpServers": {
"juspay-mcp": {
"command": "docker",
"args": [
"run",
"--pull=always",
"--rm",
"-i",
"-e",
"JUSPAY_API_KEY",
"-e",
"JUSPAY_MERCHANT_ID",
"-e",
"JUSPAY_ENV",
"juspaydotin/juspay-mcp:latest"
],
"env": {
"JUSPAY_API_KEY": "your_juspay_api_key",
"JUSPAY_MERCHANT_ID": "your_juspay_merchant_id",
"JUSPAY_ENV": "sandbox | production"
}
}
}
}
Please replace the your_juspay_api_key and your_juspay_merchant_id with your api key and merchant id.
Default values for JUSPAY_ENV is sandbox.
Juspay Dashboard MCP
{
"mcpServers": {
"juspay-dashboard-mcp": {
"command": "docker",
"args": [
"run",
"--pull=always",
"--rm",
"-i",
"-e",
"JUSPAY_WEB_LOGIN_TOKEN",
"-e",
"JUSPAY_ENV",
"juspaydotin/juspay-dashboard-mcp:latest"
],
"env": {
"JUSPAY_WEB_LOGIN_TOKEN": "your_juspay_web_login_token",
"JUSPAY_ENV": "sandbox | production"
}
}
}
}
Please replace the your_juspay_web_login_token with your dashboard login token.
Configuration
Environment Variables
Create a .env file in the project root or set these variables in your environment:
# --- Required Juspay Credentials for Payments ---
JUSPAY_API_KEY="your_juspay_api_key"
JUSPAY_MERCHANT_ID="your_juspay_merchant_id"
# --- Required Juspay Credentials for Dashboard ---
JUSPAY_WEB_LOGIN_TOKEN="your_juspay_web_login_token"
# --- Required Server Mode ---
# Determines which set of tools the server will expose.
# Options: "CORE" (default), "DASHBOARD"
JUSPAY_MCP_TYPE="CORE"
# --- Optional: Juspay Environment ---
# Set to "production" to use live API endpoints.
# Options: "sandbox" (default), "production"
JUSPAY_ENV="sandbox"
# --- Optional: Include Response Schemas ---
# When set to "true", tool descriptions will include JSON schemas for responses
# Options: "false" (default), "true"
INCLUDE_RESPONSE_SCHEMA="false"
Running Both Core and Dashboard APIs
The server runs either Core or Dashboard tools per instance, controlled by JUSPAY_MCP_TYPE. To access both sets simultaneously, run two separate server instances with different JUSPAY_MCP_TYPE values and ports:
# Terminal 1: Run Core API server
JUSPAY_MCP_TYPE=CORE python main.py --port 8080
# Terminal 2: Run Dashboard API server
JUSPAY_MCP_TYPE=DASHBOARD python main.py --port 8001
Architecture
The Juspay MCP server consists of two primary modules:
-
juspay_mcp: Handles core payment processing functionality including orders, transactions, refunds, customers, cards, UPI, and more.
-
juspay_dashboard_mcp: Provides access to merchant dashboard features like gateway management, reporting, user management, and settings.
Each module:
- Defines API schemas in
api_schema/directory - Implements API handlers in
api/directory - Exposes tools via the tools.py file
- Manages configuration in config.py
The MCP server translates AI assistant requests into properly formatted API calls to Juspay's backend services, handling authentication, request formatting, and response parsing automatically.
Available Tools
Juspay Payments Tools
Order Management
| Tool Name | Description |
|---|---|
create_order_juspay |
Creates a new order in Juspay payment system. |
update_order_juspay |
Updates an existing order in Juspay. |
order_status_api_juspay |
Retrieves the status of a specific Juspay order using its order_id. |
order_fulfillment_sync_juspay |
Updates the fulfillment status of a Juspay order. |
Payment Processing
| Tool Name | Description |
|---|---|
session_api_juspay |
Creates a new Juspay session for a given order. |
create_txn_juspay |
Creates an order and processes payment in a single API call. |
create_moto_txn_juspay |
Creates an order with MOTO (Mail Order/Telephone Order) authentication. |
create_refund_juspay |
Initiates a refund for a specific Juspay order using its order_id. |
create_txn_refund_juspay |
Initiates a refund based on transaction ID (instead of order ID). |
Customer Management
| Tool Name | Description |
|---|---|
create_customer_juspay |
Creates a new customer in Juspay with the provided details. |
get_customer_juspay |
Retrieves customer details using the Juspay customer ID. |
update_customer_juspay |
Updates an existing customer in Juspay with the provided details. |
Card Management
| Tool Name | Description |
|---|---|
add_card_juspay |
Adds a new card to the Juspay system for a customer. |
list_cards_juspay |
Retrieves all stored cards for a specific customer. |
delete_card_juspay |
Deletes a saved card from the Juspay system. |
update_card_juspay |
Updates details for a saved card. |
get_card_info_juspay |
Retrieves information about a specific card BIN (Bank Identification Number). |
get_bin_list_juspay |
Retrieves a list of eligible BINs for a specific authentication type. |
get_saved_payment_methods |
Retrieves a customer's saved payment methods. |
UPI Payments
| Tool Name | Description |
|---|---|
upi_collect |
Creates a UPI Collect transaction for requesting payment from a UPI ID. |
verify_vpa |
Verifies if a UPI Virtual Payment Address (VPA) is valid. |
upi_intent |
Creates a UPI Intent transaction for payment using UPI apps. |
Offers and Wallets
| Tool Name | Description |
|---|---|
list_offers_juspay |
Lists available offers for a given order with optional coupon code. |
get_offer_order_status_juspay |
Retrieves the status of an order along with offer details. |
list_wallets |
Fetches all wallets linked to the given customer. |
Juspay Dashboard Tools
Gateway Management
| Tool Name | Description |
|---|---|
juspay_list_configured_gateway |
Gets all configured gateways for the merchant. |
juspay_get_gateway_scheme |
Provides detailed configuration info for a gateway (fields, payment methods). |
juspay_get_gateway_details |
Returns detailed information about a specific configured gateway (mga_id required). |
juspay_list_gateway_scheme |
Returns a list of all available payment gateways that can be configured. |
juspay_gateway_downtime |
Retrieves downtime information for a gateway (order_id required). |
juspay_get_merchant_gateways_pm_details |
Fetches all gateways and their supported payment methods for the merchant. |
Reporting
| Tool Name | Description |
|---|---|
juspay_report_details |
Returns detailed information for a specific report ID. |
juspay_list_report |
Lists all reports configured by the merchant. |
juspay_list_orders_v4 |
Retrieves orders within a time range (dashboard perspective). |
juspay_get_order_details |
Returns complete details for a given order ID (dashboard perspective). |
juspay_list_payment_links_v1 |
Retrieves payment links created within a time range. |
User Management
| Tool Name | Description |
|---|---|
juspay_get_user |
Fetches details for a specific user by user ID. |
juspay_list_users_v2 |
Retrieves a list of users associated with a merchant, with optional pagination. |
Settings Management
| Tool Name | Description |
|---|---|
juspay_get_conflict_settings |
Retrieves conflict settings configuration for payment processing. |
juspay_get_general_settings |
Retrieves general configuration settings for the merchant. |
juspay_get_mandate_settings |
Retrieves mandate-related settings for recurring payments. |
juspay_get_priority_logic_settings |
Fetches all configured priority logic rules. |
juspay_get_routing_settings |
Provides details of success rate-based routing thresholds. |
juspay_get_webhook_settings |
Retrieves webhook configuration settings for the merchant. |
juspay_list_surcharge_rules |
Returns a list of all configured surcharge rules. |
Advanced Querying
| Tool Name | Description |
|---|---|
q_api |
Generic Query API for various dashboard data domains (refer to q_api.py for details). |
Troubleshooting
Common Issues
-
Authentication Failures
- Ensure your API keys are correct and have appropriate permissions
- Verify you're using the right environment (sandbox/production)
-
Request Validation Errors
- Check that all required fields are present in your request
- Validate format of values (e.g., proper phone number format, valid email)
-
Connection Issues
- Check network connectivity
- Verify firewall settings allow outbound connections to Juspay endpoints
Debugging Tips
-
Inspect the server logs for error messages and request/response details.
-
For MCP communication issues, verify that your AI assistant platform is correctly configured to send and receive MCP-formatted messages.
Contributing
We welcome contributions to the Juspay MCP server! Here's how you can contribute:
-
Fork the repository and create your feature branch
git checkout -b feature/amazing-feature -
Make your changes and ensure they follow our coding standards
- Use type annotations where appropriate
- Add docstrings to new functions and classes
- Follow PEP 8 style guidelines
-
Add tests for any new functionality
-
Submit a pull request with a clear description of the changes and their benefits
Development Environment
Nix
# Enter in the development shell (with all dependencies)
nix develop
# Run tests
nix run .#test
# Run juspay-mcp
nix run
License
This project is licensed under the Apache License 2.0. See the LICENSE file for the full license text.
Copyright 2025 Juspay Technologies Private Limited.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。