Skip to main content

A Model Context Protocol (MCP) compatible server that integrates Ant International's Antom payment APIs, enabling AI assistants to handle payment and refund operations seamlessly.

Project description

Antom MCP Server

A Model Context Protocol (MCP) compatible server that integrates Ant International's Antom payment APIs, enabling AI assistants to handle payment and refund operations seamlessly.

Overview

The Antom MCP Server wraps Ant International's Antom payment APIs into standardized MCP tools, allowing AI assistants to securely process payment-related operations during conversations. With this server, you can create payment sessions, query transaction status, handle refunds, and more directly through AI interactions.

Features

💳 Payment Operations

  • Create Payment Session (create_payment_session): Generate payment sessions for client-side SDK integration
  • Query Payment Details (query_payment_detail): Retrieve transaction status and information for submitted payment requests
  • Cancel Payment (cancel_payment): Cancel payments when results are not returned within expected timeframes

💰 Refund Operations

  • Create Refund (create_refund): Initiate full or partial refunds against successful payments
  • Query Refund Details (query_refund_detail): Check refund status for previously submitted refund requests

Prerequisites

Before using the Antom MCP Server, ensure you have:

  • Python 3.11 or higher
  • uv (recommended package manager) or pip
  • Valid Antom Merchant Account with:
    • Merchant Client ID (CLIENT_ID)
    • Merchant RSA Private Key (MERCHANT_PRIVATE_KEY)
    • Alipay RSA Public Key (ALIPAY_PUBLIC_KEY)
    • Payment Redirect Return URL (PAYMENT_REDIRECT_URL)
    • Payment Notification Callback URL (PAYMENT_NOTIFY_URL)

Quick Start

1. Installation

Direct Usage with uvx (Recommended)

uvx ant-intl-antom-mcp

Install from Source

git clone https://github.com/alipay/global-antom-mcp.git
cd global-antom-mcp
uv install

2. MCP Client Configuration

Add the following configuration to your MCP client:

{
  "mcpServers": {
    "antom-mcp-server": {
      "command": "uvx",
      "args": ["ant-intl-antom-mcp"],
      "env": {
        "GATEWAY_URL": "https://open-sea-global.alipay.com",
        "CLIENT_ID": "your_client_id_here",
        "MERCHANT_PRIVATE_KEY": "your_merchant_private_key_here",
        "ALIPAY_PUBLIC_KEY": "your_alipay_public_key_here",
        "PAYMENT_REDIRECT_URL": "/",
        "PAYMENT_NOTIFY_URL": "https://your-domain.com/payment/notify"
      }
    }
  }
}

3. Environment Variables

Variable Required Description
GATEWAY_URL Antom API gateway URL (defaults to https://open-sea-global.alipay.com)
CLIENT_ID Merchant client ID for identity verification
MERCHANT_PRIVATE_KEY Merchant RSA private key for request signing
ALIPAY_PUBLIC_KEY Alipay RSA public key for response verification
PAYMENT_REDIRECT_URL The user is redirected to after the payment is completed
PAYMENT_NOTIFY_URL Payment result notification callback URL

Integration Example

Here's how you can integrate the Antom MCP Server with your AI agent (using QwenAgent as an example):

import os
from qwen_agent.agents import Assistant

# Configure the MCP server as a tool
tools = [{
    "mcpServers": {
        "antom-mcp-server": {
            "command": "uvx",
            "args": ["ant-intl-antom-mcp"],
            "env": {
                "CLIENT_ID": os.getenv('CLIENT_ID'),
                "MERCHANT_PRIVATE_KEY": os.getenv('MERCHANT_PRIVATE_KEY'),
                "ALIPAY_PUBLIC_KEY": os.getenv('ALIPAY_PUBLIC_KEY'),
                "GATEWAY_URL": "https://open-sea-global.alipay.com",
                "PAYMENT_REDIRECT_URL": "/",
                "PAYMENT_NOTIFY_URL": "https://your-domain.com/notify"
            }
        }
    }
}]

# Create your AI assistant with payment capabilities
bot = Assistant(
    llm={'model': 'qwen-max', 'api_key': 'your-api-key'},
    function_list=tools,
    system_message="You are a helpful assistant with payment processing capabilities."
)

Changelog

See CHANGELOG.md for a detailed history of changes.

License

This project is licensed under the MIT License.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ant_intl_antom_mcp-1.0.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ant_intl_antom_mcp-1.0.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file ant_intl_antom_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: ant_intl_antom_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ant_intl_antom_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 85241503afe49cf7d02a567d9238538961a89b0e217e73f85a8194ab2dc2d9e2
MD5 33eded0f5ddbe5a004a58c272684a83d
BLAKE2b-256 148113377b8758c15c91a77b00c28ec1cb9b3a51833aa6d5d92bfac2ab454500

See more details on using hashes here.

File details

Details for the file ant_intl_antom_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ant_intl_antom_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c830451a8da73c3ce6d15560b4aa98ec019d46851fc4b4286fb8f11fc058a164
MD5 1dc501751b2b2fd5ba20118d9d7f1889
BLAKE2b-256 d8837900a4da23c2782776e8dd66863b5b14281cf7ba40f0c8396df99bafb10c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page