Cashfree MCP server enables AI tools and agents to integrate with Cashfree APIs (Payment Gateway, Payouts, and SecureID) using the Model Context Protocol (MCP). This server acts as a bridge between your AI applications and Cashfree's financial services infrastructure.
Before installing, ensure you have Node.js v14.x or higher installed on your system:
node -v
# Should output v14.x or higher
Clone the repository and install dependencies:
git clone https://github.com/cashfree/cashfree-mcp.git
cd cashfree-mcp
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.
You'll need a Cashfree account with API credentials to use the MCP server. Both sandbox and production environments are supported.
Configure the following environment variables:
Payment Gateway:
PAYMENTS_APP_ID: Your Payment Gateway client IDPAYMENTS_APP_SECRET: Your Payment Gateway client secretPayouts:
PAYOUTS_APP_ID: Your Payouts client IDPAYOUTS_APP_SECRET: Your Payouts client secretTWO_FA_PUBLIC_KEY_PEM_PATH: Path to your 2FA public key (required only if 2FA is enabled)SecureID:
SECUREID_APP_ID: Your SecureID client IDSECUREID_APP_SECRET: Your SecureID client secretGeneral Configuration:
ENV: Set to production for production environment, sandbox for sandbox (default: sandbox)TOOLS: Comma-separated list of modules to enable (pg,payouts,secureid)ELICITATION_ENABLED: Set to true to enable interactive parameter elicitation (default: false)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",
"ELICITATION_ENABLED": "true"
}
}
}
}
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",
"ELICITATION_ENABLED": "true"
}
}
}
}
}
For detailed API documentation, visit the Cashfree API Documentation.
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.
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.
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"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. 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