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.
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
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, you need to set your environment variables in Cursor's mcp.json, which can be found in Cursor Settings > Tools & MCP > New MCP Server.
VS Code users can set environment variables in VS Code's mcp.json, which can be accessed via Command Palette > MCP: Open User Configuration.
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.
There are three ways to expose endpoints as tools in the MCP server:
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 operationsBy specifying --tools=dynamic, the server will expose these tools:
list_api_endpoints - Discovers available endpoints with optional search filteringget_api_endpoint_schema - Gets detailed schema information for specific endpointsinvoke_api_endpoint - Executes endpoints with appropriate parametersThis approach gives full API access without loading all schemas into context at once.
When using --tools=code, the server exposes:
search_docs - Searches API documentation and returns markdown resultsexecute - Runs code against the TypeScript client in a Deno sandboxSpecify 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.
--resource=cards --operation=read
--resource=cards --no-tool=create_cards
--client=cursor --capability=tool-name-length=40
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
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 schemex-dodo-payments-api-key headerA 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
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);
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