Omise Model Context Protocol (MCP)

Topics covered on this page

Omise Model Context Protocol (MCP)

Let your AI agents interact with the Omise API by using our MCP server.

The Omise Model Context Protocol (MCP) server provides a set of tools for AI agents to interact with the Omise API for payment processing, customer management, and financial operations.

If you use AI-powered code editors such as Cursor or general-purpose tools such as Claude Desktop, you can use our MCP server.

Prerequisites

Before installing the Omise MCP server, ensure you have the following prerequisites installed:

Required Software

Node.js 20+: JavaScript runtime environment (includes the npm package manager)

Note: TypeScript and other dependencies will be automatically installed when you run npm install in the omise-mcp directory.

Installation Instructions

For installation instructions, see Node.js install.

Omise API Keys

You need an Omise Account and API keys:

  1. Access the Omise Dashboard
  2. Create an account or log in
  3. Navigate to Settings → Keys
  4. Get your API keys:
    • Test Environment: Use keys starting with pkey_test_ and skey_test_
    • Production Environment: Use keys starting with pkey_live_ and skey_live_

Important: Always use test keys during development and live keys only in production.

Local server

Run the local Omise MCP server by following the setup instructions for your preferred development environment.

Claude

To set up Omise MCP with Claude Desktop:

  1. Download omise-mcp from GitHub
  2. Navigate to the omise-mcp directory in a command prompt, then run npm install to install all dependencies.
  3. Download and install Claude Desktop
  4. Open Claude Desktop, navigate to Settings. Click Developer and then Edit Config.
    Edit Config
  5. Edit the claude_desktop_config.json file. The content should look as follows:

    {
      "mcpServers": {
        "omise-mcp-server": {
          "command": "/opt/homebrew/bin/npx",
          "args": [
            "tsx",
            "/path/to/your/omise-mcp/src/index.ts"
          ],
          "cwd": "/path/to/your/omise-mcp/",
          "env": {
            "NODE_ENV": "prod",
            "OMISE_ENVIRONMENT": "test",
            "OMISE_API_VERSION": "2019-05-29",
            "OMISE_PUBLIC_KEY": "<<YOUR_PUBLIC_KEY>>",
            "OMISE_SECRET_KEY": "<<YOUR_SECRET_KEY>>",
            "OMISE_BASE_URL": "https://api.omise.co",
            "OMISE_VAULT_URL": "https://vault.omise.co",
            "OMISE_TIMEOUT": "30000",
            "OMISE_RETRY_ATTEMPTS": "3",
            "OMISE_RETRY_DELAY": "1000",
            "SERVER_NAME": "omise-mcp-server-prod",
            "SERVER_VERSION": "1.0.0",
            "TOOLS": "all",
            "LOG_LEVEL": "info",
            "LOG_FORMAT": "json",
            "LOG_REQUESTS": "true",
            "LOG_RESPONSES": "false",
            "RATE_LIMIT_ENABLED": "true",
            "RATE_LIMIT_MAX_REQUESTS": "500",
            "RATE_LIMIT_WINDOW_MS": "60000"
          }
        }
      }
    }
    
    Note: Replace /path/to/your/omise-mcp/src/index.ts with the actual path to the index.ts file within your downloaded omise-mcp folder, and /path/to/your/omise-mcp/ with the exact path to your omise-mcp folder.

    API Keys: Replace <<YOUR_PUBLIC_KEY>> and <<YOUR_SECRET_KEY>> with your actual Omise API keys. You can obtain these from Omise Dashboard → Settings → Keys. For a live account, use live keys; for a test account, use test keys.

  6. Save and close the file.
  7. Restart Claude Desktop.
  8. Navigate to Settings → Developer, and you should see that the Omise MCP server is running and connected to Claude.
    MCP Server is Running
  9. From the Claude chat interface, click the Search and Tools icon. You should see the omise-mcp-server enabled.
    MCP Server is Enabled in Claude

Cursor

To set up Omise MCP with Cursor:

  1. Download Cursor AI
  2. Log in to the Cursor API
  3. Navigate to Cursor → Settings → Cursor Settings → Tools & MCP
  4. Click Add MCP Server
  5. Enter the configuration as follows:

    {
      "mcpServers": {
        "omise-mcp-server": {
          "command": "/path/to/npx",
          "args": [
            "tsx",
            "/path/to/your/omise-mcp/src/index.ts"
          ],
          "cwd": "/path/to/your/omise-mcp",
          "env": {
            "NODE_ENV": "prod",
            "OMISE_ENVIRONMENT": "test",
            "OMISE_API_VERSION": "2019-05-29",
            "OMISE_PUBLIC_KEY": "<<YOUR_PUBLIC_KEY>>",
            "OMISE_SECRET_KEY": "<<YOUR_SECRET_KEY>>",
            "OMISE_BASE_URL": "https://api.omise.co",
            "OMISE_VAULT_URL": "https://vault.omise.co",
            "OMISE_TIMEOUT": "30000",
            "OMISE_RETRY_ATTEMPTS": "3",
            "OMISE_RETRY_DELAY": "1000",
            "SERVER_NAME": "omise-mcp-server-prod",
            "SERVER_VERSION": "1.0.0",
            "TOOLS": "all",
            "LOG_LEVEL": "info",
            "LOG_FORMAT": "json",
            "LOG_REQUESTS": "true",
            "LOG_RESPONSES": "false",
            "RATE_LIMIT_ENABLED": "true",
            "RATE_LIMIT_MAX_REQUESTS": "500",
            "RATE_LIMIT_WINDOW_MS": "60000"
          }
        }
      }
    }
    
    Note:
    • Replace /path/to/npx with the actual path to your npx executable (e.g., /Users/username/.asdf/shims/npx or /opt/homebrew/bin/npx)
    • Replace /path/to/your/omise-mcp/src/index.ts with the actual path to the index.ts file
    • Replace /path/to/your/omise-mcp with the actual path to your omise-mcp folder
    • Replace <<YOUR_PUBLIC_KEY>> and <<YOUR_SECRET_KEY>> with your actual Omise API keys from Omise Dashboard → Settings → Keys

  6. Save the configuration
  7. Restart Cursor
  8. Navigate to Settings → Cursor Settings → Tools & MCP. The Omise MCP server should be enabled.
    MCP Server is Enabled in Cursor

CLI

Start the MCP server locally with this command:

cd /path/to/your/omise-mcp
npx tsx src/index.ts

Ensure the OMISE_SECRET_KEY and OMISE_PUBLIC_KEY environment variables are set before running the server.

Configuration Parameters

Understanding the configuration parameters helps you customize the MCP server for your specific needs:

Core Configuration

Variable Description Required Default Example
OMISE_PUBLIC_KEY Omise public API key - pkey_test_bgwtwgdmon2i23pwaxw
OMISE_SECRET_KEY Omise secret API key - skey_test_ueq529yrmuzk0gmu730
OMISE_ENVIRONMENT Environment mode - test or production
OMISE_API_VERSION Omise API version 2019-05-29 2019-05-29

URL Configuration

Variable Description Required Default Example
OMISE_BASE_URL Omise API base URL - `https://api.omise.co https://api.omise.co`
OMISE_VAULT_URL Omise Vault URL for tokenization - `https://vault.omise.co https://vault.omise.co`

Network Configuration

Variable Description Required Default Example
OMISE_TIMEOUT API request timeout in milliseconds - 30000 30000
OMISE_RETRY_ATTEMPTS Number of retry attempts for failed requests - 3 3
OMISE_RETRY_DELAY Delay between retries in milliseconds - 1000 1000

Server Configuration

Variable Description Required Default Example
SERVER_NAME Server identifier - omise-mcp-server omise-mcp-server-prod
SERVER_VERSION Server version - 1.0.0 1.0.0
NODE_ENV Node environment - development staging or production

Logging Configuration

Variable Description Required Default Example
LOG_LEVEL Logging level - info debug, info, warn, error
LOG_FORMAT Log output format - simple json, simple
LOG_REQUESTS Log API requests - true true or false
LOG_RESPONSES Log API responses - false true or false

Rate Limiting Configuration

Variable Description Required Default Example
RATE_LIMIT_ENABLED Enable rate limiting - true true or false
RATE_LIMIT_MAX_REQUESTS Maximum requests per window - 100 500
RATE_LIMIT_WINDOW_MS Rate limit time window in milliseconds - 60000 60000

Access Control Configuration

Variable Description Required Default Example
TOOLS Comma-separated list of allowed MCP tools, or all to enable all tools - all or create_charge,list_charges,retrieve_charge etc

Access Control Features:

  • Tool Whitelisting: Only tools specified in the TOOLS environment variable are exposed to MCP clients
  • Exact Validation: Tool names are validated against the complete list of 50+ available tools at startup
  • Runtime Enforcement: Unauthorized tool calls are rejected with structured error messages
  • Startup Validation: Server fails to start if invalid tool names are provided

Examples:

# Enable all tools
TOOLS=all

# Enable specific tools only
TOOLS=create_charge,retrieve_charge,list_charges

# Invalid tool name causes startup failure
TOOLS=invalid_tool # ❌ Fails with "Invalid tool names" error

Environment-Specific Configuration Samples

Development Environment:

{
  "NODE_ENV": "development",
  "OMISE_ENVIRONMENT": "test",
  "OMISE_PUBLIC_KEY": "pkey_test_...",
  "OMISE_SECRET_KEY": "skey_test_...",
  "TOOLS": "all",
  "LOG_LEVEL": "debug",
  "LOG_REQUESTS": "true",
  "LOG_RESPONSES": "true"
}

Production Environment:

{
  "NODE_ENV": "production",
  "OMISE_ENVIRONMENT": "production",
  "OMISE_PUBLIC_KEY": "pkey_live_...",
  "OMISE_SECRET_KEY": "skey_live_...",
  "TOOLS": "create_charge,retrieve_charge,list_charges,create_customer,retrieve_customer",
  "LOG_LEVEL": "warn",
  "LOG_RESPONSES": "false",
  "RATE_LIMIT_MAX_REQUESTS": "1000"
}

Tools

The server exposes the following MCP tools. Exercise caution when using the Omise MCP with other servers to avoid prompt injection attacks. Always review operations before they run, especially for sensitive actions like creating charges or processing payments. If you have feedback or want to see more tools, email us at mcp@omise.co.

OMISE MCP

Next-Generation Payment Infrastructure

50
Total API Tools
12
API Categories
4
Avg per Category

Charges

7 TOOLS
create_charge
Create a charge for payment processing
retrieve_charge
Retrieve charge information by ID
list_charges
List all charges with optional filtering
update_charge
Update charge information (only for pending charges)
capture_charge
Capture an authorized charge (supports partial/multi-capture)
reverse_charge
Reverse an authorized charge
expire_charge
Expire a pending charge
👥

Customers

5 TOOLS
create_customer
Create a customer
retrieve_customer
Retrieve customer information by ID
list_customers
List all customers with filtering options
update_customer
Update customer information
destroy_customer
Delete a customer
💳

Cards

4 TOOLS
list_customer_cards
List all cards for a customer
retrieve_customer_card
Retrieve a specific card for a customer
update_customer_card
Update a customer card
destroy_customer_card
Delete a customer card
🔐

Tokens

2 TOOLS
create_token
Create a card token for secure payment processing
retrieve_token
Retrieve token information by ID
🎯

Sources

2 TOOLS
create_source
Create a payment source for various payment methods
retrieve_source
Retrieve source information by ID
💸

Transfers

5 TOOLS
create_transfer
Create a transfer to a recipient
retrieve_transfer
Retrieve transfer information by ID
list_transfers
List all transfers with optional filtering
update_transfer
Update transfer information (only for pending transfers)
destroy_transfer
Delete a transfer (only for pending transfers)
🎁

Recipients

6 TOOLS
create_recipient
Create a recipient for transfers
retrieve_recipient
Retrieve recipient information by ID
list_recipients
List all recipients with optional filtering
update_recipient
Update recipient information
destroy_recipient
Delete a recipient
verify_recipient
Verify recipient information and bank account
↩️

Refunds

3 TOOLS
create_refund
Create a refund for a charge
retrieve_refund
Retrieve refund information by ID
list_refunds
List all refunds with optional filtering
⚠️

Disputes

8 TOOLS
list_disputes
List all disputes with optional filtering
retrieve_dispute
Retrieve dispute information by ID
accept_dispute
Accept a dispute (accept the chargeback)
update_dispute
Update dispute information
list_dispute_documents
List all documents for a dispute
retrieve_dispute_document
Retrieve a specific dispute document
upload_dispute_document
Upload a document for a dispute
destroy_dispute_document
Delete a dispute document
📅

Schedules

5 TOOLS
create_schedule
Create a payment schedule
retrieve_schedule
Retrieve schedule information by ID
list_schedules
List all schedules with optional filtering
destroy_schedule
Delete a schedule
list_schedule_occurrences
List all occurrences (execution history) for a schedule
📡

Events

2 TOOLS
list_events
List all events with optional filtering
retrieve_event
Retrieve event information by ID
🔧

Capability

1 TOOL
retrieve_capability
Retrieve Omise API capabilities and supported features

Payment Methods

The Omise MCP server supports a wide range of payment methods available through the Omise API, including:

  • Credit/Debit Cards: Visa, Mastercard, JCB
  • Internet Banking: Bangkok Bank, Kasikorn Bank, Siam Commercial Bank, Krung Thai Bank, and more
  • Mobile Banking: PromptPay, TrueMoney Wallet
  • E-wallets: Alipay, Alipay HK
  • Installments: Various banks offering monthly terms

For the complete list of supported payment methods and their availability by country, use the retrieve_capability tool.

Security Best Practices

When using the Omise MCP server:

  1. Use Test Keys During Development: Always use test mode API keys (starting with skey_test_ and pkey_test_) during development and testing.
  2. Secure Your API Keys: Never commit API keys to version control or share them publicly. Store them as environment variables.
  3. Implement Proper Error Handling: Always handle errors gracefully and never expose sensitive information in error messages.
  4. Monitor for Suspicious Activity: Regularly review your API usage and set up alerts for unusual patterns.
  5. Use Tool Whitelisting in Production: Instead of using TOOLS=all, specify only the tools your application needs. This follows the principle of least privilege and reduces the attack surface.

Error Handling

The Omise MCP server provides detailed error information when API calls fail. For example:

{
  "error": {
    "object": "error",
    "location": "https://docs.omise.co/api-errors",
    "code": "invalid_card",
    "message": "number is invalid"
  }
}

Common error codes:

  • authentication_failure - Invalid API keys
  • invalid_card - Card validation failed
  • insufficient_fund - Not enough balance for operation
  • failed_processing - Payment processing failed
  • invalid_charge - Invalid charge parameters
  • not_found - Resource not found
  • service_not_available - Service temporarily unavailable

For a complete list of error codes, see the Omise API Errors documentation.

Testing

Test Mode

All Omise accounts have test mode enabled by default. Use test API keys to simulate transactions without processing real payments.

Test Cards

Use the following test card numbers in test mode:

Successful Charges: - 4242424242424242 - Visa - 5555555555554444 - Mastercard - 3530111333300000 - JCB

Failed Charges: - 4000000000000002 - Card declined - 4000000000000069 - Expired card - 4000000000000127 - Incorrect CVC

For a complete list of test cards and failure scenarios, see the Omise Testing Guide.

API Versioning

The Omise API uses versioning to ensure backward compatibility. The current recommended version is 2019-05-29.

To use a specific API version, set the OMISE_API_VERSION environment variable:

OMISE_API_VERSION=2019-05-29

For more information, see the Omise API Versioning documentation.

Usage Examples with Claude

Create a Charge using TOKEN

Create a Charge

Create a Charge

Create and Refund a Charge

Refund a Charge

Refund a Charge

List Available Tools

List Available Tools

Support

If you encounter issues or have questions:

See also

Omise uses cookies to improve your overall site experience and collect information on your visits and browsing behavior. By continuing to browse our website, you agree to our Privacy Policy. Learn more