Overview
The Model Context Protocol (MCP) is an open standard that lets AI applications connect to external data sources and APIs. The Dodo Payments MCP Server gives AI assistants like Claude, Cursor, and other MCP-compatible clients access to your payment infrastructure. The Dodo Payments MCP Server uses Code Mode architecture. Instead of exposing hundreds of individual tools for every API endpoint, Code Mode lets AI agents write and execute TypeScript code against the Dodo Payments SDK in an isolated sandbox.Key Capabilities
- Payment Operations — Create, retrieve, and manage payments and refunds
- Subscription Management — Handle recurring billing, upgrades, and cancellations
- Customer Administration — Manage customer data and portal access
- Product Catalog — Create and update products, pricing, and discounts
- License Management — Activate, validate, and manage software licenses
- Usage-Based Billing — Track and bill for metered usage
How Code Mode Works
The Dodo Payments MCP Server gives your AI agent two tools:- Docs Search Tool — Queries documentation about the Dodo Payments API and SDK to understand available operations and parameters.
- Code Execution Tool — Writes TypeScript code against the SDK that executes in a secure sandbox.
Quick Setup
Connect to the Dodo Payments MCP Server in your AI client:- Agent Plugin (recommended)
- Cursor
- Claude Desktop
- Windsurf
- Claude Code
The Dodo Agent Plugin installs both MCP servers and all seventeen skills in one step for Claude Code, Codex CLI, Cursor, VS Code / GitHub Copilot, Kiro, and OpenCode (OpenCode needs one extra
skills.paths setting). Gemini CLI gets the two MCP servers only, since it has no agent-skill primitive. See the AI Coding Agents guide for per-agent install commands.If your agent isn’t in that list, use the tabs below to configure the MCP server directly.Requires Node.js 18 or higher. The remote server uses OAuth for authentication. On first connection, you’ll be prompted to enter your API key and select your environment.
Dodo Knowledge MCP
In addition to the Dodo Payments MCP Server (for executing API operations), we provide Dodo Knowledge MCP—a semantic search server that gives AI assistants instant access to Dodo Payments documentation.Built with ContextMCP.ai: Dodo Knowledge MCP is powered by ContextMCP, enabling fast semantic search across our documentation using vector embeddings.
What is Dodo Knowledge MCP?
Dodo Knowledge MCP is a remote MCP server that provides semantic documentation search. Find relevant documentation using natural language queries, get accurate up-to-date information about Dodo Payments, and connect with no API keys or local installation required.Quick Setup
Connect to Dodo Knowledge MCP in your AI client:- Cursor
- Claude Desktop
- Windsurf
- Claude Code
Add to
~/.cursor/mcp.json:Requires Node.js 18 or higher. The
mcp-remote package handles the connection to the remote MCP server.Using Both MCP Servers Together
For the best AI-assisted development experience, use both MCP servers:Troubleshooting Knowledge MCP
If you encounter connection issues, clear the MCP authentication cache withrm -rf ~/.mcp-auth, restart your client application, check client logs for error messages, and verify Node.js version (requires 18+).
Knowledge MCP Server
Access the Dodo Knowledge MCP configuration page
Installation
Choose the installation method that fits your workflow.Remote MCP Server (Recommended)
Access the hosted MCP server without local setup or installation.1
Access the remote server
Navigate to https://mcp.dodopayments.com in your browser.
2
Configure your MCP client
Copy the provided JSON configuration for your specific client. For Cursor or Claude Desktop, add this to your MCP settings:
3
Authenticate and configure
The OAuth flow will prompt you to:
- Enter your Dodo Payments API key
- Select your environment (test or live)
- Choose your MCP client type
4
Complete setup
Click Login and Approve to authorize the connection.
Once connected, your AI assistant can interact with the Dodo Payments API on your behalf.
NPM Package
Install and run the MCP server locally.- NPX (No Installation)
- MCP Client Configuration
Docker
Run the MCP server in a container.Docker images tersedia di GitHub Container Registry.
Konfigurasi Klien
Konfigurasikan server MCP Dodo Payments di klien AI pilihan Anda.- Cursor
- Claude Desktop
- Claude Code
- VS Code
- Cline (VS Code)
- Zed
- Other Clients
Siapkan server MCP Dodo Payments di Cursor untuk mengaktifkan akses percakapan ke data pembayaran Anda.Instalasi Sekali KlikGunakan tombol di bawah untuk menginstal server MCP langsung di Cursor:[
](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6IlNldCB5b3VyIERPRE9fUEFZTUVOVFNfQVBJX0tFWSBoZXJlLiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJTZXQgeW91ciBET0RPX1BBWU1FTlRTX1dFQkhPT0tfS0VZIGhlcmUuIn19)Setelah mengeklik, atur environment variables Anda di Cursor’s
mcp.json melalui Cursor Settings > Tools & MCP > New MCP Server.Konfigurasi Manual1
Open Cursor settings
Buka Cursor Settings > Tools & MCP atau tekan
Cmd/Ctrl + Shift + P, lalu cari “MCP Settings”.2
Edit configuration
Klik New MCP Server untuk membuka file
mcp.json.3
Add Dodo Payments configuration
Pilih salah satu konfigurasi berikut:Remote Server (Recommended)Local NPX
4
Save and restart
Simpan file konfigurasi dan mulai ulang Cursor.
Verifikasi koneksi dengan menanyakan data Dodo Payments Anda kepada AI assistant.
Environment Variables
Konfigurasikan perilaku server MCP menggunakan environment variables.Menjalankan dari Jarak Jauh
Deploy server MCP sebagai server HTTP jarak jauh untuk klien berbasis web atau alur kerja agentic.Konfigurasi Remote Server
Setelah di-deploy, klien dapat terhubung menggunakan URL server:Header Authorization
Remote server menerima authentication melalui header berikut:Praktik Terbaik Keamanan
Code Mode menyediakan keamanan bawaan dengan mengeksekusi kode dalam lingkungan sandbox dan menyisipkan API keys di sisi server. Ikuti praktik terbaik berikut untuk melindungi kredensial Anda.API Key Management
API Key Management
Jangan pernah melakukan commit kredensial ke version control. Simpan API keys di environment variables atau sistem pengelolaan secret yang aman:Rotasikan keys secara berkala dengan membuat API keys baru dan mencabut keys lama melalui dashboard Dodo Payments Anda. Selalu gunakan API keys mode test selama pengembangan agar tidak memengaruhi data production.
Access Control
Access Control
Saat melakukan deploy dari jarak jauh, selalu wajibkan authentication melalui header
Authorization atau header x-dodo-payments-api-key.Network Security
Network Security
Selalu deploy remote MCP servers di balik endpoint HTTPS. Lindungi dari penyalahgunaan dengan menerapkan rate limits pada level server MCP dan API. Konfigurasikan firewall rules untuk membatasi klien yang dapat terhubung ke server MCP Anda.
Pemecahan Masalah
Connection issues
Connection issues
Verifikasi bahwa API key Anda telah diatur dengan benar dan memiliki permissions yang diperlukan:Periksa apakah Anda dapat menjangkau endpoint API Dodo Payments. Aktifkan verbose logging di klien MCP Anda untuk mendiagnosis masalah koneksi.
Authentication errors
Authentication errors
Pastikan Anda menggunakan test keys dengan test endpoints dan live keys dengan production endpoints. Verifikasi bahwa
DODO_PAYMENTS_ENVIRONMENT telah diatur dengan benar (live_mode untuk production). Jika masalah berlanjut, buat API key baru melalui dashboard Anda.Tool execution failures
Tool execution failures
Pastikan AI assistant menyediakan parameter yang diformat dengan benar untuk setiap tool. Periksa error response dari API untuk mendapatkan panduan spesifik tentang masalah yang terjadi. Verifikasi bahwa operasi berfungsi saat memanggil API Dodo Payments secara langsung melalui curl atau Postman.
Mengapa Code Mode
Implementasi MCP tradisional mengalami “tool proliferation”, ketika setiap API endpoint diekspos sebagai tool terpisah. Code Mode lebih baik karena beberapa alasan:LLM Lebih Baik dalam Menulis Kode daripada Memanggil Tool
LLM dilatih menggunakan jutaan baris kode dunia nyata, sehingga secara alami dapat menulis script dengan baik. Pemanggilan tool sering kali didasarkan pada contoh sintetis.“Membuat LLM melakukan tugas dengan tool calling seperti mengikutsertakan Shakespeare dalam kelas bahasa Mandarin selama sebulan, lalu memintanya menulis drama dalam bahasa tersebut.” — Cloudflare
Menghilangkan Pembengkakan Context Window
Dalam pendekatan tradisional, setiap definisi tool menggunakan token sebelum percakapan dimulai. Mengekspos lebih dari 50 tool dapat menggunakan 55K–100K+ token. Anthropic menemukan bahwa definisi tool dapat menggunakan hingga 134K token sebelum optimisasi. Code Mode hanya memuat 2 definisi tool (~1K token). Agent mencari dokumentasi sesuai kebutuhan. Tool Search Tool dari Anthropic mempertahankan 95% context window, sehingga mengurangi overhead dari 77K menjadi 8.7K token.Mengurangi Latensi melalui Orkestrasi Programatik
Pemanggilan tool tradisional memerlukan satu putaran penuh inferensi model untuk setiap operasi. Jika suatu tugas memerlukan 20 API calls, berarti ada 20 putaran. Dalam Code Mode, agent menulis satu script yang menjalankan semua panggilan dan hanya mengembalikan hasil akhir. Anthropic mengamati pengurangan token sebesar 37% dan peningkatan akurasi (pengambilan pengetahuan meningkat dari 25.6% menjadi 28.5%) menggunakan pendekatan ini.Lebih Aman berdasarkan Desain
Code Mode menyediakan manfaat keamanan bawaan:- Tanpa API keys dalam parameters — API keys disisipkan di sisi server dan tidak pernah diekspos dalam tool parameters yang dikirim ke LLM.
- Sandbox terisolasi — Kode berjalan di lingkungan yang aman tanpa akses ke network atau host filesystem.
- SDK terkontrol — Hanya metode SDK yang diotorisasi yang tersedia bagi agent.
Dapat Diskalakan ke Ukuran API Apa Pun
Seiring API berkembang, performa MCP tradisional menurun karena lebih banyak tool harus dimuat. Code Mode tetap konstan dengan 2 tool, terlepas dari luas permukaan API. Cloudflare menyederhanakan lebih dari 2.500 API endpoints menjadi 2 tool dan sekitar 1.000 token context.Untuk detail selengkapnya, lihat blog engineering dari Anthropic dan Cloudflare, serta dokumentasi Programmatic Tool Calling dari Claude.
Sumber Daya
API Reference
Jelajahi dokumentasi API Dodo Payments lengkap
MCP Protocol
Pelajari selengkapnya tentang standar Model Context Protocol
GitHub Repository
Lihat source code server MCP dan berkontribusilah
NPM Package
Instal server MCP dari NPM