Omise MCP Server is a comprehensive server for integrating with Omise payment APIs using Model Context Protocol (MCP). Implemented in TypeScript with full support for Omise API v2019-05-29.
β οΈ Alpha Release: This is an alpha release for early adopters and testing. Some features may be experimental.
- Charge Management: Create, retrieve, update, capture, and reverse payments
- Source Management: Support for various payment methods
- Refunds: Partial and full refund processing
- Customer Information: Create, retrieve, update, and delete customers
- Card Management: Manage customer card information
- Metadata: Store custom information
- Transfer Processing: Send money to recipients
- Recipient Management: Create, verify, and manage recipients
- Bank Accounts: Manage bank account information
- Recurring Payments: Automatic payments based on schedules
- Occurrence Management: Manage schedule execution
- Flexible Configuration: Daily, weekly, and monthly schedules
- Event Management: Track system events
- Dispute Management: Handle chargebacks
- Capability Check: API functionality verification
| Category | Features | Tool Count | Documentation |
|---|---|---|---|
| Payment | Charges (7), Sources (2) | 9 | Omise Charges API |
| Customer | Customer & Card Management | 9 | Omise Customers API |
| Transfer | Transfers (5) & Recipients (6) | 11 | Omise Transfers API |
| Refund | Refund Processing | 3 | Omise Refunds API |
| Dispute | Chargeback & Document Management | 8 | Omise Disputes API |
| Schedule | Recurring Payments | 5 | Omise Schedules API |
| Event | Event Management | 2 | Omise Events API |
| Capability | Feature Verification | 1 | Omise Capabilities API |
Total: 48 tools covering all active Omise Core API functionality
- Runtime: Node.js 20+
- Language: TypeScript 5.2+
- Framework: Model Context Protocol (MCP)
- HTTP Client: Axios
- Logging: Winston
- Testing: Jest
- Containerization: Docker + Docker Compose
- Node.js 20+
- npm or yarn
- Omise Account and API keys
# Clone the repository
git clone [email protected]:omise/omise-mcp.git
cd omise-mcp
# Install dependencies
npm install# Copy environment configuration file
cp config/production.env.example .env
# Or use staging template: cp config/staging.env.example .env
# Set environment variables
export OMISE_SECRET_KEY=skey_test_xxxxxxxxxxxxxxxx
export OMISE_ENVIRONMENT=test
export OMISE_API_VERSION=2019-05-29
export OMISE_BASE_URL=https://api.omise.co
# Set tool access control (mandatory)
export TOOLS=all # For development only
# Or for production, specify exact tools:
# export TOOLS=create_charge,retrieve_charge,list_charges,create_customerFor Development:
# Copy example file and customize
cp config/production.env.example .env
# Edit .env and set OMISE_ENVIRONMENT=test
# Use test API keys, enable verbose loggingFor Production:
# Copy example file and customize
cp config/production.env.example .env
# Edit .env and set:
# OMISE_ENVIRONMENT=production
# OMISE_SECRET_KEY=skey_live_xxxxxxxxxxxxxxxx
# Use live API keys, optimized for performance# Test your API key configuration
npm run dev
# Or verify with a simple check
echo $OMISE_SECRET_KEY | grep -q "skey_" && echo "β
Secret key configured" || echo "β Secret key missing"
echo $TOOLS | grep -q "." && echo "β
TOOLS configured: $TOOLS" || echo "β TOOLS not set (required)"# Start in development mode
npm run dev
# Or start in production mode
npm run build
npm start// Create a charge
const charge = await mcpClient.callTool('create_charge', {
amount: 10000, // 100.00 THB (smallest currency unit)
currency: 'THB',
description: 'Test payment',
capture: true
});
// Create a customer
const customer = await mcpClient.callTool('create_customer', {
email: '[email protected]',
description: 'Test customer'
});// Create a schedule
const schedule = await mcpClient.callTool('create_schedule', {
every: 1,
period: 'month',
start_date: '2024-01-01',
charge: {
customer: 'cust_123',
amount: 5000,
currency: 'THB',
description: 'Monthly subscription'
}
});// Create a recipient
const recipient = await mcpClient.callTool('create_recipient', {
name: 'John Doe',
email: '[email protected]',
type: 'individual',
bank_account: {
brand: 'bbl',
number: '1234567890',
name: 'John Doe'
}
});
// Execute transfer
const transfer = await mcpClient.callTool('create_transfer', {
amount: 10000,
recipient: recipient.id
});| Variable | Description | Required | Default |
|---|---|---|---|
OMISE_SECRET_KEY |
Omise secret key | β | - |
OMISE_ENVIRONMENT |
Environment (test/production) | β | - |
TOOLS |
Comma-separated list of allowed tools or 'all' | β | - |
LOG_LEVEL |
Log level | - | info |
LOG_FORMAT |
Log format | - | simple |
- Access Omise Dashboard
- Create an account or log in
- Get keys from the API Keys section
- Test Environment: Use keys starting with
skey_test_ - Production Environment: Use keys starting with
skey_live_
Important: Always use live keys in production and test keys in test environment.
omise-mcp-server/
βββ src/ # Source code
β βββ index.ts # Main server file
β βββ types/ # Type definitions
β β βββ omise.ts # Omise API type definitions
β β βββ mcp.ts # MCP type definitions
β β βββ index.ts # Type definition exports
β βββ tools/ # Tool implementations
β β βββ payment-tools.ts # Payment-related tools
β β βββ customer-tools.ts # Customer-related tools
β β βββ source-tools.ts # Source-related tools
β β βββ transfer-tools.ts # Transfer-related tools
β β βββ recipient-tools.ts # Recipient-related tools
β β βββ refund-tools.ts # Refund-related tools
β β βββ dispute-tools.ts # Dispute-related tools
β β βββ schedule-tools.ts # Schedule-related tools
β β βββ event-tools.ts # Event-related tools
β β βββ capability-tools.ts # Capability verification tools
β β βββ index.ts # Tool exports
β βββ utils/ # Utilities
β βββ config.ts # Configuration management
β βββ logger.ts # Logging functionality
β βββ omise-client.ts # Omise API client
β βββ index.ts # Utility exports
βββ tests/ # Tests
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β βββ auth/ # Authentication tests
β βββ error/ # Error handling tests
β βββ factories/ # Test factories
βββ config/ # Configuration files
β βββ production.env.example # Production template
β βββ staging.env.example # Staging template
βββ docker-compose.yml # Docker Compose configuration
βββ Dockerfile # Docker configuration
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
# Install development dependencies
npm install
# Start development server
npm run dev# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
# Specific test categories
npm run test:unit
npm run test:integration
npm run test:auth
npm run test:error# Run linting
npm run lint# Compile TypeScript
npm run build
# Production build
npm run build:production# Start development environment
# First create your .env file from the example:
# cp config/production.env.example .env
# Edit .env with your test API keys
docker-compose --env-file .env up -d
# Check logs
docker-compose logs -f omise-mcp-server# Start production environment
# First create your .env file from the example:
# cp config/production.env.example .env
# Edit .env with your live API keys
docker-compose --env-file .env up -d- Non-root user: Run containers as non-root user
- Sensitive data masking: Hide sensitive information in logs
- Environment isolation: Complete separation of test and production environments
- Tool Access Control: Granular control over which API tools clients can access
The MCP server requires explicit tool access configuration for enhanced security. Each client must specify which Omise API tools they are authorized to use.
Set the TOOLS environment variable (mandatory). The server will not start without this configuration.
Options:
TOOLS=all- Full access to all 48 tools (development only, not recommended for production)TOOLS=tool1,tool2,...- Comma-separated list of specific tools (recommended for production)
Common Patterns:
- Read-only access:
TOOLS=list_charges,retrieve_charge,list_customers,retrieve_customer - Payment processing:
TOOLS=create_charge,retrieve_charge,capture_charge,create_customer,create_source - Finance operations:
TOOLS=list_charges,retrieve_charge,create_refund,create_transfer
Full access (development/testing):
export TOOLS=all
docker-compose upRead-only access (monitoring/analytics):
export TOOLS=list_charges,retrieve_charge,list_customers,retrieve_customer
docker-compose upPayment processing only:
export TOOLS=create_charge,retrieve_charge,capture_charge,create_customer,create_source
docker-compose upPodman with specific tools:
podman run --rm -i \
-e OMISE_SECRET_KEY=skey_test_xxx \
-e OMISE_ENVIRONMENT=test \
-e TOOLS=create_charge,list_charges,create_customer \
omise-mcp-server:latest| Category | Tools | Description |
|---|---|---|
| Charges | create_charge, retrieve_charge, list_charges, update_charge, capture_charge, reverse_charge, expire_charge |
Payment charge operations |
| Customers | create_customer, retrieve_customer, list_customers, update_customer, destroy_customer |
Customer management |
| Cards | list_customer_cards, retrieve_customer_card, update_customer_card, destroy_customer_card |
Card management |
| Sources | create_source, retrieve_source |
Payment sources |
| Transfers | create_transfer, retrieve_transfer, list_transfers, update_transfer, destroy_transfer |
Transfer operations |
| Recipients | create_recipient, retrieve_recipient, list_recipients, update_recipient, destroy_recipient, verify_recipient |
Recipient management |
| Refunds | create_refund, retrieve_refund, list_refunds |
Refund processing |
| Disputes | list_disputes, retrieve_dispute, accept_dispute, update_dispute, list_dispute_documents, retrieve_dispute_document, upload_dispute_document, destroy_dispute_document |
Dispute handling |
| Schedules | create_schedule, retrieve_schedule, list_schedules, destroy_schedule, list_schedule_occurrences |
Recurring payments |
| Events | list_events, retrieve_event |
Event tracking |
| Capabilities | retrieve_capability |
Feature verification |
The server will fail to start if:
TOOLSenvironment variable is not setTOOLSis empty or contains only whitespaceTOOLScontains invalid tool names (e.g.,TOOLS=hello,invalid_tool)
Clients will receive an authorization error if:
- They attempt to call a tool not in their allowed list
Example Errors:
# Missing TOOLS environment variable
Error: Missing required environment variable: TOOLS
Set TOOLS=all for full access, or specify comma-separated tool names.
Example: TOOLS=create_charge,list_charges,create_customer
# Invalid tool names
Error: Invalid tool names: hello, invalid_tool
Valid tools are: create_charge, retrieve_charge, list_charges, ... (48 total)
Use TOOLS=all for full access.Runtime Behavior:
When TOOLS is properly configured:
- Only authorized tools appear in
list_toolsresponses - Unauthorized tools are not accessible to clients
- Access control is enforced at the MCP protocol level
- Principle of Least Privilege: Only grant access to tools absolutely necessary for the role
- Production Restrictions: Never use
TOOLS=allin production - always specify exact tools - Role-Based Deployment: Run separate MCP server instances for different user roles:
- Read-Only (Analytics/Support):
list_charges,retrieve_charge,list_customers,retrieve_customer - Payment Processing (Merchants):
create_charge,retrieve_charge,capture_charge,create_customer,create_source - Finance Operations:
list_charges,create_refund,create_transfer,create_recipient - Admin (Development/Emergency):
all(use with caution)
- Read-Only (Analytics/Support):
- Regular Audits: Review and document tool access configurations periodically
- Environment Separation: Use different TOOLS configurations for dev, staging, and production
- Configuration Management: Store TOOLS settings in environment-specific config files
Use Cursor's mcp.json to configure multiple clients with different access levels:
{
"mcpServers": {
"omise-admin": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "OMISE_SECRET_KEY=skey_xxx",
"-e", "OMISE_ENVIRONMENT=production",
"-e", "TOOLS=all",
"omise-mcp-server:latest"
]
},
"omise-readonly": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "OMISE_SECRET_KEY=skey_xxx",
"-e", "OMISE_ENVIRONMENT=production",
"-e", "TOOLS=list_charges,retrieve_charge,list_customers,retrieve_customer",
"omise-mcp-server:latest"
]
},
"omise-payment": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "OMISE_SECRET_KEY=skey_xxx",
"-e", "OMISE_ENVIRONMENT=production",
"-e", "TOOLS=create_charge,retrieve_charge,capture_charge,create_customer,create_source",
"omise-mcp-server:latest"
]
}
}
}# Check logs
docker-compose logs omise-mcp-server
# Check environment variables
docker-compose config# Verify API keys
echo $OMISE_SECRET_KEY | grep -q "skey_" && echo "β
Secret key configured" || echo "β Missing"# Check memory usage
docker stats
# Remove unnecessary containers
docker system prune -a# Check error logs
docker-compose logs omise-mcp-server | grep ERROR
# View recent logs
docker-compose logs --tail=100 omise-mcp-serverCreate a new charge.
Parameters:
amount(required): Amount in smallest currency unitcurrency(required): Currency code (THB, USD, JPY, etc.)description(optional): Charge descriptioncustomer(optional): Customer IDcard(optional): Card IDsource(optional): Source IDcapture(optional): Capture immediately (default: true)return_uri(optional): Redirect URImetadata(optional): Metadata
Retrieve charge information.
Parameters:
charge_id(required): Charge ID to retrieve
List charges.
Parameters:
limit(optional): Number of items to retrieve (default: 20)offset(optional): Offset (default: 0)order(optional): Sort order (chronological/reverse_chronological)status(optional): Status filtercustomer(optional): Customer ID filter
Create a new customer.
Parameters:
email(optional): Customer email addressdescription(optional): Customer descriptioncard(optional): Card IDmetadata(optional): Metadata
Retrieve customer information.
Parameters:
customer_id(required): Customer ID to retrieve
- Omise API Documentation
- Omise Charges API
- Omise Customers API
- Omise Transfers API
- Omise Refunds API
- Omise Disputes API
- Omise Schedules API
- Omise Events API
- Omise Capabilities API
- GitHub Issues: Bug reports and feature requests
- Omise Support: Omise official support
This project is licensed under the MIT License.
Contributions to the project are welcome! Please follow these steps:
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a Pull Request
- Write code in TypeScript
- Maintain test coverage
- Follow ESLint rules
- Write clear commit messages
- Total Tools: 48
- Supported APIs: 8 categories
- Test Coverage: 95%+
- TypeScript: 100%
- Docker Support: β
Omise MCP Server - Achieve secure and efficient payment processing! π
Alpha Release Notice: This is an early access release. We welcome feedback and bug reports via GitHub Issues.