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.
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
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"
}
}
}
}
For Cursor users, set your environment variables in Cursor's mcp.json file, located in Cursor Settings > Tools & MCP > New MCP Server.
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.
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.
The MCP server offers three approaches for exposing API endpoints as tools:
Expose each API endpoint as a separate tool. You can filter endpoints to avoid overwhelming context windows.
Use --tools=dynamic to expose three meta-tools:
list_api_endpoints: Discovers available endpoints with optional filteringget_api_endpoint_schema: Gets schema details for specific endpointsinvoke_api_endpoint: Executes endpoints with appropriate parametersUse --tools=code to expose:
search_docs: Searches API documentationexecute: Runs code against the TypeScript clientControl 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
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
Start the server with HTTP transport using:
--transport=http --port=3000
Configure port with --port or use a Unix socket with --socket.
Authenticate via:
x-dodo-payments-api-key headerSample 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
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] });
The server provides access to numerous payment-related resources, including:
Each resource category contains multiple tools for creating, retrieving, updating, and listing the associated resources.
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.json2. 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