Skip to main content
Glama
Crypto Payment MCP Server

Crypto Payment MCP Server

by syamai

Crypto Payment MCP Server

npm version License: MIT

A Model Context Protocol (MCP) server for cryptocurrency payment integration. This server provides tools for managing crypto payments, checking balances, tracking prices, and validating wallet addresses across multiple blockchain networks.

Features

  • πŸ” Payment Management - Create payment requests, check status, view history

  • πŸ’° Balance Tracking - Query user balances in real-time

  • πŸ“Š Price Feeds - Real-time cryptocurrency prices from Binance API

  • πŸ”— Multi-Network Support - Bitcoin, Ethereum, BSC, Solana, Tron, XRP

  • βœ… Address Validation - Validate wallet addresses for each network

  • πŸ”„ Currency Conversion - Convert between crypto and USD

  • πŸ”‘ Flexible Authentication - Backend API or direct platform access

Related MCP server: perly-pay-mcp

Supported Networks

Network

ID

Supported Tokens

Bitcoin Testnet

btc_test

BTC

Ethereum Sepolia

eth_sepolia

ETH, USDT, USDC

BSC Testnet

bsc_test

BNB, USDT, USDC, BUSD, MATIC, DOGE

Solana Devnet

sol_test

SOL

Tron Shasta

tron_test

TRX, USDT, USDC

Ripple Testnet

xrp_test

XRP

Installation

npm install -g @syamai/crypto-payment-mcp

Option 2: Clone from GitHub

git clone https://github.com/syamai/crypto-payment-mcp.git
cd crypto-payment-mcp
npm install
npm run build

Option 3: Use npx (No installation required)

npx @syamai/crypto-payment-mcp

Configuration

Environment Variables

Create a .env file in the project root:

cp .env.example .env

Basic Configuration (Backend API Mode)

# Casino Backend API URL
API_BASE_URL=http://localhost:3001/v2

# API Timeout in milliseconds
API_TIMEOUT=30000

Advanced Configuration (Direct Platform Access)

For direct integration with payment platform (bypassing backend):

# Operator credentials
OPERATOR_ID=your-operator-id
OPERATOR_SECRET=your-operator-secret

# Payment platform URLs
PAYMENT_PLATFORM_API_URL=https://payment-platform.example.com/api
PAYMENT_PLATFORM_DOMAIN_URL=https://payment.example.com

# Webhook signature verification (RSA public key)
OPERATOR_PUBLIC_KEY=-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...
-----END PUBLIC KEY-----

Configuration Priority

Configuration

Behavior

API_BASE_URL only

Uses backend API (casino-tele-backend) for payment operations

OPERATOR_* variables set

Enables direct platform API access (bypasses backend)

Usage with Claude Code

Method 1: Global Settings

Add to your ~/.claude/settings.json:

{
  "mcpServers": {
    "crypto-payment": {
      "command": "npx",
      "args": ["@syamai/crypto-payment-mcp"],
      "env": {
        "API_BASE_URL": "https://your-api-server.com/v2"
      }
    }
  }
}

Method 2: Project-level Configuration

Create .mcp.json in your project root:

{
  "mcpServers": {
    "crypto-payment": {
      "command": "npx",
      "args": ["@syamai/crypto-payment-mcp"],
      "env": {
        "API_BASE_URL": "https://your-api-server.com/v2",
        "OPERATOR_ID": "your-operator-id",
        "OPERATOR_SECRET": "your-operator-secret",
        "PAYMENT_PLATFORM_API_URL": "https://platform-api.example.com"
      }
    }
  }
}

Method 3: Local Development

If you cloned the repository:

{
  "mcpServers": {
    "crypto-payment": {
      "command": "node",
      "args": ["/path/to/crypto-payment-mcp/dist/index.js"],
      "env": {
        "API_BASE_URL": "http://localhost:3001/v2"
      }
    }
  }
}

Available Tools

Payment Tools

Tool

Description

Auth Required

crypto_request_payment

Create a new payment request and get payment URL

Yes

crypto_get_payment_status

Check the status of a specific payment

Yes

crypto_get_user_balance

Get user's current USD balance

Yes

crypto_get_payment_history

List payment history with pagination

Yes

Network & Token Tools

Tool

Description

Auth Required

crypto_list_networks

List supported blockchain networks

No

crypto_list_tokens

List supported tokens for a network

No

crypto_get_token_info

Get detailed token information with price

No

Price Tools

Tool

Description

Auth Required

crypto_get_token_price

Get current USD price for a token

No

crypto_get_multiple_prices

Get prices for multiple tokens at once

No

crypto_convert_amount

Convert between token and USD amounts

No

Utility Tools

Tool

Description

Auth Required

crypto_validate_address

Validate a wallet address format

No

crypto_health_check

Check API server connectivity

No

Tool Examples

Create Payment Request

{
  "tool": "crypto_request_payment",
  "arguments": {
    "authToken": "eyJhbGciOiJIUzI1NiIs..."
  }
}

Response:

{
  "paymentId": "pay_abc123",
  "paymentUrl": "https://payment.example.com/?paymentId=pay_abc123"
}

Get Token Price

{
  "tool": "crypto_get_token_price",
  "arguments": {
    "symbol": "BTC"
  }
}

Response:

{
  "symbol": "BTC",
  "price": 94703.99,
  "priceUsd": 94703.99,
  "timestamp": 1704672000000
}

List Networks

{
  "tool": "crypto_list_networks",
  "arguments": {
    "type": "deposit"
  }
}

Response:

{
  "networks": [
    {
      "id": "bsc_test",
      "name": "Binance Smart Chain Testnet",
      "symbol": "BNB",
      "icon": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
      "canDeposit": true,
      "canWithdraw": true
    }
  ],
  "count": 6
}

List Tokens for Network

{
  "tool": "crypto_list_tokens",
  "arguments": {
    "network": "bsc_test",
    "type": "deposit"
  }
}

Response:

{
  "network": "bsc_test",
  "tokens": [
    {
      "symbol": "BNB",
      "name": "Binance Coin",
      "decimals": 18,
      "icon": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
      "canDeposit": true,
      "canWithdraw": true
    },
    {
      "symbol": "USDT",
      "name": "Tether USD",
      "decimals": 6,
      "canDeposit": true,
      "canWithdraw": true
    }
  ],
  "count": 6
}

Convert Amount

{
  "tool": "crypto_convert_amount",
  "arguments": {
    "symbol": "ETH",
    "amount": 1.5,
    "direction": "toUsd"
  }
}

Response:

{
  "from": { "symbol": "ETH", "amount": 1.5 },
  "to": { "symbol": "USD", "amount": 4725.50 },
  "direction": "toUsd"
}

Validate Address

{
  "tool": "crypto_validate_address",
  "arguments": {
    "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f8B4b2",
    "network": "eth"
  }
}

Response:

{
  "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f8B4b2",
  "network": "eth",
  "valid": true,
  "reason": "Address format is valid"
}

Get Multiple Prices

{
  "tool": "crypto_get_multiple_prices",
  "arguments": {
    "symbols": ["BTC", "ETH", "BNB", "SOL"]
  }
}

Response:

{
  "prices": [
    { "symbol": "BTC", "price": 94703.99, "priceUsd": 94703.99 },
    { "symbol": "ETH", "price": 3150.25, "priceUsd": 3150.25 },
    { "symbol": "BNB", "price": 612.80, "priceUsd": 612.80 },
    { "symbol": "SOL", "price": 185.42, "priceUsd": 185.42 }
  ],
  "count": 4,
  "timestamp": 1704672000000
}

Development

Setup

git clone https://github.com/syamai/crypto-payment-mcp.git
cd crypto-payment-mcp
npm install

Run in Development Mode

npm run dev

Build

npm run build

Test Locally

# Test tools list
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node dist/index.js

# Test specific tool
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"crypto_list_networks","arguments":{"type":"deposit"}}}' | node dist/index.js

Architecture

src/
β”œβ”€β”€ index.ts                    # MCP server entry point
β”œβ”€β”€ config/
β”‚   └── blockchain.ts           # Network and token configurations
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ payment.service.ts      # Backend API client
β”‚   β”œβ”€β”€ platform.service.ts     # Direct platform API client
β”‚   └── price.service.ts        # Binance price fetching
└── tools/
    β”œβ”€β”€ definitions.ts          # Tool schema definitions (12 tools)
    └── handlers.ts             # Tool execution handlers

Security Notes

  • Auth tokens are passed per-request and never stored permanently

  • Tokens are cleared immediately after API calls complete

  • Use environment variables for sensitive configuration

  • Never commit .env files to version control

  • OPERATOR_SECRET is hashed with SHA-512 before transmission

  • Webhook signatures use RSA-SHA512 for verification

API Backend Requirements

This MCP server is designed to work with a payment API backend that provides:

Endpoint

Method

Description

/payment/payment-id

GET

Create payment request

/payment/status/:paymentId

GET

Get payment status

/payment/user/balance

GET

Get user balance

/payment/authenticate

GET

Authenticate user

/cashier/history

GET

Get payment history

/health

GET

Health check

Webhook Events (for direct platform integration)

Event

Description

DEPOSIT_PROCESSING

Deposit detected on blockchain

DEPOSIT_COMPLETED

Deposit confirmed and credited

WITHDRAW_REQUESTED

Withdrawal request created

WITHDRAW_APPROVED

Withdrawal approved by admin

WITHDRAW_PROCESSING

Withdrawal being processed

WITHDRAW_COMPLETED

Withdrawal sent on blockchain

WITHDRAW_REJECTED

Withdrawal rejected

WITHDRAW_FAILED

Withdrawal failed

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository

  2. Create your 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. Open a Pull Request

License

MIT License - see the LICENSE file for details.

Changelog

v1.0.0

  • Initial release

  • 12 MCP tools for crypto payment operations

  • Support for 6 blockchain networks

  • Real-time price feeds from Binance

  • Address validation for all supported networks

  • Optional direct platform API integration

Available Tools

12 tools
crypto_convert_amountB

토큰 κΈˆμ•‘μ„ USD둜 λ³€ν™˜ν•˜κ±°λ‚˜, USDλ₯Ό 토큰 κΈˆμ•‘μœΌλ‘œ λ³€ν™˜ν•©λ‹ˆλ‹€.

Inputs: amount (required), symbol (required), direction (required).

crypto_get_multiple_pricesB

μ—¬λŸ¬ ν† ν°μ˜ ν˜„μž¬ 가격을 ν•œλ²ˆμ— μ‘°νšŒν•©λ‹ˆλ‹€.

Inputs: symbols (required).

crypto_get_payment_historyC

μ‚¬μš©μžμ˜ 결제 내역을 μ‘°νšŒν•©λ‹ˆλ‹€.

Inputs: authToken (required), page, limit, status.

crypto_get_payment_statusC

νŠΉμ • 결제의 μƒνƒœλ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.

Inputs: authToken (required), paymentId (required).

crypto_get_token_infoC

νŠΉμ • ν† ν°μ˜ 상세 정보λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.

Inputs: symbol (required).

crypto_get_token_priceB

νŠΉμ • ν† ν°μ˜ ν˜„μž¬ USD 가격을 μ‘°νšŒν•©λ‹ˆλ‹€.

Inputs: symbol (required).

crypto_get_user_balanceA

μ‚¬μš©μžμ˜ ν˜„μž¬ μž”μ•‘μ„ μ‘°νšŒν•©λ‹ˆλ‹€. USD κΈ°μ€€ μž”μ•‘μ„ λ°˜ν™˜ν•©λ‹ˆλ‹€.

Inputs: authToken (required).

crypto_health_checkB

API μ„œλ²„ μ—°κ²° μƒνƒœλ₯Ό ν™•μΈν•©λ‹ˆλ‹€.

Inputs: no named parameters.

crypto_list_networksC

μ§€μ›ν•˜λŠ” 블둝체인 λ„€νŠΈμ›Œν¬ λͺ©λ‘μ„ μ‘°νšŒν•©λ‹ˆλ‹€.

Inputs: type.

crypto_list_tokensC

νŠΉμ • λ„€νŠΈμ›Œν¬μ—μ„œ μ§€μ›ν•˜λŠ” 토큰 λͺ©λ‘μ„ μ‘°νšŒν•©λ‹ˆλ‹€.

Inputs: network (required), type.

crypto_request_paymentB

μƒˆλ‘œμš΄ 크립토 결제 μš”μ²­μ„ μƒμ„±ν•©λ‹ˆλ‹€. paymentId와 결제 νŽ˜μ΄μ§€ URL을 λ°˜ν™˜ν•©λ‹ˆλ‹€.

Inputs: authToken (required).

crypto_validate_addressC

μ§€κ°‘ μ£Όμ†Œμ˜ μœ νš¨μ„±μ„ κ²€μ¦ν•©λ‹ˆλ‹€.

Inputs: address (required), network (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools target clearly distinct operations (request payment, check status, list networks/tokens, validate address), so an agent can usually pick correctly. The only mild overlap is in the pricing group: crypto_get_token_price, crypto_get_multiple_prices, and crypto_convert_amount all deal with token/USD valuation, though descriptions differentiate single-price lookup, batch lookup, and unit conversion.

    Naming Consistency5/5

    All 12 tools use the same crypto_ prefix followed by a consistent verb_noun pattern (crypto_get_*, crypto_list_*, crypto_request_payment, crypto_validate_address). No camelCase/snake_case mixing or inconsistent verb styles.

    Tool Count5/5

    12 tools is squarely in the well-scoped range for a payment server, and each tool maps to a concrete capability (payments, balances, networks, tokens, prices, address validation, health). Nothing appears redundant or filler-like beyond the intentional batch price helper.

    Completeness4/5

    The core payment lifecycle is covered: create request, poll status, list history, check balance, plus the supporting metadata (networks, tokens, prices, address validation). Gaps exist around cancellation/refund of a payment request, fee estimation, and looking up an on-chain transaction by hash, but these are minor and workable around.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables blockchain payment operations across multiple networks including Base, Ethereum, BSC, Polygon, and Avalanche. Supports balance queries, token transfers, transaction tracking, wallet management, and gas fee estimation with built-in security limits.
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables an AI coding assistant to create and manage products, prices, payment links, invoices, customers, subscriptions, entitlements, refunds, and webhooks, simulate test payments, read payments and receipts, and verify buyer access through a crypto payment API.
      38
      56 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to create, look up, list, and cancel crypto invoices, manage reusable payment links, check USDT and TRX rates, and simulate test payments through a secure API.
      7
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to accept non-custodial crypto payments by creating hosted checkout sessions and invoices, tracking payments and wallets, registering and verifying signed webhooks, purchasing prepaid credits, and querying or exporting the book of record. Test-mode payment simulation lets agents verify the full flow end to end.
      MIT