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 v2017-11-02.
- Charge Management: Create, retrieve, update, capture, and reverse payments
- Tokenization: Secure card information tokenization
- 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
- Webhooks: Real-time notifications
- Payment Links: Shareable payment links
- Chain Management: Multi-tenant support
- Capability Check: API functionality verification
| Category | Features | Tool Count | Documentation |
|---|---|---|---|
| Payment | Charges, Tokens, Sources | 8 | Omise Charges API |
| Customer | Customer & Card Management | 7 | Omise Customers API |
| Transfer | Transfer & Recipient Management | 6 | Omise Transfers API |
| Refund | Refund Processing | 3 | Omise Refunds API |
| Dispute | Chargeback Processing | 7 | Omise Disputes API |
| Schedule | Recurring Payments | 5 | Omise Schedules API |
| Event | Event Management | 2 | Omise Events API |
| Webhook | Notification Management | 5 | Omise Webhooks API |
| Link | Payment Links | 3 | Omise Links API |
| Chain | Multi-tenant | 4 | Omise Chains API |
| Capability | Feature Verification | 1 | Omise Capabilities API |
Total: 51 tools covering all Omise API functionality
- Runtime: Node.js 20+
- Language: TypeScript 5.2+
- Framework: Model Context Protocol (MCP)
- HTTP Client: Axios
- Logging: Winston
- Testing: Jest + MSW
- Containerization: Docker + Docker Compose
- Monitoring: Prometheus + Grafana
- Caching: Redis
- Log Aggregation: Loki
The Omise MCP Server acts as an integration bridge between AI clients and the Omise Payment API, providing a secure and standardized way to process payments through conversational interfaces.
βββββββββββββββββββ βββββββββββββββββββ ββββββββββββββββββββ
β Claude/AI βββββΆβ MCP Server βββββΆβ Omise API β
β (Client) β β (This Project) β β (Payment Logic) β
β β β β β β
β β’ Natural Lang β β β’ Protocol β β β’ Authorization β
β β’ Tool Calls β β β’ Validation β β β’ Settlement β
β β’ Conversations β β β’ Formatting β β β’ Fraud Detectionβ
β β β β’ Retry Logic β β β’ PCI Compliance β
β β β β’ Rate Limiting β β β’ Bank Networks β
βββββββββββββββββββ βββββββββββββββββββ ββββββββββββββββββββ
- AI Client sends natural language request
- MCP Protocol converts to structured tool calls
- MCP Server validates and formats requests
- Omise API processes payments and returns data
- Response flows back through the chain to AI
- MCP Protocol: Secure stdin/stdout communication
- Input Validation: Parameter validation before API calls
- Environment Isolation: Separate configs for test/production
- API Authentication: Proper key management and rotation
- Logging: Comprehensive audit trails (stderr only for MCP)
- AI-Native: Direct integration with Claude Desktop and other MCP clients
- Type-Safe: Full TypeScript implementation with proper error handling
- Reliable: Built-in retry logic, rate limiting, and error recovery
- Secure: No business logic exposure - pure integration layer
- Scalable: Docker deployment with monitoring and logging
- Node.js 20+
- npm or yarn
- Omise Account and API keys
# Clone the repository
git clone https://github.com/your-org/omise-mcp-server.git
cd omise-mcp-server
# Install dependencies
npm install# Copy environment configuration file for development
cp config/development.env .env- Sign up for an Omise Account
- Log in to the Omise Dashboard
- Navigate to Settings β API Keys
- Copy your Test API keys:
- Public Key:
pkey_test_xxxxxxxxxxxxxxxx(for tokenization) - Secret Key:
skey_test_xxxxxxxxxxxxxxxx(for API calls)
- Public Key:
Option A: Edit .env file directly
# Edit the configuration file
nano .envUpdate these critical settings in your .env file:
# ============================================================================
# Omise API Configuration (REQUIRED)
# ============================================================================
OMISE_PUBLIC_KEY=pkey_test_your_actual_public_key_here
OMISE_SECRET_KEY=skey_test_your_actual_secret_key_here
OMISE_ENVIRONMENT=test # Use 'test' for testing, 'production' for live
OMISE_API_VERSION=2019-05-29 # Omise API version
OMISE_BASE_URL=https://api.omise.co # Main API endpoint
OMISE_VAULT_URL=https://vault.omise.co # Secure tokenization endpoint
OMISE_TIMEOUT=30000 # Request timeout in milliseconds
# ============================================================================
# Server Configuration
# ============================================================================
SERVER_NAME=omise-mcp-server-dev
SERVER_VERSION=1.0.0
NODE_ENV=development
LOG_LEVEL=info
# ============================================================================
# Rate Limiting
# ============================================================================
RATE_LIMIT_ENABLED=true
RATE_LIMIT_MAX_REQUESTS=100
RATE_LIMIT_WINDOW_MS=60000Option B: Export as shell variables
# Set Omise API credentials
export OMISE_PUBLIC_KEY=pkey_test_your_actual_public_key_here
export OMISE_SECRET_KEY=skey_test_your_actual_secret_key_here
export OMISE_ENVIRONMENT=test
export OMISE_API_VERSION=2019-05-29
export OMISE_BASE_URL=https://api.omise.co
export OMISE_VAULT_URL=https://vault.omise.coFor Development:
cp config/development.env .env
# Use test API keys, enable verbose loggingFor Staging:
cp config/staging.env .env
# Use test API keys, production-like settingsFor Production:
cp config/production.env .env
# Use live API keys, optimized for performance
# OMISE_ENVIRONMENT=production
# OMISE_PUBLIC_KEY=pkey_live_xxxxxxxxxxxxxxxx
# OMISE_SECRET_KEY=skey_live_xxxxxxxxxxxxxxxx# Test your API key configuration
npm run dev
# Or verify with a simple check
echo $OMISE_PUBLIC_KEY | grep -q "pkey_" && echo "β
Public key configured" || echo "β Public key missing"
echo $OMISE_SECRET_KEY | grep -q "skey_" && echo "β
Secret key configured" || echo "β Secret key missing"# Start in development mode
npm run dev
# Or start in production mode
npm run build
npm start# Test that the server starts without errors
npm run dev
# You should see:
# β
"Omise MCP Server started successfully"
# β
Server info with your configuration
# β
No authentication errorsCreate or edit Claude Desktop configuration:
macOS:
# Edit Claude Desktop config
nano ~/Library/Application\ Support/Claude/claude_desktop_config.jsonWindows:
# Edit Claude Desktop config
notepad %APPDATA%\Claude\claude_desktop_config.jsonAdd your MCP server configuration:
{
"mcpServers": {
"omise-mcp-server": {
"command": "/Users/your-username/.asdf/shims/npx",
"args": ["tsx", "/path/to/your/project/src/index.ts"],
"cwd": "/path/to/your/project",
"env": {
"NODE_ENV": "development",
"OMISE_ENVIRONMENT": "test",
"OMISE_API_VERSION": "2019-05-29",
"OMISE_PUBLIC_KEY": "pkey_test_your_actual_key_here",
"OMISE_SECRET_KEY": "skey_test_your_actual_key_here",
"OMISE_BASE_URL": "https://api.omise.co",
"OMISE_VAULT_URL": "https://vault.omise.co",
"OMISE_TIMEOUT": "30000"
}
}
}
}For Cursor IDE:
{
"servers": {
"omise-mcp-server": {
"command": "npx",
"args": ["tsx", "src/index.ts"],
"cwd": "/path/to/omise-mcp-alpha",
"env": {
"OMISE_ENVIRONMENT": "test",
"OMISE_PUBLIC_KEY": "your_public_key",
"OMISE_SECRET_KEY": "your_secret_key"
}
}
}
}Restart your MCP client (Claude Desktop, etc.) and verify:
- β Server Connection: MCP client connects without errors
- β Tools Available: Can see Omise payment tools
- β Basic Test: Try creating a token or customer
Example test in Claude Desktop:
Create a test token with this card:
- Number: 4242424242424242
- Name: Test User
- Expiry: 12/2025
- CVV: 123
// 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: 'customer@example.com',
description: 'Test customer'
});
// Create a card token
const token = await mcpClient.callTool('create_token', {
card: {
name: 'John Doe',
number: '4242424242424242',
expiration_month: 12,
expiration_year: 2025,
security_code: '123'
}
});// 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: 'john@example.com',
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_PUBLIC_KEY |
Omise public key | β | - |
OMISE_SECRET_KEY |
Omise secret key | β | - |
OMISE_ENVIRONMENT |
Environment (test/production) | β | - |
PORT |
Server port | - | 3000 |
HOST |
Server host | - | localhost |
LOG_LEVEL |
Log level | - | info |
LOG_FORMAT |
Log format | - | simple |
RATE_LIMIT_ENABLED |
Enable rate limiting | - | true |
RATE_LIMIT_MAX_REQUESTS |
Maximum requests | - | 100 |
RATE_LIMIT_WINDOW_MS |
Time window (ms) | - | 60000 |
- Access Omise Dashboard
- Create an account or log in
- Get keys from the API Keys section
- Test Environment: Use keys starting with
pkey_test_andskey_test_ - Production Environment: Use keys starting with
pkey_live_andskey_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
β β βββ token-tools.ts # Token-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
β β βββ webhook-tools.ts # Webhook-related tools
β β βββ link-tools.ts # Link-related tools
β β βββ chain-tools.ts # Chain-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
β βββ health-check.ts # Health check
β βββ index.ts # Utility exports
βββ tests/ # Tests
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β βββ auth/ # Authentication tests
β βββ error/ # Error handling tests
β βββ rate-limit/ # Rate limiting tests
β βββ mocks/ # Mocks
β βββ factories/ # Test factories
βββ config/ # Configuration files
β βββ development.env # Development environment
β βββ staging.env # Staging environment
β βββ production.env # Production environment
βββ monitoring/ # Monitoring configuration
β βββ prometheus.yml # Prometheus configuration
β βββ loki-config.yml # Loki configuration
β βββ grafana/ # Grafana configuration
βββ nginx/ # Nginx configuration
βββ 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
# Watch mode
npm run watch# 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
npm run test:rate-limit# Run linting
npm run lint
# Auto-fix
npm run lint:fix# Compile TypeScript
npm run build
# Production build
npm run build:production# Start development environment
docker-compose --env-file config/development.env up -d
# Check logs
docker-compose logs -f omise-mcp-server# Start production environment
docker-compose --env-file config/production.env up -d
# Health check
curl http://localhost:3000/health
curl http://localhost:3000/ready
curl http://localhost:3000/live# Run deployment script
./deploy.sh latest production- URL: http://localhost:9090
- Metrics: CPU, memory, request count, response time
- Alerts: High load, error rate monitoring
- URL: http://localhost:3001
- Login: admin / admin (default)
- Dashboards: System monitoring, application monitoring
# Application logs
docker-compose logs -f omise-mcp-server
# Nginx logs
docker-compose logs -f nginx
# All service logs
docker-compose logs -f- Non-root user: Run containers as non-root user
- Security headers: Proper HTTP header configuration
- Rate limiting: API call restrictions
- Sensitive data masking: Hide sensitive information in logs
- Environment isolation: Complete separation of test and production environments
# Place SSL certificates
mkdir -p nginx/ssl
cp your-cert.pem nginx/ssl/cert.pem
cp your-key.pem nginx/ssl/key.pem# Container security scan
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
aquasec/trivy image omise-mcp-server:latest# Check logs
docker-compose logs omise-mcp-server
# Check environment variables
docker-compose config# Check health check endpoint directly
curl -v http://localhost:3000/health
# Check service connectivity
docker-compose exec omise-mcp-server ping redis# Check memory usage
docker stats
# Remove unnecessary containers
docker system prune -a# Check error logs
docker-compose logs omise-mcp-server | grep ERROR
# Analyze access logs
docker-compose logs nginx | grep "GET /"Create 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
Create a secure card token for payment processing.
Parameters:
card(required): Card informationname(required): Cardholder namenumber(required): Card numberexpiration_month(required): Expiration month (1-12)expiration_year(required): Expiration year (4 digits)city(optional): Billing address citypostal_code(optional): Billing address postal codesecurity_code(optional): Security code (CVV/CVC)
- 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 Webhooks API
- Omise Links API
- Omise Chains API
- Omise Capabilities API
- Model Context Protocol (MCP)
- Docker Documentation
- Docker Compose Documentation
- Prometheus Documentation
- Grafana Documentation
- Redis Documentation
- Loki Documentation
- GitHub Issues: Bug reports and feature requests
- Omise Support: Omise official support
- Community: Developer community
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
- Additional payment method support
- Advanced reporting features
- Performance optimizations
- Enhanced multi-tenant support
- Advanced monitoring features
- Enhanced security features
- Total Tools: 51
- Supported APIs: 11 categories
- Test Coverage: 95%+
- TypeScript: 100%
- Docker Support: β
- Monitoring Support: β
Omise MCP Server - Achieve secure and efficient payment processing! π