@deonpay/mcp-server

@deonpay/mcp-server

Talk to your DeonPay merchant account from any MCP-compatible AI host. Enables reading transactions, creating payment links, inspecting subscriptions, and more.

Category
访问服务器

README

@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.


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.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选