Omise MCP Server

Omise MCP Server

Enables comprehensive payment processing through Omise APIs including charges, customers, transfers, refunds, disputes, recurring payments, and webhooks. Provides 51 tools covering all Omise API functionality for secure payment integration.

Category
访问服务器

README

Omise MCP Server

Version License TypeScript Node.js Docker

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.

🚀 Key Features

💳 Payment Processing

  • 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 Management

  • Customer Information: Create, retrieve, update, and delete customers
  • Card Management: Manage customer card information
  • Metadata: Store custom information

🔄 Transfers & Recipients

  • Transfer Processing: Send money to recipients
  • Recipient Management: Create, verify, and manage recipients
  • Bank Accounts: Manage bank account information

📅 Schedules & Recurring Payments

  • Recurring Payments: Automatic payments based on schedules
  • Occurrence Management: Manage schedule execution
  • Flexible Configuration: Daily, weekly, and monthly schedules

🔍 Monitoring & Analytics

  • Event Management: Track system events
  • Dispute Management: Handle chargebacks
  • Webhooks: Real-time notifications

🔗 Links & Chains

  • Payment Links: Shareable payment links
  • Chain Management: Multi-tenant support
  • Capability Check: API functionality verification

📋 Supported APIs

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

🛠️ Technology Stack

  • 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

🚀 Quick Start

Prerequisites

1. Installation

# Clone the repository
git clone https://github.com/your-org/omise-mcp-server.git
cd omise-mcp-server

# Install dependencies
npm install

2. Environment Setup

# Copy environment configuration file
cp config/development.env .env

# Set environment variables
export OMISE_PUBLIC_KEY=pkey_test_xxxxxxxxxxxxxxxx
export OMISE_SECRET_KEY=skey_test_xxxxxxxxxxxxxxxx
export OMISE_ENVIRONMENT=test

3. Start Development Server

# Start in development mode
npm run dev

# Or start in production mode
npm run build
npm start

4. Verify Installation

# Health check
curl http://localhost:3000/health

# Check available tools
curl http://localhost:3000/tools

📖 Usage

Basic Payment Processing

// 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'
  }
});

Recurring Payment Setup

// 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'
  }
});

Transfer Processing

// 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
});

🔧 Configuration

Environment Variables

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

Obtaining Omise API Keys

  1. Access Omise Dashboard
  2. Create an account or log in
  3. Get keys from the API Keys section
  4. Test Environment: Use keys starting with pkey_test_ and skey_test_
  5. Production Environment: Use keys starting with pkey_live_ and skey_live_

Important: Always use live keys in production and test keys in test environment.

🏗️ Project Structure

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

🧪 Development

Development Environment Setup

# Install development dependencies
npm install

# Start development server
npm run dev

# Watch mode
npm run watch

Testing

# 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

Linting

# Run linting
npm run lint

# Auto-fix
npm run lint:fix

Build

# Compile TypeScript
npm run build

# Production build
npm run build:production

🐳 Docker Deployment

Development Environment

# Start development environment
docker-compose --env-file config/development.env up -d

# Check logs
docker-compose logs -f omise-mcp-server

Production Environment

# 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

Automated Deployment

# Run deployment script
./deploy.sh latest production

📊 Monitoring & Logs

Prometheus Metrics

  • URL: http://localhost:9090
  • Metrics: CPU, memory, request count, response time
  • Alerts: High load, error rate monitoring

Grafana Dashboard

  • URL: http://localhost:3001
  • Login: admin / admin (default)
  • Dashboards: System monitoring, application monitoring

Log Management

# Application logs
docker-compose logs -f omise-mcp-server

# Nginx logs
docker-compose logs -f nginx

# All service logs
docker-compose logs -f

🔒 Security

Security Features

  • 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

SSL/TLS Configuration

# Place SSL certificates
mkdir -p nginx/ssl
cp your-cert.pem nginx/ssl/cert.pem
cp your-key.pem nginx/ssl/key.pem

Security Scanning

# Container security scan
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
  aquasec/trivy image omise-mcp-server:latest

🚨 Troubleshooting

Common Issues

1. Service Won't Start

# Check logs
docker-compose logs omise-mcp-server

# Check environment variables
docker-compose config

2. Health Check Fails

# Check health check endpoint directly
curl -v http://localhost:3000/health

# Check service connectivity
docker-compose exec omise-mcp-server ping redis

3. Memory Issues

# Check memory usage
docker stats

# Remove unnecessary containers
docker system prune -a

Log Analysis

# Check error logs
docker-compose logs omise-mcp-server | grep ERROR

# Analyze access logs
docker-compose logs nginx | grep "GET /"

📚 API Reference

Payment Tools

create_charge

Create a new charge.

Parameters:

  • amount (required): Amount in smallest currency unit
  • currency (required): Currency code (THB, USD, JPY, etc.)
  • description (optional): Charge description
  • customer (optional): Customer ID
  • card (optional): Card ID
  • source (optional): Source ID
  • capture (optional): Capture immediately (default: true)
  • return_uri (optional): Redirect URI
  • metadata (optional): Metadata

retrieve_charge

Retrieve charge information.

Parameters:

  • charge_id (required): Charge ID to retrieve

list_charges

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 filter
  • customer (optional): Customer ID filter

Customer Tools

create_customer

Create a new customer.

Parameters:

  • email (optional): Customer email address
  • description (optional): Customer description
  • card (optional): Card ID
  • metadata (optional): Metadata

retrieve_customer

Retrieve customer information.

Parameters:

  • customer_id (required): Customer ID to retrieve

Token Tools

create_token

Create a secure card token for payment processing.

Parameters:

  • card (required): Card information
    • name (required): Cardholder name
    • number (required): Card number
    • expiration_month (required): Expiration month (1-12)
    • expiration_year (required): Expiration year (4 digits)
    • city (optional): Billing address city
    • postal_code (optional): Billing address postal code
    • security_code (optional): Security code (CVV/CVC)

🔗 External Links

Omise Official Documentation

Technical Documentation

Support

📄 License

This project is licensed under the MIT License.

🤝 Contributing

Contributions to the project are welcome! Please follow these steps:

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Create a Pull Request

Development Guidelines

  • Write code in TypeScript
  • Maintain test coverage
  • Follow ESLint rules
  • Write clear commit messages

📈 Roadmap

v1.1.0 (Planned)

  • [ ] Additional payment method support
  • [ ] Advanced reporting features
  • [ ] Performance optimizations

v1.2.0 (Planned)

  • [ ] Enhanced multi-tenant support
  • [ ] Advanced monitoring features
  • [ ] Enhanced security features

📊 Statistics

  • 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! 🚀

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选