Setu UPI Deeplinks MCP server

Integrates Setu's UPI payment infrastructure to enable seamless generation and management of payment links for applications.
Back to servers
Provider
Setu
Release date
Jan 23, 2025
Language
Python
Package
Stats
2 stars

This MCP server enables Claude to generate and manage UPI payment deeplinks through Setu's payment infrastructure. It provides tools for creating payment links, checking payment status, and processing refunds.

Installation

To use the Setu UPI Deeplinks MCP server, you need to install the package using pip:

pip install setu_mcp_upi_deeplinks

Or using uv:

uv pip install setu_mcp_upi_deeplinks

Configuration

Setting Up Environment Variables

The server requires the following environment variables to connect to Setu's API:

UPI_DEEPLINKS_SCHEME_ID=your-scheme-id
UPI_DEEPLINKS_SECRET=your-secret
UPI_DEEPLINKS_PRODUCT_INSTANCE_ID=your-product-instance-id
SETU_AUTH_TYPE=OAUTH  # Optional, defaults to OAUTH
SETU_MODE=SANDBOX     # Optional, defaults to SANDBOX

Configuring Claude Desktop

To integrate this MCP server with Claude Desktop, you need to modify the Claude configuration file:

MacOS:

~/Library/Application\ Support/Claude/claude_desktop_config.json

Windows:

%APPDATA%/Claude/claude_desktop_config.json

Add the following configuration to the JSON file:

{
  "mcpServers": {
    "setu_mcp_upi_deeplinks": {
      "command": "uvx",
      "args": [
        "setu_mcp_upi_deeplinks"
      ],
      "env": {
        "UPI_DEEPLINKS_SCHEME_ID": "your-scheme-id",
        "UPI_DEEPLINKS_SECRET": "your-secret",
        "UPI_DEEPLINKS_PRODUCT_INSTANCE_ID": "your-product-instance-id"
      }
    }
  }
}

Using the MCP Server

Available Payment Tools

The server provides five main tools for payment management:

Creating Payment Links

Use the create-payment-link tool to generate a new UPI payment link:

Required inputs:

  • amount: Payment amount in paise
  • bill_id: Unique identifier for the payment
  • payee_name: Name of the recipient

Optional input:

  • note: Transaction description or note

Example usage with Claude:

I need to create a UPI payment link for Rs. 1000 with the bill ID "INV12345" for "John Doe".

Checking Payment Status

Use the check-payment-status tool to verify a payment's status:

Required input:

  • bill_id: The bill ID of the payment

Example usage with Claude:

Can you check the status of payment with bill ID "INV12345"?

Expiring Payment Links

Use the expire-payment tool to invalidate an existing payment link:

Required input:

  • bill_id: The bill ID of the payment to expire

Example usage with Claude:

Please expire the payment link for bill ID "INV12345".

Initiating Refunds

Use the initiate-refund tool to process a refund:

Required inputs:

  • bill_id: The bill ID of the payment
  • refund_type: Type of refund ("FULL" or "PARTIAL")

Example usage with Claude:

I need to initiate a full refund for the payment with bill ID "INV12345".

Simulating Payments (Sandbox Only)

For testing in sandbox mode, use the mock-payment tool:

Required inputs:

  • bill_id: The bill ID of the payment
  • upi_id: The UPI ID for the payee
  • amount: Amount to be paid in Rupees

Example usage with Claude:

Can you simulate a payment of Rs. 1000 for bill ID "INV12345" using UPI ID "example@upi"?

Troubleshooting

If you encounter issues with the MCP server, check that:

  • All required environment variables are correctly set
  • You have proper network connectivity to Setu's API
  • Your Setu credentials are valid and have the appropriate permissions
  • You're using the correct bill IDs when referencing payments

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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