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
13.5K downloads
40 stars

The Dodo Payments TypeScript MCP Server is a tool that allows developers to integrate payment processing capabilities using Model Context Protocol. This server provides a standardized way for AI assistants and clients to interact with the Dodo Payments API through various tools and endpoints.

Installation Options

Direct 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

Via MCP Client

If you're using an MCP client, you can configure it to use the Dodo Payments MCP server. The configuration might look similar to:

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

For Cursor Users

For Cursor users, you need to set your environment variables in Cursor's mcp.json, which can be found in Cursor Settings > Tools & MCP > New MCP Server.

For VS Code Users

VS Code users can set environment variables in VS Code's mcp.json, which can be accessed via Command Palette > MCP: Open User Configuration.

For Claude Code Users

If you're using Claude Code, run this 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 in your home directory.

Usage Guide

Tool Exposure Methods

There are three ways to expose endpoints as tools in the MCP server:

  1. One tool per endpoint: Expose individual endpoints and filter as needed
  2. Dynamic tools discovery: Use a set of tools to discover and invoke endpoints dynamically
  3. Docs search and code execution: Allow the client to search documentation and write code against the TypeScript client

Filtering Tools

You can filter the tools that are exposed by the MCP Server using various options:

  • --tool includes specific tools by name
  • --resource includes all tools under specific resources (supports wildcards)
  • --operation filters for read or write operations

Dynamic Tools Option

By specifying --tools=dynamic, the server will expose these tools:

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

This approach gives full API access without loading all schemas into context at once.

Code Execution Option

When using --tools=code, the server exposes:

  • search_docs - Searches API documentation and returns markdown results
  • execute - Runs code against the TypeScript client in a Deno sandbox

Client Compatibility

Specify your MCP client type for better compatibility:

--client=<type>

Valid values include: openai-agents, claude, claude-code, cursor

For additional customization, you can specify individual capabilities:

--capability=<name>

Available capabilities include top-level-unions, valid-json, refs, unions, formats, and tool-name-length=N.

Usage Examples

  1. Filter for read operations on cards:
--resource=cards --operation=read
  1. Exclude specific tools:
--resource=cards --no-tool=create_cards
  1. Configure for Cursor client:
--client=cursor --capability=tool-name-length=40
  1. Complex filtering with multiple criteria:
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards

Running as a Remote Server

Launch with --transport=http to run as a remote server. Use --port to specify the port and --socket for Unix socket support.

Authentication can be provided via:

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

A sample configuration for a server running at http://localhost:3000:

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

Command-line arguments can also be used as query parameters in the URL:

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

Or:

http://localhost:3000?client=cursor&capability=tool-name-length%3D40

Advanced: Importing Tools Individually

For more advanced usage, you can import the server, endpoints, or specific tools directly:

// 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);

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