Skip to main content
Glama
payments-toolkit-mcp

payments-toolkit-mcp

by ramigs

payments-toolkit-mcp

Минимальный сервер Model Context Protocol (MCP), созданный как практический учебный проект (см. PLAN.md для полного пошагового руководства).

Он предоставляет утилиты проверки платежей в виде инструментов MCP и один статический ресурс — вся логика локальная, без сетевых вызовов и без необходимости в API-ключах.

Инструменты

  • validate_card_number — проверка контрольной суммы Луна для номера карты (только цифры, длина 8-19).

  • detect_card_type — определяет платёжную сеть (Visa, Mastercard, American Express, Discover, Diners Club, JCB) по префиксу IIN/BIN.

  • validate_iban — проверка формата, длины для конкретной страны и контрольной суммы mod-97 по стандарту ISO 13616 для IBAN.

Related MCP server: stripe-mcp-server

Ресурсы

  • card_networks (payments-toolkit://card-networks) — статический JSON-список поддерживаемых платёжных сетей и их диапазонов префиксов.

Предварительные требования

  • Node.js 18+ (проект разрабатывался на v24)

  • pnpm

Настройка

pnpm install
pnpm run build

Использование

Запустите сервер автономно (он ожидает ввода через stdio, так что это в основном для проверки работоспособности):

pnpm run start

Просматривайте и вызывайте инструменты/ресурсы напрямую через локальный веб-интерфейс, без подключения клиента:

pnpm run inspect

Подключение к Claude Code

claude mcp add payments-toolkit-mcp -- node /path/to/payments-toolkit-mcp/dist/index.js
claude mcp list

В сессии Claude Code выполните /mcp, чтобы подтвердить подключение и увидеть обнаруженные инструменты/ресурсы.

Структура проекта

src/
  index.ts                   # composition root: creates the server, wires up transport
  lib/                       # pure validation/lookup logic (no MCP dependency)
    luhn.ts
    card-networks.ts
    iban.ts
    schemas.ts
  tools/                     # one file per registered MCP tool
    validate-card-number.ts
    detect-card-type.ts
    validate-iban.ts
  resources/                 # one file per registered MCP resource
    card-networks.ts

Примечания

  • Никогда не используйте console.log в этом сервере — stdout зарезервирован для потока протокола JSON-RPC через stdio. Для любого отладочного вывода используйте console.error.

Available Tools

3 tools
detect_card_typeDetect Card TypeA

Identifies the card network (Visa, Mastercard, American Express, Discover, Diners Club, JCB) from the card number's IIN/BIN prefix. Accepts digits only (spaces/dashes should be stripped by the caller).

Inputs: cardNumber (required). Returns: network

validate_card_numberValidate Card NumberA

Checks whether a card number passes the Luhn checksum algorithm. Accepts digits only (spaces/dashes should be stripped by the caller).

Inputs: cardNumber (required). Returns: valid

validate_ibanValidate IBANA

Validates an International Bank Account Number (IBAN): checks the country-specific length and the ISO 13616 mod-97 checksum. Spaces are stripped and letters are case-insensitive.

Inputs: iban (required). Returns: valid, country

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: validate_card_number checks Luhn, detect_card_type identifies network via prefix, and validate_iban validates IBAN. No overlap between card validation and IBAN validation, and card type detection is a separate concern.

    Naming Consistency4/5

    All tools follow the verb_noun pattern (validate_*, detect_*), but there's a slight inconsistency: 'validate_card_number' uses 'card_number' while 'detect_card_type' uses 'card_type', but both are clear and consistent in style. Minor deviation from uniform noun usage.

    Tool Count3/5

    With only 3 tools, the server is focused but feels slightly thin for a 'payments-toolkit'. The scope is narrow (validation/detection), but it could benefit from additional related tools like card expiry validation or payment amount validation. However, it's not egregiously under-scoped.

    Completeness3/5

    The server covers card number validation and type detection and IBAN validation, which are core payment validation tasks. However, it omits other common validations (e.g., CVV, expiry date, bank account routing numbers) and any operations beyond validation (e.g., formatting, masking). The gaps are notable but the main validation lifecycle is present.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server for validating JSON against schemas, checking email deliverability, verifying URLs, assessing data quality, and validating API responses using RFC-compliant checks and heuristic analysis.
      8 npm
      31 PyPI
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A local MCP server for Stripe payment operations with 52 tools across 8 domains, featuring built-in PII redaction and strict input validation for safe AI-assisted development workflows.
      52
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that provides AI agents with tools to validate SWIFT MT and ISO 20022 MX payment messages, check BIC/IBAN correctness, and convert between MT and MX formats.
      7
      9 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A fully local, closed-world MCP server that manages, validates, and serves bank-specific ISO 20022 clearing profiles and rule packs, enabling AI agents to discover profiles, fetch them, lint payloads against them, and validate rule-pack definitions.
      4
      35 PyPI
      1
      Apache 2.0