Quick Start

Installation Options

1. Direct Installation

Run the MCP Server directly using npx:

# Set your API key
export DODO_PAYMENTS_API_KEY="My Bearer Token"

# Run the server
npx -y dodopayments-mcp

2. MCP Client Integration

For existing MCP clients (listed at modelcontextprotocol.io), configure the server using JSON:

{
  "mcpServers": {
    "dodopayments_api": {
      "command": "npx",
      "args": ["-y", "dodopayments-mcp"],
      "env": {
        "DODO_PAYMENTS_API_KEY": "My Bearer Token"
      }
    }
  }
}

Advanced Usage

Tool Filtering

The MCP Server supports various filtering options to manage tool exposure:

# Include specific tools
--tool <tool_name>

# Filter by resource
--resource <resource_pattern>

# Filter by operation type
--operation <read|write>

# List available tools
--list

# Exclude specific tools
--no-tool <tool_name>

Multiple filters can be combined for precise control.

Programmatic Integration

// Core imports
import { server, endpoints, init } from "dodopayments-mcp/server";

// Individual tool import
import createPayments from "dodopayments-mcp/tools/payments/create-payments";

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

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

// Custom server configuration
const myServer = new McpServer(...);

// Custom endpoint definition
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 with custom configuration
init({ server: myServer, endpoints: [createPayments, myCustomEndpoint] });

Available Tools

Payment Operations

ToolTypeDescription
create_paymentswriteCreate new payments
retrieve_paymentsreadGet payment details
list_paymentsreadList all payments

Subscription Management

ToolTypeDescription
create_subscriptionswriteCreate new subscriptions
retrieve_subscriptionsreadGet subscription details
update_subscriptionswriteUpdate subscription details
list_subscriptionsreadList all subscriptions
charge_subscriptionswriteProcess subscription charges

License Management

ToolTypeDescription
activate_licenseswriteActivate license keys
deactivate_licenseswriteDeactivate license keys
validate_licenseswriteValidate license keys
retrieve_license_keysreadGet license key details
update_license_keyswriteUpdate license key details
list_license_keysreadList all license keys

Customer Management

ToolTypeDescription
create_customerswriteCreate new customers
retrieve_customersreadGet customer details
update_customerswriteUpdate customer details
list_customersreadList all customers
create_customers_customer_portalwriteCreate customer portal sessions

Payment Processing

ToolTypeDescription
create_refundswriteProcess refunds
retrieve_refundsreadGet refund details
list_refundsreadList all refunds
retrieve_disputesreadGet dispute details
list_disputesreadList all disputes
list_payoutsreadList all payouts

Product Management

ToolTypeDescription
create_productswriteCreate new products
retrieve_productsreadGet product details
update_productswriteUpdate product details
list_productsreadList all products
delete_productswriteDelete products
unarchive_productswriteRestore archived products
update_products_imageswriteUpdate product images

Discount Management

ToolTypeDescription
create_discountswriteCreate new discounts (auto-generates code if omitted)
retrieve_discountsreadGet discount details
update_discountswriteUpdate discount details
list_discountsreadList all discounts
delete_discountswriteDelete discounts

Other Operations

ToolTypeDescription
retrieve_webhook_eventsreadGet webhook event details
list_webhook_eventsreadList all webhook events
list_supported_countries_miscreadList supported countries

Security Considerations

  1. API Key Protection

    • Never commit API keys to version control
    • Use environment variables for sensitive data
    • Rotate API keys periodically
  2. Access Control

    • Use tool filtering to limit exposed endpoints
    • Implement proper authentication in custom endpoints
    • Monitor API usage and implement rate limiting

Best Practices

  1. Tool Selection

    • Use filtering to optimize context window usage
    • Group related operations for better organization
    • Document custom tool implementations
  2. Error Handling

    • Implement proper error handling in custom endpoints
    • Log and monitor server operations
    • Provide meaningful error messages
  3. Performance

    • Use pagination for list operations
    • Cache frequently accessed data
    • Optimize custom endpoint implementations

Support

For additional support: