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
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
Quick Start
Set up your environment variables (see Configuration section)
Start the server:
Docker Images
Nix will build the docker image and copy it to the Docker Registry.
Viewing Images
Running Images
Clean Up
Usage with Claude and Other AI Assistants
Juspay Payments MCP
Add the following to your claude_desktop_config.json or equivalent configuration:
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
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:
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:
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/directoryImplements API handlers in
api/directoryExposes 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 |
| Creates a new order in Juspay payment system. |
| Updates an existing order in Juspay. |
| Retrieves the status of a specific Juspay order using its |
| Updates the fulfillment status of a Juspay order. |
Payment Processing
Tool Name | Description |
| Creates a new Juspay session for a given order. |
| Creates an order and processes payment in a single API call. |
| Creates an order with MOTO (Mail Order/Telephone Order) authentication. |
| Initiates a refund for a specific Juspay order using its |
| Initiates a refund based on transaction ID (instead of order ID). |
Customer Management
Tool Name | Description |
| Creates a new customer in Juspay with the provided details. |
| Retrieves customer details using the Juspay customer ID. |
| Updates an existing customer in Juspay with the provided details. |
Card Management
Tool Name | Description |
| Adds a new card to the Juspay system for a customer. |
| Retrieves all stored cards for a specific customer. |
| Deletes a saved card from the Juspay system. |
| Updates details for a saved card. |
| Retrieves information about a specific card BIN (Bank Identification Number). |
| Retrieves a list of eligible BINs for a specific authentication type. |
| Retrieves a customer's saved payment methods. |
UPI Payments
Tool Name | Description |
| Creates a UPI Collect transaction for requesting payment from a UPI ID. |
| Verifies if a UPI Virtual Payment Address (VPA) is valid. |
| Creates a UPI Intent transaction for payment using UPI apps. |
Offers and Wallets
Tool Name | Description |
| Lists available offers for a given order with optional coupon code. |
| Retrieves the status of an order along with offer details. |
| Fetches all wallets linked to the given customer. |
Juspay Dashboard Tools
Gateway Management
Tool Name | Description |
| Gets all configured gateways for the merchant. |
| Provides detailed configuration info for a gateway (fields, payment methods). |
| Returns detailed information about a specific configured gateway ( |
| Returns a list of all available payment gateways that can be configured. |
| Retrieves downtime information for a gateway ( |
| Fetches all gateways and their supported payment methods for the merchant. |
Reporting
Tool Name | Description |
| Returns detailed information for a specific report ID. |
| Lists all reports configured by the merchant. |
| Retrieves orders within a time range (dashboard perspective). |
| Returns complete details for a given order ID (dashboard perspective). |
| Retrieves payment links created within a time range. |
User Management
Tool Name | Description |
| Fetches details for a specific user by user ID. |
| Retrieves a list of users associated with a merchant, with optional pagination. |
Settings Management
Tool Name | Description |
| Retrieves conflict settings configuration for payment processing. |
| Retrieves general configuration settings for the merchant. |
| Retrieves mandate-related settings for recurring payments. |
| Fetches all configured priority logic rules. |
| Provides details of success rate-based routing thresholds. |
| Retrieves webhook configuration settings for the merchant. |
| Returns a list of all configured surcharge rules. |
Advanced Querying
Tool Name | Description |
| 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-featureMake 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
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.