Cashfree MCP Server: Payments, Payouts, SecureID
Integrate AI tools with Cashfree MCP server to access Payment Gateway, Payouts, and SecureID via the Model Context Protocol (MCP).
npx -y @cashfree/cashfree-mcpOverview
Cashfree MCP Server exposes Cashfree services (Payment Gateway, Payouts, and SecureID) to AI tools and agents using the Model Context Protocol (MCP). It runs as a local MCP server process and translates MCP tool calls into authenticated Cashfree API requests, enabling AI assistants to initiate payments, manage payouts, and perform identity checks from within an agent workflow.
For developers building conversational agents or tool-enabled assistants, this server removes the friction of wrapping multiple Cashfree APIs manually. It centralizes credential handling, environment switching (sandbox vs production), and optional interactive parameter elicitation so tools can either validate inputs programmatically or ask the user for missing values at runtime.
Features
- Exposes Payment Gateway (PG), Payouts, and SecureID APIs over MCP
- Supports sandbox and production environments via ENV variable
- Configurable tool set: enable only the modules you need (pg, payouts, secureid)
- Optional interactive elicitation for missing required parameters
- Two-factor support for payouts (TWO_FA public key path)
- Small Node.js-based MCP server suitable for local or containerized deployment
- Ready-made configuration examples for MCP clients (Claude, VS Code)
Installation / Configuration
Prerequisites:
- Node.js v14.x or higher (Node >= 20.18.1 recommended to avoid peer dependency issues)
Clone and build:
Run the MCP server (example):
# from repository root after build
Environment variables (examples):
# "sandbox" or "production"
# comma-separated modules to enable
# Payment Gateway
# Payouts
# only if 2FA enabled
# SecureID
# Optional: enable interactive elicitation of missing params
MCP client examples (Claude / VS Code) — point the client to run the server process:
Claude (fragment to add to claude_desktop_config.json):
VS Code (settings.json fragment):
Available Tools
Payment Gateway (pg), Payouts (payouts), SecureID (secureid) — enable via TOOLS env var.
Payment Gateway tools (examples):
| Tool name | Description |
|---|---|
| search | Search Cashfree Payments developer docs |
| get-input-source-help | Help for input source variable errors |
| create-payment-link | Create a new payment link |
| fetch-payment-link-details | Get payment link details and status |
| cancel-payment-link | Cancel an active payment link |
| get-orders-for-a-payment-link | List orders for a payment link |
| create-order | Create an order to obtain a payment_sessions_id |
Payouts and SecureID expose their common API actions (create/verify payouts, identity verification flows). When 2FA is required for payouts, set TWO_FA_PUBLIC_KEY_PEM_PATH.
Use Cases
Create a payment link from a chat assistant:
- Agent calls create-payment-link with amount, purpose, and customer info.
- Server returns a payment URL and link id; assistant shares the URL with user.
Collect payment session for a checkout flow:
- Agent calls create-order to generate a payment_sessions_id.
- Use the returned id to open a hosted checkout or continue a payments integration.
Automate vendor payouts:
- Agent triggers a payout action (payouts.create).
- MCP server signs and routes the payout API call; assistant reports success/failure.
Onboard and verify user identity:
- Use SecureID flows to request verification documents or checks.
- Agent can poll or receive the result via MCP tool responses.
Security & Best Practices
- Keep credentials out of version control; use environment variables or secrets management.
- Use sandbox ENV during development and switch to production only after thorough testing.
- Secure TWO_FA public key files and restrict filesystem permissions.
- If enabling elicitation, ensure the agent only prompts for sensitive values in a secure UI.
Repository and issues: https://github.com/cashfree/cashfree-mcp
Tags: finance