Cashfree MCP server

Integrates with Cashfree's payment processing APIs to enable creating payment links, managing orders, processing refunds, initiating transfers, and verifying identity information
Back to servers
Setup instructions
Provider
Cashfree
Release date
May 17, 2025
Language
JavaScript
Stats
8 stars

Cashfree MCP server enables AI tools and agents to integrate with Cashfree's payment services (Payment Gateway, Payouts, and SecureID) using the Model Context Protocol (MCP). This server acts as a bridge between AI systems and Cashfree's financial APIs, allowing for programmatic access to payment processing capabilities.

Installation

Prerequisites

Before installing, ensure you have Node.js v14.x or higher installed:

node -v
# Should output v14.x or higher

Setup Steps

Clone the Repository

git clone https://github.com/cashfree/cashfree-mcp.git
cd cashfree-mcp

Install Dependencies

npm install

Build the Project

npm run build

This compiles the source files to the dist/ directory, which is required to run the MCP server.

Configuration

The MCP server requires Cashfree API credentials, which can be obtained from your Cashfree account. You can configure the server in different AI client environments:

Required Environment Variables

Payment Gateway:

  • PAYMENTS_APP_ID: Your Payment Gateway client ID
  • PAYMENTS_APP_SECRET: Your Payment Gateway client secret

Payouts:

  • PAYOUTS_APP_ID: Your Payouts client ID
  • PAYOUTS_APP_SECRET: Your Payouts client secret
  • TWO_FA_PUBLIC_KEY_PEM_PATH: Path to your 2FA public key (required only if 2FA is enabled)

SecureID:

  • SECUREID_APP_ID: Your SecureID client ID
  • SECUREID_APP_SECRET: Your SecureID client secret

General Configuration:

  • ENV: Set to production for production environment, sandbox for testing (default: sandbox)
  • TOOLS: Comma-separated list of modules to enable (e.g., pg,payouts,secureid)

Client Configuration Examples

Claude

Add this configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "cashfree": {
      "command": "node",
      "args": ["/path/to/cashfree-mcp/dist/index.js"],
      "env": {
        "PAYMENTS_APP_ID": "YOUR_PG_CLIENT_ID",
        "PAYMENTS_APP_SECRET": "YOUR_PG_CLIENT_SECRET",
        "PAYOUTS_APP_ID": "YOUR_PAYOUTS_CLIENT_ID",
        "PAYOUTS_APP_SECRET": "YOUR_PAYOUTS_CLIENT_SECRET",
        "TWO_FA_PUBLIC_KEY_PEM_PATH": "/path/to/public_key.pem",
        "SECUREID_APP_ID": "YOUR_SECUREID_CLIENT_ID",
        "SECUREID_APP_SECRET": "YOUR_SECUREID_CLIENT_SECRET",
        "TOOLS": "pg,payouts,secureid",
        "ENV": "sandbox"
      }
    }
  }
}

VS Code

Add this configuration to your VS Code settings:

{
  "mcp": {
    "inputs": [],
    "servers": {
      "cashfree": {
        "command": "node",
        "args": ["/path/to/cashfree-mcp/dist/index.js"],
        "env": {
          "PAYMENTS_APP_ID": "YOUR_PG_CLIENT_ID",
          "PAYMENTS_APP_SECRET": "YOUR_PG_CLIENT_SECRET",
          "PAYOUTS_APP_ID": "YOUR_PAYOUTS_CLIENT_ID",
          "PAYOUTS_APP_SECRET": "YOUR_PAYOUTS_CLIENT_SECRET",
          "TWO_FA_PUBLIC_KEY_PEM_PATH": "/path/to/public_key.pem",
          "SECUREID_APP_ID": "YOUR_SECUREID_CLIENT_ID",
          "SECUREID_APP_SECRET": "YOUR_SECUREID_CLIENT_SECRET",
          "TOOLS": "pg,payouts,secureid",
          "ENV": "sandbox"
        }
      }
    }
  }
}

Available Tools

The Cashfree MCP server provides access to various payment processing functions through different tools:

Payment Gateway (PG) Tools

  • create-payment-link: Create a new payment link
  • fetch-payment-link-details: View all details and status of a payment link
  • cancel-payment-link: Cancel an active payment link
  • get-orders-for-a-payment-link: View all order details for a payment link
  • create-order: Create orders with Cashfree to get a payment_sessions_id
  • get-order: Fetch order details using order_id
  • get-eligible-payment-methods: Get eligible payment methods for an order
  • get-payments-for-an-order: View all payment details for an order
  • create-refund: Initiate refunds
  • get-refund: Fetch a specific refund
  • get-all-settlements: Get all settlement details
  • simulate-payment: Simulate payment for testing

Payouts Tools

  • standard-transfer-v2: Initiate an amount transfer
  • get-transfer-status-v2: Get the status of an initiated transfer
  • batch-transfer-v2: Initiate a batch transfer request
  • get-batch-transfer-status-v2: Get status of a batch transfer
  • authorize: Authenticate with the Cashfree system
  • create-cashgram: Create a Cashgram
  • deactivate-cashgram: Deactivate a Cashgram

SecureID Tools

  • verify-name-match: Verify names with variations
  • generate-kyc-link: Generate a verification form for KYC information
  • get-kyc-link-status: Get the status of a KYC verification form
  • generate-static-kyc-link: Generate a static KYC link
  • deactivate-static-kyc-link: Deactivate a static KYC link

For detailed API documentation, visit the Cashfree API Documentation.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "cashfree" '{"command":"node","args":["/path/to/cashfree-mcp/src/index.js"],"env":{"PAYMENTS_APP_ID":"YOUR_PG_CLIENT_ID","PAYMENTS_APP_SECRET":"YOUR_PG_CLIENT_SECRET","PAYOUTS_APP_ID":"YOUR_PAYOUTS_CLIENT_ID","PAYOUTS_APP_SECRET":"YOUR_PAYOUTS_CLIENT_SECRET","TWO_FA_PUBLIC_KEY_PEM_PATH":"/path/to/public_key.pem","SECUREID_APP_ID":"YOUR_SECUREID_CLIENT_ID","SECUREID_APP_SECRET":"YOUR_SECUREID_CLIENT_SECRET","TOOLS":"pg,payouts,secureid","ENV":"sandbox"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cashfree": {
            "command": "node",
            "args": [
                "/path/to/cashfree-mcp/src/index.js"
            ],
            "env": {
                "PAYMENTS_APP_ID": "YOUR_PG_CLIENT_ID",
                "PAYMENTS_APP_SECRET": "YOUR_PG_CLIENT_SECRET",
                "PAYOUTS_APP_ID": "YOUR_PAYOUTS_CLIENT_ID",
                "PAYOUTS_APP_SECRET": "YOUR_PAYOUTS_CLIENT_SECRET",
                "TWO_FA_PUBLIC_KEY_PEM_PATH": "/path/to/public_key.pem",
                "SECUREID_APP_ID": "YOUR_SECUREID_CLIENT_ID",
                "SECUREID_APP_SECRET": "YOUR_SECUREID_CLIENT_SECRET",
                "TOOLS": "pg,payouts,secureid",
                "ENV": "sandbox"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "cashfree": {
            "command": "node",
            "args": [
                "/path/to/cashfree-mcp/src/index.js"
            ],
            "env": {
                "PAYMENTS_APP_ID": "YOUR_PG_CLIENT_ID",
                "PAYMENTS_APP_SECRET": "YOUR_PG_CLIENT_SECRET",
                "PAYOUTS_APP_ID": "YOUR_PAYOUTS_CLIENT_ID",
                "PAYOUTS_APP_SECRET": "YOUR_PAYOUTS_CLIENT_SECRET",
                "TWO_FA_PUBLIC_KEY_PEM_PATH": "/path/to/public_key.pem",
                "SECUREID_APP_ID": "YOUR_SECUREID_CLIENT_ID",
                "SECUREID_APP_SECRET": "YOUR_SECUREID_CLIENT_SECRET",
                "TOOLS": "pg,payouts,secureid",
                "ENV": "sandbox"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later