Dodo Payments MCP server

Provides a lightweight, serverless-compatible interface for AI-driven payment operations like billing, subscriptions, and customer management using the Dodo Payments API.
Back to servers
Setup instructions
Provider
Dodo Payments
Release date
Apr 07, 2025
Language
TypeScript
Package
Stats
9.5K downloads
28 stars

The Dodo Payments MCP Server provides an interface to connect with the Dodo Payments API using the Model Context Protocol. It allows AI agents and applications to interact with payment processing features through structured tools and endpoints.

Installation

Direct Installation

You can run the MCP Server directly via npx with your API credentials:

export DODO_PAYMENTS_API_KEY="My Bearer Token"
export DODO_PAYMENTS_WEBHOOK_KEY="My Webhook Key"
export DODO_PAYMENTS_ENVIRONMENT="live_mode"
npx -y dodopayments-mcp@latest

Via MCP Client

If you're using an existing MCP client, you can add the Dodo Payments MCP server to your configuration. Here's a sample configuration:

{
  "mcpServers": {
    "dodopayments_api": {
      "command": "npx",
      "args": ["-y", "dodopayments-mcp", "--client=claude", "--tools=dynamic"],
      "env": {
        "DODO_PAYMENTS_API_KEY": "My Bearer Token",
        "DODO_PAYMENTS_WEBHOOK_KEY": "My Webhook Key",
        "DODO_PAYMENTS_ENVIRONMENT": "live_mode"
      }
    }
  }
}

Usage

Endpoint Exposure Methods

There are two primary ways to expose API endpoints as tools:

  1. Individual Endpoint Tools: Expose each API endpoint as a separate tool
  2. Dynamic Tools: Use a discovery system that allows AI to find and use endpoints as needed

Filtering Endpoints

You can filter which endpoints are exposed using various command-line options:

# Include only card-related read operations
--resource=cards --operation=read

# Include all card and account resources except create_cards
--resource=cards,accounts --no-tool=create_cards

Using Dynamic Tools

When you specify --tools=dynamic, the server exposes three special tools:

  1. list_api_endpoints - Discovers available endpoints with optional filtering
  2. get_api_endpoint_schema - Gets detailed schema for a specific endpoint
  3. invoke_api_endpoint - Executes endpoints with appropriate parameters

This approach gives you access to the full API while only loading schemas when needed.

Client Compatibility

Different AI clients have varying capabilities for handling tools and schemas. Specify your client type for optimized compatibility:

--client=claude

Available clients include openai-agents, claude, claude-code, and cursor.

You can also set specific capabilities:

--capability=top-level-unions --capability=tool-name-length=40

Running as HTTP Server

For remote access, use the HTTP transport option:

npx -y dodopayments-mcp@latest --transport=http --port=3000

You can then configure your MCP client to connect to this server:

{
  "mcpServers": {
    "dodopayments_api": {
      "url": "http://localhost:3000",
      "headers": {
        "Authorization": "Bearer <auth value>"
      }
    }
  }
}

Filter parameters can be added as query parameters:

http://localhost:3000?resource=cards&no_tool=create_cards

Programmatic Usage

You can also import and use the MCP server in your code:

// Import the server components
import { server, endpoints, init } from "dodopayments-mcp/server";

// Import specific tools
import createCheckoutSessions from "dodopayments-mcp/tools/checkout-sessions/create-checkout-sessions";

// Initialize the server
init({ server, endpoints });

// Start the server
const transport = new StdioServerTransport();
await server.connect(transport);

Available Tools

The MCP server provides access to numerous payment processing tools organized by resource categories:

Checkout Sessions

  • Create checkout sessions

Payments

  • Create, retrieve, and list payments
  • Retrieve payment line items

Subscriptions

  • Create, retrieve, update, and list subscriptions
  • Change subscription plans
  • Charge subscriptions
  • Retrieve usage history

Customers

  • Create, retrieve, update, and list customers
  • Create customer portal sessions
  • Manage customer wallets and ledger entries

Products

  • Create, retrieve, update, and list products
  • Archive and unarchive products
  • Update product files and images

Additional Resources

  • Invoices and refunds
  • Licenses and license keys
  • Disputes and payouts
  • Discounts and addons
  • Brands and webhooks
  • Usage events and meters

Each tool provides a specific function for interacting with the Dodo Payments API, with appropriate input schemas and handlers to process requests and return responses.

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 "dodopayments_api" '{"command":"npx","args":["-y","dodopayments-mcp","--client=claude","--tools=dynamic"],"env":{"DODO_PAYMENTS_API_KEY":"My Bearer Token","DODO_PAYMENTS_ENVIRONMENT":"live_mode"}}'

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": {
        "dodopayments_api": {
            "command": "npx",
            "args": [
                "-y",
                "dodopayments-mcp",
                "--client=claude",
                "--tools=dynamic"
            ],
            "env": {
                "DODO_PAYMENTS_API_KEY": "My Bearer Token",
                "DODO_PAYMENTS_ENVIRONMENT": "live_mode"
            }
        }
    }
}

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": {
        "dodopayments_api": {
            "command": "npx",
            "args": [
                "-y",
                "dodopayments-mcp",
                "--client=claude",
                "--tools=dynamic"
            ],
            "env": {
                "DODO_PAYMENTS_API_KEY": "My Bearer Token",
                "DODO_PAYMENTS_ENVIRONMENT": "live_mode"
            }
        }
    }
}

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