DOKU MCP Server

Set up DOKU MCP server to integrate DOKU APIs with your AI tools

Learn more about DOKU MCP Server use cases here

This guide provides end-to-end instructions for integrating with the DOKU MCP Server, covering system requirements, a step-by-step integration process, and detailed documentation of all available tools. Each tool is described by its purpose, recommended use cases, and relevance to common payment flows.

Requirements

Before you start, make sure you fulfill the following requirements:

  1. Become a DOKU Merchant (follow the guide here)

  2. Prepare an AI assistant (e.g. Visual Studio Code, Claude, or any AI assistant of your choice)


Integration Guide

The steps below explain how to connect your AI assistant or agent environment to the DOKU MCP Server.

Step 1: Generate API Keys

Please contact our team to retrieve your credentials by filling the form here.

Be sure to select "Payment Integration via MCP Server (AI Agents)" in the list of services you are interested in using.

Step 2: Encode API Keys

After receiving your API key, you must convert it to Base64 format for use in the MCP Authorization header. Run the following command:

Important Note:

  1. Do not remove the : separator.

  2. Save the encoded string as you’ll use it in the next step.

Step 3: Configure Your AI Assistant

Once you have your Base64-encoded token, configure your AI assistant or agent framework to connect to the DOKU MCP Server.

You can integrate using any of the following supported environments:

  1. Visual Studio Code (MCP Extension)

  2. Claude Code / Claude Desktop

  3. n8n

  4. Python Library (MCP Client SDK)

    • LangChain

    • StrandsAgent

  5. Javascript Library (MCP Client SDK)

    • LangChain

Each platform requires you to insert your Base64-encoded credentials and specify the MCP Server endpoint. Refer to the individual setup guides for platform-specific configuration steps.

Visual Studio Code
  1. Visual Studio Code

  2. Open Command Palette and type MCP: Open User Configuration

  3. Paste the following configuration:

  1. Replace {doku-client-id} and {base64-encoded-token} with your values.

  2. Verify by opening Command Palette → MCP: Show Installed Servers → select doku-mcp-server. If successful, you’ll see logs confirming the connection and available tools.

  3. Restart your AI assistant app. In the chat window, switch to Agent Mode, then ask:

Show me the available DOKU tools

If connected, the server will list all MCP tools (e.g., checkout, payment link, QRIS). You can then try calling a tool such as checkout to confirm everything works.

Claude Code / Claude Desktop

Claude Code supports two integration methods:

  1. Claude CLI

    • Recommended for direct MCP connections

  2. Claude Desktop App

    • Requires a proxy because custom headers are not yet supported


Claude CLI

Claude CLI supports MCP servers over HTTP and allows sending custom headers, making it the simplest way to connect to DOKU MCP Server.

Run the following command in your terminal:

This command does the following actions:

  • Registers a new MCP server named doku-mcp-server

  • Connects via HTTP transport

  • Sends the required authentication headers:

    • Client-Id

    • Authorization: Basic <base64-encoded-api-key:>

After running the command, Claude CLI will automatically load and list the available DOKU MCP tools.


Claude Desktop

Claude Desktop App currently does not support custom HTTP headers for MCP connections. Since the DOKU MCP Server requires headers for authentication, you must use a small Node.js proxy that:

  • Connects to DOKU MCP Server over HTTP

  • Injects the required headers

  • Exposes the MCP server to Claude Desktop using STDIO protocol

Step 1: Clone DOKU MCP Proxy

Clone the proxy package from the following repository:

GitHub: https://github.com/PTNUSASATUINTIARTHA-DOKU/doku-mcp-proxy

After downloading, unzip the folder to any directory of your choice.


Step 2: Configure the Proxy

Open the file: doku-mcp-proxy/index.js

Update the configuration block with your credentials:

Make sure your Authorization value is the Base64-encoded <api-key>: string.


Step 3: Install Dependencies

Go to the proxy folder and run:

This installs the MCP proxy runtime dependencies.


Step 4: Configure Claude Desktop

  1. Open Claude Desktop

  2. Go to Settings → Developer → Edit Config

  3. This opens the file: claude_desktop_config.json

Replace or add the following configuration:

Notes:

  • Replace "/your-node-path/bin/node" with your actual Node.js binary path (For macOS with nvm it's something like /Users/<user>/.nvm/versions/node/v18.x.x/bin/node)

  • Replace the project path with where you extracted the proxy


Step 5: Restart Claude Desktop

After restarting:

  • Go to Settings → Developer → MCP Servers

  • You should now see doku-mcp-local listed

  • Claude Desktop will automatically load DOKU MCP tools

If everything is configured properly, you can now call DOKU MCP tools directly inside Claude Desktop.

n8n

With n8n, you can integrate the DOKU MCP Server and expose your AI-powered agent through:

  1. Web Browser / API (via n8n workflow trigger)

  2. WhatsApp (using WhatsApp Business Cloud and n8n)

Both approaches allow your AI agent to call DOKU MCP tools directly from n8n workflows.


Web Browser / API

  1. Go to SettingsCommunity Nodes (requires Admin role)

  2. Click Install

  3. Enter n8n-nodes-doku-mcp-client in the NPM Package Name field

  4. Agree to the terms and conditions, and then click Install

  5. Check that n8n-nodes-doku-mcp-client has been successfully installed

  1. Create your workflow using a Chat Trigger, AI Agent, and an LLM already integrated with n8n

  1. Open the Tools panel and select DOKU MCP Client Tool

  2. Fill in all the required form fields

    1. Server Transport: HTTP Streamable

    2. Client ID: Your DOKU Client ID (BRN-xxxxx)

    3. API Key: Your DOKU API Key (api_key_xxxx)

    4. Tools to Include: Default is All, or you may specify only the DOKU MCP tools the agent should use

Once saved, your n8n workflow is fully connected to the DOKU MCP Server.


WhatsApp

Step 1: Configure the WhatsApp Trigger Node

  1. Add a WhatsApp Business Cloud Trigger node

    • Search “WhatsApp” in the node list

  2. Set the Trigger Event to On messages

  3. Create the required credentials (first-time setup):

This node will fire whenever a new WhatsApp message is received.


Step 2: Configure the AI Agent Node

  1. Add an AI Agent node and connect it after the WhatsApp Trigger

  2. Set the prompt source to use the incoming message:

    • Change Prompt (User Message) → Source to Expression

    • Set the value to:

This extracts the user’s message from the WhatsApp webhook payload.


Step 3: Add a Simple Memory Node

This node allows the AI agent to remember previous messages in the same conversation.

  1. Add a Simple Memory node

  2. Connect it between the WhatsApp Trigger and AI Agent (or wherever memory is needed)

  3. Set Session ID to uniquely identify each WhatsApp user:

  4. (Optional) Adjust Context Window Length

    • Default: 5

    • Controls how many previous turns the AI agent will remember


Step 4: Configure the WhatsApp Send Message Node

This node sends the AI-generated reply back to the user

  1. Add a WhatsApp → Send Message node

  2. Create or select the required credentials:

  3. Configure the message:

Setting
Value

Resource

Message

Operation

Send

Recipient Phone Number

Expression: {{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}

Text Body

Expression: {{ $json.output }} (content generated by the AI Agent)

Python Library

DOKU MCP Server can be integrated with Python using:

  1. LangChain

  2. StrandsAgent

Both approaches allow you to load DOKU MCP tools dynamically and let your LLM call them during reasoning.


Langchain

Step 1: Create requirements.txt


2. Create .env

Notes: DOKU_AUTHORIZATION must include the trailing colon (:) before Base64 encoding.


Step 3: Create main.py


Step 4: Run Application

  1. Install Python 3.11

  1. Create Virtual Environment

  1. Install Dependencies

  1. Run FastAPI App


Step 5: Test Using curl


StrandsAgent

Step 1: Create requirements.txt


Step 2: Create .env


Step 3: Create main.py


Step 4: Run Application


Step 5: Test with curl

Javascript Library

DOKU MCP Server can be integrated with Javascript (JS) using LangChain.


Langchain

Step 1: Create package.json

This project requires Node.js 18+ because LangChain uses native fetch and modern ESM.


Step 2: Create .env

Notes:

  • DOKU_AUTHORIZATION must be the Base64-encoded <api-key>: value (including the trailing colon before encoding).

  • Never commit .env to source control.


Step 3: Create server.js


Tools

DOKU MCP server comes equipped with over 30 powerful tools, designed to handle every stage of the payment process:

Checkout Payment

No.
Tool Name
Description
Use Case

1

create_payment_link

Generate a payment link that can be used to accept payments without determining customer data

Customer inputting data (e.g. name, email, etc.) before proceeding to check out and selecting payment methods

2

create_checkout_link

Generate a checkout link that can be used to accept payments with customer data specified

Customer selecting payment methods and checking out immediately

Examples

  1. Payment Link

Tool: create_payment_link
  1. Checkout

Tool: create_checkout_link

Direct Payment

No.
Tool Name
Description
Use Case

3

get_merchant_payment_methods

Retrieve a list of all payment methods activated for your merchant account

Checking which banks, cards, or wallets are active

4

generate_payment_virtual_account

Generate a Virtual Account number for bank transfer

Completing payments made via VA BCA

5

update_payment_virtual_acccount

Modify details of an existing Virtual Account

Extending deadline for an unpaid VA

6

delete_payment_virtual_account

Close or disable payment of an existing VA

Cancelling an unused VA number

7

generate_payment_qris

Generate a QRIS code for direct payments

Completing payments made via QRIS

8

generate_payment_card_auth

Perform 3D Secure (3DS) authentication for credit/debit cards requiring additional verification

When the card issuer mandates 3DS before charging

9

generate_payment_card_capture

Capture a previously authorized card transaction to complete the payment

For 2-step card flows where authorization and capture are separate

10

generate_payment_card_charge

Charge a card transaction after successful 3DS authentication

Complete payment after card_auth returns a valid 3DS ID

11

generate_payment_ovo_auth

Authenticate an OVO account before payment

Required step before processing an OVO transaction

12

generate_payment_ovo

Generate an OVO e-Wallet payment using the authCode from OVO e-Wallet authentication

Charge customers who choose OVO as a payment method

13

generate_payment_doku_ewallet_auth

Authenticate or bind a DOKU e-Wallet account before payment

Registering a DOKU e-Wallet user for future transactions

14

generate_payment_doku_ewallet

Charge a DOKU e-Wallet account after successful authentication

Completing payments made via DOKU e-Wallet

15

generate_payment_dana

Generate a DANA e-Wallet payment

Completing payments made via DANA

16

generate_payment_shopeepay

Generate a ShopeePay e-Wallet payment

Completing payments made via ShopeePay

17

generate_payment_akulaku

Generate an Akulaku PayLater or installment transaction

Completing payments made via Akulaku

18

generate_payment_kredivo

Generate a Kredivo PayLater or installment transaction

Completing payments made via Kredivo

19

generate_payment_alfagroup

Generate a payment code for cash payments at Alfamart/Alfamidi outlets

Completing payments on the counter at Alfa Group outlets

20

generate_payment_indomaret

Generate a payment code for cash payments at Indomaret outlets

Completing payments on the counter at Indomaret outlets

Examples

  1. Show Payment Methods

Tool: get_merchant_payment_methods
  1. Virtual Account Payment

Tool: generate_payment_virtual_account

Transaction Utility

No.
Tool Name
Description
Use Case

21

get_transaction_by_invoice_number

Retrieve the transaction details such as status, amount, and payment method used based on the invoice number

Tracking if an order has been paid

22

get_transaction_by_customer_name

Retrieve the transaction details such as status, amount, and payment method used based on the customer name

Viewing all orders from a particular customer

23

get_transaction_by_date_range

Retrieve the transaction details such as status, amount, and payment method used within a specified start and end date

Monthly reconciliation for accounting

Customer Utility

No.
Tool Name
Description
Use Case

24

add_customer

Create a new customer with details like name, email, and phone

Registering a new buyer before issuing an invoice

25

update_customer

Update existing customer details (e.g., phone, email)

Correcting customer contact info

26

delete_customer

Remove a customer from your records.

Cleaning inactive or duplicate customer data

27

get_customer_by_id

Retrieve customer details using their unique customer ID

Checking details of a returning customer

28

get_customer_by_name

Retrieve customer details using the customer’s full name or partial name

Finding a repeat customer without knowing their ID

29

get_customer_by_email

Retrieve customer details using the customer’s registered email address

Identifying a customer using their email contact

30

get_all_customers

Retrieve all customers linked to your merchant account

Viewing your full customer base


Use Cases

With DOKU MCP, an AI chatbot can generate a QRIS payment request when a user wants to buy something, send the QR code, poll or receive webhook updates about payment status, and notify the user once paid; similarly, a virtual account flow can be generated, monitored, and confirmed via the agent. Visit DOKU Docs to learn how these tools may be used in practice.

Explore Use Cases

Last updated

Was this helpful?