Skip to main content
Glama
@deonpay/mcp-server

@deonpay/mcp-server

by hectortemich

@deonpay/mcp-server

npm version License: MIT Node.js

Talk to your DeonPay merchant account from Claude Desktop, Cursor, Continue and any other MCP-compatible AI host.


What is this?

The Model Context Protocol (MCP) is an open standard that lets large language models call structured tools on your behalf. This package is the official MCP server for DeonPay — Mexico's modern payments platform — wrapping the DeonPay Public API v1 as a set of typed tools your AI assistant can use to read transactions, create payment links, inspect subscriptions, look up customers and pull business metrics, all without leaving the chat.

It runs locally on your machine, talks to DeonPay over HTTPS using a token you generate from the dashboard, and exposes 20 well-described tools the LLM can pick from.


Related MCP server: aba-payway-mcp

Quick start

1. Generate an MCP token in the DeonPay dashboard

Open https://deonpay.mx/dashboard/settings/mcp-connections, pick the permissions the assistant should have (start with read-only) and copy the token. The token is shown only once — keep it safe.

2. Add the server to your MCP host

For Claude Desktop, edit your config file:

OS

Path

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Linux

~/.config/Claude/claude_desktop_config.json

Add the deonpay entry to the mcpServers block:

{
  "mcpServers": {
    "deonpay": {
      "command": "npx",
      "args": ["-y", "@deonpay/mcp-server"],
      "env": {
        "DEONPAY_API_TOKEN": "dp_paste_your_token_here"
      }
    }
  }
}

3. Restart Claude Desktop

Quit and re-open Claude Desktop. You should see "deonpay" listed under the tools icon in any new conversation.

That's it. Try asking: "How much did I sell yesterday on DeonPay?"


Configuration

All configuration is via environment variables.

Variable

Required

Default

Description

DEONPAY_API_TOKEN

yes

—

Your DeonPay API token (dp_...). Generate from Settings -> MCP Connections.

DEONPAY_BASE_URL

no

https://deonpay.mx

Override for self-hosted or staging deployments.

DEONPAY_TIMEOUT_MS

no

30000

Request timeout in milliseconds.

DEONPAY_DEBUG

no

0

Set to 1 to log every HTTP request/response to stderr.

Full Claude Desktop example

{
  "mcpServers": {
    "deonpay": {
      "command": "npx",
      "args": ["-y", "@deonpay/mcp-server"],
      "env": {
        "DEONPAY_API_TOKEN": "dp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "DEONPAY_BASE_URL": "https://deonpay.mx",
        "DEONPAY_DEBUG": "0"
      }
    }
  }
}

Available tools

All 20 tools are prefixed with deonpay_ so your assistant can find them quickly when you mention DeonPay in a prompt.

Read

Tool

Wraps

Purpose

deonpay_get_merchant_metrics

GET /v1/merchant/metrics

Headline KPIs: revenue, conversion, MRR, churn, revenue mix.

deonpay_list_transactions

GET /v1/transactions

Filter and paginate transactions.

deonpay_get_transaction

GET /v1/transactions/{id}

Full transaction with NetPay timeline.

deonpay_list_links

GET /v1/links

List payment links.

deonpay_get_link

GET /v1/links/{id}

Single link by UUID or short_code.

deonpay_list_link_transactions

GET /v1/links/{id}/transactions

All payments for a link.

deonpay_list_products

GET /v1/products

Catalog listing.

deonpay_get_product

GET /v1/products/{id}

Product by UUID or SKU.

deonpay_list_subscriptions

GET /v1/subscriptions

Subscription PLANS (templates).

deonpay_get_subscription

GET /v1/subscriptions/{id}

Plan with stats and recent charges.

deonpay_list_customer_subscriptions

GET /v1/customer-subscriptions

Per-customer subscription rows.

deonpay_get_customer_subscription

GET /v1/customer-subscriptions/{id}

Subscriber detail with last 20 charges.

deonpay_list_customers

GET /v1/customers

Customer list with revenue stats.

deonpay_get_customer

GET /v1/customers/{email}

Customer profile by email.

Write (safe)

Tool

Wraps

Purpose

deonpay_create_link

POST /v1/links

Create a payment link.

deonpay_update_link

PATCH /v1/links/{id}

Update an existing link (merge customization).

deonpay_create_checkout_session

POST /v1/checkout/sessions

Stripe-style ephemeral checkout.

deonpay_create_product

POST /v1/products

Add a product to the catalog.

deonpay_update_product

PATCH /v1/products/{id}

Update product price, stock, status.

deonpay_create_subscription

POST /v1/subscriptions

Create a recurring plan template.

Not exposed in v0.1 (by design)

These DeonPay endpoints are intentionally NOT wrapped yet because the failure mode is destructive or irreversible:

  • Refunds (POST /v1/transactions/{id})

  • Subscription cancellations (POST /v1/customer-subscriptions/{id}/cancel)

  • Link / product deletes (DELETE /v1/links/{id}, DELETE /v1/products/{id})

  • Checkout session cancellation (PATCH /v1/checkout/sessions/{id})

  • Subscription plan updates (PATCH /v1/subscriptions/{id})

These will land in a future release behind an explicit DEONPAY_ENABLE_DESTRUCTIVE=1 flag.


Example prompts

Try these in Claude Desktop after installing the server:

  • "Show me my payment links from this week."

  • "How much did I sell yesterday in MXN?"

  • "What is my MRR right now?"

  • "Find the customer who has spent the most in the last 90 days."

  • "List all subscribers on past_due status and tell me what their plans look like."

  • "Create a payment link for $500 MXN called 'Consulta nutricional'."

  • "Add a product called 'Gym Class' at $250 MXN to my catalog."

  • "Create a monthly subscription plan named 'Premium' for $299 MXN with 7 trial days."

  • "Why did transaction 550e8400-e29b-41d4-a716-446655440000 fail? Show me the NetPay timeline."

  • "Pause the link with short_code abc123xy until further notice."

The assistant will pick the right tool, fill in the parameters and report back.


Amounts and currency

DeonPay handles all amounts in centavos (1 MXN = 100). When you write "create a link for $500", the assistant translates it to amount: 50000. When the API returns total_revenue: 1845000, that's $18,450.00 MXN. The tool descriptions remind the LLM of this on every call.


Troubleshooting

"DEONPAY_API_TOKEN is required"

The server could not find the token in its environment. Check that the env block in claude_desktop_config.json is at the same level as command/args, and that you fully restarted Claude Desktop after editing the file.

"[unauthorized 401] DeonPay rejected the API token"

The token is invalid, revoked, or its environment doesn't match the data you're querying. Re-issue from Settings -> MCP Connections and replace the value in your config.

"[forbidden 403] DeonPay denied access"

The token is valid but it doesn't carry the permission required for that tool. Edit the token in the dashboard and grant the missing permission (the error message names it).

"No tool named deonpay_..."

The host hasn't loaded the server. Confirm the mcpServers block is valid JSON, restart the host, and look at the host's logs (Claude Desktop -> Help -> Show Logs) for startup errors.

"Could not reach DeonPay at https://..."

Network or DNS issue. Verify DEONPAY_BASE_URL is reachable from your machine (curl -I $DEONPAY_BASE_URL).

Verbose logging

Set DEONPAY_DEBUG=1 in the env block. Every HTTP request and response is then printed to the host's log file (stderr).


Security

  • The token is stored in plain text inside claude_desktop_config.json. Treat that file like an SSH key — back it up encrypted, never commit it to git.

  • Tokens have granular permissions. For an LLM that should only read data, create a token with *.read permissions only — that mechanically prevents the assistant from creating links or charging cards.

  • Tokens are environment-scoped (sandbox vs production). For experimentation, generate a sandbox token first and switch later.

  • The server only sends requests to the host you configure in DEONPAY_BASE_URL. There is no telemetry and no third-party network call.


Development

git clone https://github.com/hectortemich/deonpay-mcp-server.git
cd deonpay-mcp-server
npm install
npm run build       # tsup -> dist/{index.js,index.cjs,index.d.ts}
npm run typecheck   # tsc --noEmit
npm run lint        # eslint + @typescript-eslint
DEONPAY_API_TOKEN=dp_... node dist/index.js   # run locally over stdio

The codebase is organized so each tool category lives in src/tools/<category>.ts with a register* function. Adding a new tool is a one-file change plus a registration call in src/tools/index.ts.


Contributing

PRs welcome. Please:

  1. Open an issue first for new tools so we can align on naming and scope.

  2. Match the existing tool description style — rich, English, with explicit notes on units (centavos), path encoding, and side effects.

  3. Run npm run lint && npm run typecheck && npm run build before submitting.


License

MIT - see LICENSE.

Available Tools

20 tools
deonpay_create_checkout_sessionCreate a checkout sessionA

Create an ephemeral checkout session (Stripe-style). Use this when integrating an e-commerce flow: the user wants a one-time payment URL tied to a specific cart and a success_url to land on after payment. The response contains url (where to redirect the customer) and session_id (used to look up the session later). Amounts are in CENTAVOS. Mode defaults to 'redirect' — use 'embedded' or 'modal' only if the calling app already supports those flows. The session expires by default in 30 minutes (override with expires_in, range 5..1440).

Inputs: line_items (required), success_url (required), cancel_url, mode, +14 more.

deonpay_create_productCreate a productA

Create a new product in the catalog. Use this when the user says 'add a product called X for $Y' or wants to register inventory items they'll later attach to payment links / checkout sessions. unit_amount is in CENTAVOS and must be at least 1000 ($10.00 MXN minimum on creation). SKU must be unique within the merchant. To track stock, set stock_tracking=true AND provide stock_quantity (>= 0).

Inputs: name (required), unit_amount (required), description, currency, +6 more.

deonpay_create_subscriptionCreate a subscription planA

Create a new subscription PLAN (template). Use this when the user wants to set up a recurring charge: 'create a $299 monthly plan called Premium'. Required: name, amount (centavos, min 100 = $1 MXN), interval_type. Important: in production the merchant must have an On-Demand NetPay key configured for the active environment, otherwise this returns ondemand_key_missing. trial_days > 0 enables a free trial period (charges a $10 MXN card-validation tx on the first day to verify the card). Optional flags allow_customer_cancel/pause/advance_payments control the customer self-service portal.

Inputs: name (required), amount (required), interval_type (required), description, +12 more.

deonpay_get_customerGet customer details by emailA

Fetch a customer's full profile by email. Returns basic info, saved_cards (safe metadata only — never the vault token), active_subscriptions (status active/trialing/past_due/paused), and the last 20 transactions (excluding $10 MXN card-validation charges). Use this when the user asks 'show me everything about cliente@x.com' or 'what cards does this customer have on file'. The email is URL-encoded automatically — pass the plain email.

Inputs: email (required), environment.

deonpay_get_customer_subscriptionGet customer subscription detailsA

Fetch a single customer subscription by UUID. Includes the plan denormalized, the last 20 recurring charges (each with status success/failed/skipped/completed, charge_type auto/manual/renewal_link, attempt_number, error_message and timestamps), and cancellation flags. Use this when investigating a specific subscriber's history or a failed charge ('why did Juan's subscription go past_due?').

Inputs: id (required).

deonpay_get_merchant_metricsGet merchant metricsA

Fetch a curated set of business metrics for the merchant. Use this as the FIRST tool for high-level questions: 'how much have I sold this month', 'what is my MRR', 'how is my conversion rate trending', 'how many active subscribers do I have'. Returns: revenue (gross/net/refunded in centavos), transactions (total/successful/failed/conversion_rate as %/average_ticket in centavos), subscriptions snapshot (active_subscribers, trialing_subscribers, past_due, mrr in centavos, churn_rate as %), and revenue_mix (recurring vs one_time, in centavos). IMPORTANT: subscriptions.active/trialing/past_due AND mrr are SNAPSHOTS — they ignore period. mrr is always a 30-day run-rate. revenue, transactions, churn_rate and revenue_mix DO honor period.

Inputs: period, environment.

deonpay_get_productGet product detailsA

Fetch a single product by UUID OR by SKU (if you pass a non-UUID string the API resolves it as a SKU). Returns name, description, unit_amount in centavos, currency, image_url, sku, is_active, stock_tracking, stock_quantity and metadata.

Inputs: id (required).

deonpay_get_subscriptionGet subscription plan detailsA

Fetch a single subscription plan by UUID, including aggregated stats (active_subscribers, total_subscribers) and the most recent 10 recurring charges across all subscribers. Use this when the user wants a quick health view of a specific plan ('how is the Premium plan doing this month'). For per-subscriber detail use deonpay_list_customer_subscriptions filtered by subscription_id.

Inputs: id (required).

deonpay_get_transactionGet transaction detailsA

Fetch the full detail of a single transaction by UUID. Returns everything in the list view PLUS the NetPay timeline (each step in the charge / 3DS flow with duration_ms and error info), netpay charge_id / transaction_token, full metadata, refund details (when applicable), and IP/user-agent of the payer. Use this when debugging a failure, building a refund decision, or when the user asks 'what happened with transaction X'.

Inputs: id (required).

deonpay_list_customersList customersA

List the merchant's customers (people who have completed at least one non-validation transaction). Use this for questions like 'who are my top customers', 'how many recurring buyers do I have', 'find customers with email containing X'. Sort by 'recent' (last transaction, default), 'revenue' (most spent), or 'transactions' (most active). Each row includes email, name, phone, first_seen_at, last_seen_at, total_transactions, total_spent in centavos, active_subscriptions and saved_cards_count.

Inputs: page, limit, search, sort, +1 more.

deonpay_list_customer_subscriptionsList customer subscriptionsA

List individual customer subscriptions (the per-customer rows, NOT the plans). Use this to answer 'who is currently subscribed to plan X', 'how many trialing subscribers do I have', or 'find subscribers on past_due'. Filter by subscription_id (the plan), customer_email (exact, case-insensitive), and status (active/paused/cancelled/past_due/completed/trialing). Each item includes the plan denormalized as a subscription sub-object, charges_count, total_charged in centavos, current_period_start/end, next_charge_at, and cancel_at_period_end.

Inputs: page, limit, subscription_id, customer_email, +2 more.

deonpay_list_productsList productsA

List products in the merchant catalog. Use this when the user asks 'what products do I have', 'find product X', or wants to inspect inventory. Supports search across name/sku/description, filtering by is_active, and basic sorting (sort_by + sort_order). Each item includes id, name, unit_amount in centavos, currency, sku, is_active, stock_tracking and stock_quantity.

Inputs: page, limit, search, is_active, +2 more.

deonpay_list_subscriptionsList subscription plansA

List subscription PLANS (the recurring templates, not individual subscribers). Use this when the user asks 'what subscription plans do I have', 'show me my recurring products', or 'find the Premium plan'. Each item includes id, name, amount in centavos, currency, interval_type (daily/weekly/biweekly/monthly/yearly), interval_count, trial_days, status (active/paused/archived) plus aggregated stats: active_subscribers and total_revenue. Use deonpay_list_customer_subscriptions to drill into actual subscribers of a plan.

Inputs: page, limit, status, search, +1 more.

deonpay_list_transactionsList transactionsA

List transactions for the merchant with rich filtering. Use this for queries like 'how many sales today', 'show failed transactions this week', 'find payments from cliente@x.com', or 'transactions over $1000 MXN with Visa cards'. Filters include status, source_type (link/checkout), customer_email (partial match), merchant_reference (exact), card_brand (visa/mastercard/amex), date_from/to (ISO), and amount_min/max (centavos). Returns paginated results with customer, card, amount, payment_link summary and timestamps. Amounts in centavos.

Inputs: page, limit, status, source_type, +9 more.

deonpay_update_productUpdate a productA

Update an existing product (resolved by UUID or SKU). Only fields you send are changed. Use this for price adjustments, renaming, toggling is_active, updating stock_quantity, or swapping the image_url. Note: under the hood the API uses HTTP PATCH (not PUT).

Inputs: id (required), name, description, unit_amount, +7 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action (e.g., create, get, list, update) for specific entities like products, links, subscriptions, customers, and transactions. Even similar-sounding tools (e.g., get_subscription vs get_customer_subscription) are clearly differentiated by scope (plan vs individual subscriber).

    Naming Consistency5/5

    All tools follow a consistent `deonpay_<verb>_<resource>` pattern in snake_case (e.g., deonpay_create_product, deonpay_list_transactions). There are no deviations, making the convention predictable and easy to navigate.

    Tool Count5/5

    20 tools cover the key operations for a payment processing domain (CRUD for products, links, subscriptions, customers, transactions, plus metrics and checkout). The count is well-scoped—neither excessive nor insufficient—for the apparent purpose.

    Completeness4/5

    The tool surface covers core workflows (create/read/update/list for products and links, list/read for customers and transactions, subscription management). Minor gaps exist: lack of update_subscription (plans) and cancel customer subscription. Otherwise, the set is thorough.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables MCP-compatible AI tools to create checkouts, generate KHQR codes, check/list transactions, issue refunds, create payment links, and pull exchange rates via ABA Bank's PayWay API.
      12
      12 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP hosts like Claude, VS Code, Cursor, and others to discover payment methods, create payment links, verify payments, inspect invoices, and manage refunds through focused tools, with a guided safe payment workflow and a restricted generic API escape hatch.
      7
      36 npm
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      Enables AI agents to manage merchant accounts, process payments, handle wallets and payouts, and sell digital goods through the wata.pro payment system.
      90
      MIT