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.
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
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"
}
}
}
}
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
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:
list_api_endpoints
- Discovers available endpointsget_api_endpoint_schema
- Gets detailed schema for specific endpointsinvoke_api_endpoint
- Executes endpoints with appropriate parametersDifferent 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
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
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);
The MCP server provides tools for various payment-related operations including:
Each tool corresponds to a specific API endpoint with appropriate parameters and permissions.
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.
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 > 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"
}
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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