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
11.7K downloads
30 stars

Dodo Payments TypeScript MCP Server is a Model Context Protocol server that allows you to interact with the Dodo Payments API through various MCP clients. It provides tools for managing payments, subscriptions, customers, and other payment-related resources in your applications.

Installation Options

Direct Command-Line Installation

You can run the MCP Server directly using npx:

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

Installation via MCP Clients

Generic MCP Client Configuration

For MCP clients that support configuration files, you can add the server with settings like:

{
  "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"
      }
    }
  }
}

Cursor Installation

For Cursor users, set your environment variables in Cursor's mcp.json file, located in Cursor Settings > Tools & MCP > New MCP Server.

VS Code Installation

For VS Code MCP users, you'll need to configure your environment variables in VS Code's mcp.json file, accessed via Command Palette > MCP: Open User Configuration.

Claude Code Installation

For Claude Code users, run the following command in your terminal:

claude mcp add --transport stdio dodopayments_api --env DODO_PAYMENTS_API_KEY="Your DODO_PAYMENTS_API_KEY here." DODO_PAYMENTS_WEBHOOK_KEY="Your DODO_PAYMENTS_WEBHOOK_KEY here." -- npx -y dodopayments-mcp

You'll need to set your environment variables in Claude Code's .claude.json file in your home directory.

Configuring Tool Exposure

Tool Exposure Methods

The MCP server offers three approaches for exposing API endpoints as tools:

1. Individual Endpoint Tools

Expose each API endpoint as a separate tool. You can filter endpoints to avoid overwhelming context windows.

2. Dynamic Tool Discovery

Use --tools=dynamic to expose three meta-tools:

  • list_api_endpoints: Discovers available endpoints with optional filtering
  • get_api_endpoint_schema: Gets schema details for specific endpoints
  • invoke_api_endpoint: Executes endpoints with appropriate parameters

3. Documentation Search and Code Execution

Use --tools=code to expose:

  • search_docs: Searches API documentation
  • execute: Runs code against the TypeScript client

Filtering Endpoints and Tools

Control which tools are exposed using command-line filters:

# Include specific tools by name
--tool=tool_name

# Include tools by resource (supports wildcards)
--resource=cards,accounts
--resource=my.resource*

# Filter by operation type
--operation=read
--operation=write

# Exclude specific tools
--no-tool=create_cards

Client Compatibility Settings

Configure compatibility with specific MCP clients:

# Set compatibility for known clients
--client=openai-agents
--client=claude
--client=claude-code
--client=cursor

# Specify individual capabilities
--capability=top-level-unions
--capability=valid-json
--capability=refs
--capability=unions
--capability=formats
--capability=tool-name-length=40

Running as a Remote Server

Start the server with HTTP transport using:

--transport=http --port=3000

Configure port with --port or use a Unix socket with --socket.

Authentication Options

Authenticate via:

  • Authorization header with Bearer scheme
  • x-dodo-payments-api-key header

Sample client configuration for remote server:

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

You can also pass tool filtering options as URL parameters:

http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
http://localhost:3000?client=cursor&capability=tool-name-length%3D40

Programmatic Usage

Import and initialize 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 });

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

// Or initialize your own server with specific tools
const myServer = new McpServer(...);

// Define your own endpoint
const myCustomEndpoint = {
  tool: {
    name: 'my_custom_tool',
    description: 'My custom tool',
    inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
  },
  handler: async (client: client, args: any) => {
    return { myResponse: 'Hello world!' };
  })
};

// Initialize the server with your custom endpoints
init({ server: myServer, endpoints: [createCheckoutSessions, myCustomEndpoint] });

Available Tools

The server provides access to numerous payment-related resources, including:

Checkout and Payments

  • Create and retrieve checkout sessions
  • Process and manage payments
  • Handle refunds and disputes

Subscription Management

  • Create, retrieve, and update subscriptions
  • Change subscription plans
  • Manage usage-based billing

Customer Management

  • Create and update customer records
  • Manage customer payment methods
  • Access customer portal functionality

Product Management

  • Create and update products
  • Manage product files and images
  • Handle product archiving

Additional Resources

  • License management
  • Discount management
  • Webhook configuration
  • Usage event tracking
  • Metering configuration

Each resource category contains multiple tools for creating, retrieving, updating, and listing the associated resources.

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