The Dodo Payments MCP Server provides a Model Context Protocol server for the Dodo Payments API, allowing AI assistants to interact with payment processing functionality through standardized tools.
Run the MCP Server directly using npx with your authentication credentials:
export DODO_PAYMENTS_API_KEY="My Bearer Token"
export DODO_PAYMENTS_ENVIRONMENT="live_mode"
npx -y dodopayments-mcp@latest
If you're using an existing MCP client, you can configure it to use the Dodo Payments MCP server. Your client 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_ENVIRONMENT": "live_mode"
}
}
}
}
The server offers two approaches to expose API endpoints as tools:
You can control which tools are exposed using various filtering options:
# Include only read operations for card resources
--resource=cards --operation=read
# Include card resources but exclude the create_cards tool
--resource=cards --no-tool=create_cards
# Include multiple resources with read operations
--resource=cards,accounts --operation=read
When using --tools=dynamic
, the server exposes these specialized tools:
list_api_endpoints
- Discovers available endpoints with optional filteringget_api_endpoint_schema
- Retrieves detailed schema for a specific endpointinvoke_api_endpoint
- Executes any endpoint with appropriate parametersThis approach prevents context overload while still providing access to the full API.
Specify your MCP client for better compatibility:
# Configure for Claude
--client=claude
# Configure for Cursor with custom tool name length
--client=cursor --capability=tool-name-length=40
Available client types:
openai-agents
claude
claude-code
cursor
Individual capabilities can be enabled:
top-level-unions
valid-json
refs
unions
formats
tool-name-length=N
You can import and use the MCP server and tools in your code:
// Import the server components
import { server, endpoints, init } from "dodopayments-mcp/server";
// Import a specific tool
import createPayments from "dodopayments-mcp/tools/payments/create-payments";
// Initialize with all endpoints
init({ server, endpoints });
// Or start manually
const transport = new StdioServerTransport();
await server.connect(transport);
// Create a custom server with specific tools
const myServer = new McpServer(...);
// Initialize with custom configuration
init({ server: myServer, endpoints: [createPayments, myCustomEndpoint] });
The MCP server provides tools for various payment resources including:
create_payments
retrieve_payments
list_payments
retrieve_line_items_payments
create_subscriptions
retrieve_subscriptions
update_subscriptions
list_subscriptions
change_plan_subscriptions
charge_subscriptions
create_customers
retrieve_customers
update_customers
list_customers
create_customers_customer_portal
create_products
retrieve_products
update_products
list_products
delete_products
unarchive_products
update_products_images
And many more resources including licenses, discounts, refunds, disputes, and payouts.
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.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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.
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.