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:
- Access the Omise Dashboard
- Create an account or log in
- Navigate to Settings → Keys
- Get your API keys:
- Test Environment: Use keys starting with
pkey_test_andskey_test_ - Production Environment: Use keys starting with
pkey_live_andskey_live_
- Test Environment: Use keys starting with
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:
- Download omise-mcp from GitHub
- Navigate to the omise-mcp directory in a command prompt, then run
npm installto install all dependencies. - Download and install Claude Desktop
- Open Claude Desktop, navigate to Settings. Click Developer and then Edit Config.

- Edit the
claude_desktop_config.jsonfile. 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.tswith 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. - Save and close the file.
- Restart Claude Desktop.
- Navigate to Settings → Developer, and you should see that the Omise MCP server is running and connected to Claude.

- From the Claude chat interface, click the Search and Tools icon. You should see the omise-mcp-server enabled.

Cursor
To set up Omise MCP with Cursor:
- Download Cursor AI
- Log in to the Cursor API
- Navigate to Cursor → Settings → Cursor Settings → Tools & MCP
- Click Add MCP Server
- 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/npxwith the actual path to your npx executable (e.g.,/Users/username/.asdf/shims/npxor/opt/homebrew/bin/npx) - Replace
/path/to/your/omise-mcp/src/index.tswith the actual path to the index.ts file - Replace
/path/to/your/omise-mcpwith 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
- Replace
- Save the configuration
- Restart Cursor
- Navigate to Settings → Cursor Settings → Tools & MCP. The Omise MCP server should be enabled.

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 allto 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
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:
- Use Test Keys During Development: Always use test mode API keys (starting with
skey_test_andpkey_test_) during development and testing. - Secure Your API Keys: Never commit API keys to version control or share them publicly. Store them as environment variables.
- Implement Proper Error Handling: Always handle errors gracefully and never expose sensitive information in error messages.
- Monitor for Suspicious Activity: Regularly review your API usage and set up alerts for unusual patterns.
- 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 keysinvalid_card- Card validation failedinsufficient_fund- Not enough balance for operationfailed_processing- Payment processing failedinvalid_charge- Invalid charge parametersnot_found- Resource not foundservice_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 and Refund a Charge


List Available Tools

Support
If you encounter issues or have questions:
- Documentation: https://docs.omise.co
- API Status: https://status.omise.co
- Support Email: support@omise.co
- GitHub Issues: https://github.com/OmisePayments/omise-mcp/issues