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
7.8K downloads
25 stars

The Dodo Payments MCP Server is a TypeScript implementation of the Model Context Protocol that allows you to expose payment API endpoints as tools for AI clients. It enables AI assistants to interact with payment processing functionality through a standardized protocol.

Installation

Quick Start with npx

You can run the MCP Server directly using npx:

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

Using with an MCP Client

If you're using an existing MCP client, you'll need to configure it to work with the Dodo Payments MCP server. A typical configuration might look 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"
      }
    }
  }
}

Configuring Endpoints

Filtering Endpoints

You can filter which endpoints are exposed as tools to control the size of the context window:

# Only expose read operations for cards
npx -y dodopayments-mcp --resource=cards --operation=read
# Include card and account resources but exclude specific tools
npx -y dodopayments-mcp --resource=cards,accounts --no-tool=create_cards

Using Dynamic Tools

Instead of exposing every API endpoint as an individual tool, you can use dynamic tools mode:

npx -y dodopayments-mcp --tools=dynamic

This exposes three meta-tools:

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

Client Compatibility

Different MCP clients have varying capabilities. Specify your client for best compatibility:

# Configure for Claude
npx -y dodopayments-mcp --client=claude

# Configure for Cursor with custom tool name length
npx -y dodopayments-mcp --client=cursor --capability=tool-name-length=40

Running as HTTP Server

You can run the MCP server over HTTP instead of stdio:

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

This allows remote access with authorization via headers:

Authorization: Bearer <auth value>

or

x-dodo-payments-api-key: <api key value>

The configuration for a client connecting to a remote MCP server would be:

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

You can also pass filtering parameters via URL:

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

Programmatic Usage

For advanced use cases, you can import and use the server programmatically:

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

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

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

// Or manually start server
const transport = new StdioServerTransport();
await server.connect(transport);

Available Tools

The MCP server provides tools for various payment-related operations including:

  • Managing checkout sessions
  • Processing payments
  • Handling subscriptions
  • Managing customers
  • Processing refunds
  • Handling disputes
  • Managing products
  • Working with discounts
  • Processing usage events
  • And many more

Each tool corresponds to a specific API endpoint with appropriate parameters and permissions.

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