Enable AI assistants to interact with the Dodo Payments API through the Model Context Protocol (MCP) for seamless payment operations, subscription management, and customer interactions.
The Model Context Protocol (MCP) is an open standard that enables AI applications to securely connect to external data sources and APIs. The Dodo Payments MCP Server provides AI assistants like Claude, Cursor, and other MCP-compatible clients with structured access to your payment infrastructure.
Run the MCP server in a containerized environment for consistent deployment.
Copy
Ask AI
# Pull the latest imagedocker pull ghcr.io/dodopayments/mcp:latest# Run the containerdocker run -e DODO_PAYMENTS_API_KEY="dodo_test_..." \ -p 3000:3000 \ ghcr.io/dodopayments/mcp:latest
# Include only specific toolsnpx dodopayments-mcp --tool=create_payments --tool=list_payments# Exclude specific toolsnpx dodopayments-mcp --no-tool=delete_products# List all available toolsnpx dodopayments-mcp --list
Build custom MCP servers or extend the existing one programmatically.
Copy
Ask AI
import { server, endpoints, init } from "dodopayments-mcp/server";import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";// Initialize with all default endpointsinit({ server, endpoints });// Start the serverconst transport = new StdioServerTransport();await server.connect(transport);
Protect your API credentials and maintain secure integrations.
API Key Management
Never commit credentials to version controlStore API keys in environment variables or secure secret management systems.
Copy
Ask AI
# Use environment variablesexport DODO_PAYMENTS_API_KEY="dodo_test_..."# Use a .env file (add to .gitignore)echo "DODO_PAYMENTS_API_KEY=dodo_test_..." > .env
Rotate keys regularlyGenerate new API keys periodically and revoke old ones through your Dodo Payments dashboard.Use test keys for developmentAlways use test mode API keys during development to avoid affecting production data.
Access Control
Apply tool filtering in productionLimit exposed operations to only what your AI assistant needs.
Copy
Ask AI
# Production: read-only accessnpx dodopayments-mcp --operation=read# Development: full accessnpx dodopayments-mcp
Implement authentication for custom endpointsValidate requests and enforce authorization in your custom tool handlers.Monitor API usageTrack MCP server activity through your Dodo Payments dashboard and set up alerts for unusual patterns.
Network Security
Use HTTPS for remote serversAlways deploy remote MCP servers behind HTTPS endpoints.Implement rate limitingProtect against abuse by implementing rate limits at both the MCP server and API levels.Restrict network accessConfigure firewall rules to limit which clients can connect to your MCP server.
Verify your API keyEnsure your API key is correctly set and has the necessary permissions.
Copy
Ask AI
# Test your API keycurl -H "Authorization: Bearer dodo_test_..." \ https://api.dodopayments.com/payments
Check your network connectionVerify you can reach the Dodo Payments API endpoints.Review client logsEnable verbose logging in your MCP client to diagnose connection problems.
Authentication errors
Confirm API key environmentEnsure you’re using test keys with test endpoints and live keys with production endpoints.Check key permissionsVerify your API key has permissions for the operations you’re attempting.Regenerate credentialsIf issues persist, generate a new API key through your dashboard.
Tool execution failures
Validate input parametersEnsure the AI assistant is providing correctly formatted parameters for each tool.Review error messagesCheck the error response from the API for specific guidance on what went wrong.Test with API directlyVerify the operation works when calling the Dodo Payments API directly via curl or Postman.