Dodo Payments MCP
Dodo Payments TypeScript MCP Server runs code against the TypeScript SDK in a secure sandbox. It offers tools for API documentation search and code execution to perform complex tasks reliably.
How to Install and Use Dodo Payments MCP
Dodo Payments MCP is a tool that helps you connect with the Dodo Payments API easily. Here’s a simple guide on how to install and use it with clear steps and examples.
Step 1: Set Up Your Environment Variables
Before running the MCP server, you need to set up some environment variables. These variables hold your API keys and environment settings, which the MCP server uses to work properly.
Here’s what you need to do:
- Open your terminal or command prompt.
- Run these commands, replacing the text in quotes with your actual keys:
export DODO_PAYMENTS_API_KEY="Your Bearer Token"
export DODO_PAYMENTS_WEBHOOK_KEY="Your Webhook Key"
export DODO_PAYMENTS_ENVIRONMENT="live_mode"
This sets your API key, webhook key, and environment mode.
Step 2: Run the MCP Server Directly
Once your environment variables are ready, you can start the MCP server directly using npx. This runs the server without needing to install it globally.
To do this, enter the following command in your terminal:
npx -y dodopayments-mcp@latest
This command launches the MCP server right away, using the environment variables you set.
Step 3: Use MCP Server with a Client
If you already have an MCP client, you can connect it to the Dodo Payments MCP server by adding a configuration. This configuration tells the client how to start the MCP server with the right settings.
Here’s an example of what the configuration might look like in JSON format:
{
"mcpServers": {
"dodopayments_api": {
"command": "npx",
"args": ["-y", "dodopayments-mcp"],
"env": {
"DODO_PAYMENTS_API_KEY": "Your Bearer Token",
"DODO_PAYMENTS_WEBHOOK_KEY": "Your Webhook Key",
"DODO_PAYMENTS_ENVIRONMENT": "live_mode"
}
}
}
}
This tells your client to run the MCP server with the correct environment variables.
Step 4: Running the MCP Server Remotely
You can also run the MCP server as a remote server using HTTP transport. This means your client connects to the MCP server over the network.
To do this, start the MCP server with the --transport=http flag and specify the port if needed:
npx -y dodopayments-mcp --transport=http --port=3000
Then, your client configuration should include the server URL and authorization header like this:
{
"mcpServers": {
"dodopayments_api": {
"url": "http://localhost:3000",
"headers": {
"Authorization": "Bearer Your Bearer Token"
}
}
}
}
This setup lets your client communicate with the MCP server remotely and securely.
Step 5: Using MCP in Code Mode
Dodo Payments MCP uses a "Code Mode" tool scheme. This means your agent writes code using the TypeScript SDK, which runs safely in a sandbox.
There are two tools your agent can use:
- A docs search tool to find API documentation.
- A code tool to write and run TypeScript code against the SDK.
This setup allows your agent to perform complex tasks reliably.
By following these steps, you can quickly install and use Dodo Payments MCP to connect with the Dodo Payments API. Just set your environment variables, run the server with npx, and configure your client to start working.