agentleFS
roedyrustamroedyrustam/vibes-plug/skills/doku-mcp-server/SKILL.md

doku-mcp-server

Skill73 starsChanged 58 days agoMITView on GitHub

Expert guide for DOKU Model Context Protocol (MCP) Server integration. Enables AI Agentic Commerce with tools for DOKU Checkout, payment links, Virtual Accounts, QRIS, and order status checks / Panduan ahli DOKU MCP Server untuk AI Agentic Commerce.

  • Reads credentials
  • Sends data out

The file

Files
SKILL.md

DOKU MCP Server / Server Model Context Protocol DOKU

English | Bahasa Indonesia


<a name="english"></a>

English

Orchestration & Integration

Connects and orchestrates with relevant domain skills:

  • doku-payment-gateway — Core DOKU Checkout specifications, HMAC-SHA256 signature algorithms, and SNAP BI protocols.
  • mcp-server-architect — Enterprise-grade MCP tool design, transport safety, and schema validation.
  • multi-agent-orchestration — Connecting AI shopping agents and autonomous checkout swarms.
  • saas-billing — Agentic subscription provisioning and autonomous order payment verification.

Description

Expert guide for integrating and building Model Context Protocol (MCP) servers with DOKU Payment Gateway based on the DOKU Developers Documentation. Enables AI Agents (Claude Desktop, Antigravity, Cursor, n8n, LangChain) to execute payment tasks autonomously using Agentic Commerce capabilities (generating DOKU Checkout links, issuing Virtual Account numbers, generating QRIS codes, and querying order-level transaction statuses).

Trigger Conditions

Activate this skill when the user is:

  • Setting up or configuring DOKU MCP server for Claude Desktop, Antigravity (AGY), Cursor, or LLM agents.
  • Implementing AI Agentic Commerce or autonomous AI-driven checkout workflows using DOKU Checkout.
  • Building a custom TypeScript or Python MCP server wrapping DOKU Checkout (/checkout/v1/payment) or SNAP BI APIs.
  • Defining MCP tools and resources for payment generation and status verification.

Key Capabilities & Tools

MCP Tool NameDescriptionKey Input Parameters
create_checkout_paymentGenerates a DOKU Checkout URL supporting all payment methods (VA, CC, QRIS, E-Wallet, etc.)amount, invoice_number, customer_name, customer_email, customer_phone, callback_url, payment_method_types, payment_due_date
check_transaction_statusQueries real-time order and transaction status from DOKU (/orders/v1/status/{invoice_number})invoice_number
create_virtual_accountGenerates a direct bank Virtual Account number via Direct SNAP BI APIbank_code, amount, invoice_number, customer_name
create_qris_paymentGenerates a dynamic QRIS string/image for instant wallet paymentsamount, invoice_number, store_name

Client Configuration

1. Antigravity & Gemini Configuration (mcp.json)

Location:

  • Global: ~/.gemini/config/mcp.json (Windows: %USERPROFILE%\.gemini\config\mcp.json)
  • Workspace: .agents/mcp.json (in your project root)
{
  "mcpServers": {
    "doku-payment": {
      "command": "node",
      "args": ["/path/to/doku-mcp-server/dist/index.js"],
      "env": {
        "DOKU_CLIENT_ID": "YOUR_SANDBOX_OR_PROD_CLIENT_ID",
        "DOKU_SECRET_KEY": "YOUR_SANDBOX_OR_PROD_SECRET_KEY",
        "DOKU_IS_PRODUCTION": "false"
      }
    }
  }
}

2. Claude Desktop Configuration (claude_desktop_config.json)

Location:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "doku-payment": {
      "command": "node",
      "args": ["/path/to/doku-mcp-server/dist/index.js"],
      "env": {
        "DOKU_CLIENT_ID": "YOUR_SANDBOX_OR_PROD_CLIENT_ID",
        "DOKU_SECRET_KEY": "YOUR_SANDBOX_OR_PROD_SECRET_KEY",
        "DOKU_IS_PRODUCTION": "false"
      }
    }
  }
}

Building a Production TypeScript MCP Server for DOKU

import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
import crypto from 'crypto';

const CLIENT_ID = process.env.DOKU_CLIENT_ID || '';
const SECRET_KEY = process.env.DOKU_SECRET_KEY || '';
const BASE_URL = process.env.DOKU_IS_PRODUCTION === 'true' 
  ? 'https://api.doku.com' 
  : 'https://api-sandbox.doku.com';

function generateNonSnapHeaders(targetPath: string, payload?: object) {
  const requestId = crypto.randomUUID();
  const timestamp = new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');
  let component = `Client-Id:${CLIENT_ID}\nRequest-Id:${requestId}\nRequest-Timestamp:${timestamp}\nRequest-Target:${targetPath}`;

  const headers: Record<string, string> = {
    'Client-Id': CLIENT_ID,
    'Request-Id': requestId,
    'Request-Timestamp': timestamp,
    'Request-Target': targetPath,
  };

  if (payload) {
    const jsonBody = JSON.stringify(payload);
    const digest = crypto.createHash('sha256').update(jsonBody, 'utf8').digest('base64');
    headers['Digest'] = digest;
    headers['Content-Type'] = 'application/json';
    component += `\nDigest:${digest}`;
  }

  const signature = 'HMACSHA256=' + crypto.createHmac('sha256', SECRET_KEY).update(component, 'utf8').digest('base64');
  headers['Signature'] = signature;

  return headers;
}

const server = new Server(
  { name: 'doku-mcp-server', version: '2.0.0' },
  { capabilities: { tools: {} } }
);

server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name: 'create_checkout_payment',
      description: 'Generate a DOKU Checkout URL allowing customers to pay with all supported payment methods (VA, CC, QRIS, E-Wallet, Paylater)',
      inputSchema: {
        type: 'object',
        properties: {
          amount: { type: 'number', description: 'Total payment amount in IDR (integer without decimals)' },
          invoice_number: { type: 'string', description: 'Unique order invoice number' },
          customer_name: { type: 'string', description: 'Customer full name' },
          customer_email: { type: 'string', description: 'Customer email address' },
          customer_phone: { type: 'string', description: 'Customer phone number in international format (e.g. 6281234567890)' },
          callback_url: { type: 'string', description: 'Merchant redirect URL upon transaction completion' },
          payment_method_types: {
            type: 'array',
            items: { type: 'string' },
            description: 'Optional filter for payment channels (e.g. ["VIRTUAL_ACCOUNT_BCA", "CREDIT_CARD", "QRIS", "EMONEY_SHOPEEPAY"]). Omit to show all.'
          },
          payment_due_date: { type: 'number', description: 'Payment expiration time in minutes (default 60)' }
        },
        required: ['amount', 'invoice_number', 'customer_name', 'customer_email']
      }
    },
    {
      name: 'check_transaction_status',
      description: 'Check real-time order and transaction payment status using DOKU Check Status API',
      inputSchema: {
        type: 'object',
        properties: {
          invoice_number: { type: 'string', description: 'Merchant invoice number to query' }
        },
        required: ['invoice_number']
      }
    }
  ]
}));

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  const { name, arguments: args } = request.params;

  if (name === 'create_checkout_payment') {
    const targetPath = '/checkout/v1/payment';
    const body = {
      order: {
        amount: args?.amount,
        invoice_number: args?.invoice_number,
        currency: 'IDR',
        callback_url: args?.callback_url,
        auto_redirect: true
      },
      payment: {
        payment_due_date: args?.payment_due_date || 60,
        ...(args?.payment_method_types ? { payment_method_types: args.payment_method_types } : {})
      },
      customer: {
        id: args?.customer_email,
        name: args?.customer_name,
        email: args?.customer_email,
        phone: args?.customer_phone || '6281234567890'
      }
    };

    const response = await fetch(`${BASE_URL}${targetPath}`, {
      method: 'POST',
      headers: generateNonSnapHeaders(targetPath, body),
      body: JSON.stringify(body)
    });

    const data = await response.json();
    return {
      content: [{ type: 'text', text: JSON.stringify(data, null, 2) }]
    };
  }

  if (name === 'check_transaction_status') {
    const invoiceNumber = args?.invoice_number;
    const targetPath = `/orders/v1/status/${invoiceNumber}`;

    const response = await fetch(`${BASE_URL}${targetPath}`, {
      method: 'GET',
      headers: generateNonSnapHeaders(targetPath)
    });

    const data = await response.json();
    return {
      content: [{ type: 'text', text: JSON.stringify(data, null, 2) }]
    };
  }

  throw new Error(`Tool not found: ${name}`);
});

async function main() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
}

main().catch(console.error);

Common Pitfalls to Avoid

Anti-PatternIssueSolution
Hardcoding Merchant SecretsSecurity leakAlways read DOKU_CLIENT_ID and DOKU_SECRET_KEY from environment variables.
Incomplete Tool Schema DescriptionsAI Agent misinterprets tool usageProvide clear parameter descriptions and strict required fields in JSON schema.
Omitting Digest on POST401 Unauthorized / Signature MismatchFor DOKU Checkout (/checkout/v1/payment), calculate Base64 SHA-256 Digest of minified body and include it in component string.
Including Digest on GET Check Status401 Signature MismatchFor GET requests (/orders/v1/status/...), do NOT include Digest in headers or signature component string.

<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Integrasi Orkestrasi

Terhubung dan mengorkestrasi skill domain yang relevan:

  • doku-payment-gateway — Spesifikasi teknis DOKU Checkout, algoritma HMAC-SHA256, dan standar SNAP BI.
  • mcp-server-architect — Arsitektur server MCP tingkat lanjut dan skema type-safe.
  • multi-agent-orchestration — Agen AI otonom untuk pembelian dan checkout otomatis.
  • saas-billing — Verifikasi pembayaran tagihan langganan secara otonom.

Deskripsi

Panduan ahli untuk mengintegrasikan dan membuat server Model Context Protocol (MCP) dengan DOKU Payment Gateway berdasarkan dokumentasi resmi DOKU Developers Documentation. Memungkinkan Agen AI (Claude Desktop, Antigravity, Cursor, n8n, LangChain) menjalankan transaksi pembayaran secara otonom dalam alur Agentic Commerce (membuat URL DOKU Checkout, memeriksa status pembayaran order, dan mengelola invoice).

Tool Utama yang Disediakan

  1. create_checkout_payment: Menghasilkan URL DOKU Checkout yang mendukung seluruh metode pembayaran (VA, Kartu Kredit, QRIS, E-Wallet, Paylater).
  2. check_transaction_status: Memeriksa status transaksi dan order secara real-time via GET /orders/v1/status/{invoice_number}.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.