TgPay Merchant API

Accept crypto payments via the TgPay Merchant API — invoices, subscriptions, webhooks.

我该使用它吗

质量与安全性

A
描述质量
92%
模式完整度
79%
命名质量
97%
投毒风险
100%
权限匹配度
100%
协议合规性
100%

基于对工具定义和协议合规性的自动分析。

上下文开销

~2,134token 数(工具定义)
~731 B典型响应大小
对注意力有中等影响(占 128k 上下文窗口的 1.67%)

这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。

安装

一键安装

将以下内容添加到你的 `claude_desktop_config.json` 文件中:

{
  "mcpServers": {
    "merchant-api": {
      "url": "https://crypto.tgpaybot.com/mcp"
    }
  }
}

远程端点

https://crypto.tgpaybot.com/mcpstreamable-http
https://app.tgcryptopay.com/mcpstreamable-http
https://app.tgpaycrypto.com/mcpstreamable-http

它能做什么

工具清单

工具(20)

🟢 只读🟡 写入🔴 删除⚪ 未知
🟢get_docs(topic)

Read a TgPay Merchant API integration doc. START HERE before integrating: topics quickstart, invoices, subscriptions, transfers-checks, webhooks, errors.

输入模式

{
  "type": "object",
  "properties": {
    "topic": {
      "type": "string",
      "description": "quickstart | invoices | subscriptions | transfers-checks | webhooks | errors"
    }
  },
  "required": [
    "topic"
  ]
}
🟢connect(app_name)

Start token issuance WITHOUT the Mini App UI: creates a merchant-app request and returns a t.me approve link plus a poll_secret. Show the link to the human — they approve with one button in the @tgpaycryptobot bot — then call connect_status with the poll_secret. Use only when no API token is configured yet.

输入模式

{
  "type": "object",
  "properties": {
    "app_name": {
      "type": "string",
      "description": "Merchant app name shown to the approving human, 1-64 chars (e.g. the project/bot name)."
    }
  },
  "required": [
    "app_name"
  ]
}
🟡connect_status(poll_secret)

Poll a connect request. Returns pending | denied | expired, or — once approved — the app id and the API TOKEN (returned exactly once: save it to the project's .env immediately, never print it in logs). The token is SCOPED (read, invoices, subscriptions, webhooks) — it cannot move money out of the app; transfers/refunds/checks need the primary token the human holds in the Mini App. Poll every 3-5 seconds while pending.

输入模式

{
  "type": "object",
  "properties": {
    "poll_secret": {
      "type": "string",
      "description": "The poll_secret from the connect tool."
    }
  },
  "required": [
    "poll_secret"
  ]
}
🟢getMe

Verify the token: app id, name, webhook config, token scopes.

输入模式

{
  "type": "object",
  "properties": {}
}
🟢getBalance

Merchant app balance per asset (available + onhold).

输入模式

{
  "type": "object",
  "properties": {}
}
🟢getCurrencies

Supported crypto assets (code/name/decimals) and fiats.

输入模式

{
  "type": "object",
  "properties": {}
}
🟢getExchangeRates

Current asset↔fiat display rates.

输入模式

{
  "type": "object",
  "properties": {}
}
🟢getStats(start_at, end_at)

App volume/count stats for a period.

输入模式

{
  "type": "object",
  "properties": {
    "start_at": {
      "type": "string",
      "description": "ISO 8601 period start."
    },
    "end_at": {
      "type": "string",
      "description": "ISO 8601 period end."
    }
  }
}
🟢getInvoices(asset, fiat, invoice_ids, status, offset, ...)

List invoices (newest first).

输入模式

{
  "type": "object",
  "properties": {
    "asset": {
      "type": "string",
      "description": "Filter by asset code."
    },
    "fiat": {
      "type": "string",
      "description": "Filter by fiat code."
    },
    "invoice_ids": {
      "type": "string",
      "description": "Comma-separated ids."
    },
    "status": {
      "type": "string",
      "description": "active | paid | expired."
    },
    "offset": {
      "type": "integer",
      "description": "Skip this many."
    },
    "count": {
      "type": "integer",
      "description": "Page size (default 100)."
    }
  }
}
🟢getChecks(asset, check_ids, status, offset, count)

List checks.

输入模式

{
  "type": "object",
  "properties": {
    "asset": {
      "type": "string",
      "description": "Filter by asset code."
    },
    "check_ids": {
      "type": "string",
      "description": "Comma-separated ids."
    },
    "status": {
      "type": "string",
      "description": "active | activated."
    },
    "offset": {
      "type": "integer",
      "description": "Skip this many."
    },
    "count": {
      "type": "integer",
      "description": "Page size (default 100)."
    }
  }
}
🟢getTransfers(asset, transfer_ids, spend_id, offset, count)

List app→user transfers.

输入模式

{
  "type": "object",
  "properties": {
    "asset": {
      "type": "string",
      "description": "Filter by asset code."
    },
    "transfer_ids": {
      "type": "string",
      "description": "Comma-separated ids."
    },
    "spend_id": {
      "type": "string",
      "description": "Filter by idempotency key."
    },
    "offset": {
      "type": "integer",
      "description": "Skip this many."
    },
    "count": {
      "type": "integer",
      "description": "Page size (default 100)."
    }
  }
}
🟢getSubscriptionPlans

List subscription plans.

输入模式

{
  "type": "object",
  "properties": {}
}
🟢getSubscriptions(plan_id, user_id, status)

List subscriptions (subscribers).

输入模式

{
  "type": "object",
  "properties": {
    "plan_id": {
      "type": "integer",
      "description": "Filter by plan."
    },
    "user_id": {
      "type": "integer",
      "description": "Filter by Telegram user id."
    },
    "status": {
      "type": "string",
      "description": "active | grace | cancelled | expired."
    }
  }
}
🟡createInvoice(currency_type, asset, amount, fiat, accepted_assets, ...)

Create a one-off payment invoice; the payer opens result.mini_app_invoice_url. See the invoices doc.

输入模式

{
  "type": "object",
  "properties": {
    "currency_type": {
      "type": "string",
      "description": "crypto (default) | fiat."
    },
    "asset": {
      "type": "string",
      "description": "Asset code (crypto mode)."
    },
    "amount": {
      "type": "string",
      "description": "Decimal string in MAJOR units, e.g. \"5\" = 5 USDT. Never a float. Omit for an open-amount invoice."
    },
    "fiat": {
      "type": "string",
      "description": "Fiat code (fiat mode)."
    },
    "accepted_assets": {
      "type": "string",
      "description": "Fiat mode: comma-separated assets the payer may pay in."
    },
    "rate_lock_seconds": {
      "type": "integer",
      "description": "Fiat mode: freeze crypto quotes for this long."
    },
    "description": {
      "type": "string",
      "description": "Shown to the payer (≤1024)."
    },
    "hidden_message": {
      "type": "string",
      "description": "Revealed to the payer ONLY after payment (≤2048)."
    },
    "payload": {
      "type": "string",
      "description": "Opaque data echoed back in the webhook (≤4096)."
    },
    "paid_btn_name": {
      "type": "string",
      "description": "viewItem | openChannel | openBot | callback."
    },
    "paid_btn_url": {
      "type": "string",
      "description": "URL for the paid button."
    },
    "allow_comments": {
      "type": "boolean",
      "description": "Default true."
    },
    "allow_anonymous": {
      "type": "boolean",
      "description": "Default true."
    },
    "expires_in": {
      "type": "integer",
      "description": "Invoice TTL in seconds."
    },
    "swap_to": {
      "type": "string",
      "description": "Auto-convert the received amount to this asset."
    }
  }
}
🔴deleteInvoice(invoice_id)

Delete an unpaid invoice.

输入模式

{
  "type": "object",
  "properties": {
    "invoice_id": {
      "type": "integer",
      "description": "The invoice to delete."
    }
  },
  "required": [
    "invoice_id"
  ]
}
🔴deleteCheck(check_id)

Delete an unclaimed check (refunds the hold).

输入模式

{
  "type": "object",
  "properties": {
    "check_id": {
      "type": "integer",
      "description": "The check to delete."
    }
  },
  "required": [
    "check_id"
  ]
}
🟡createSubscriptionPlan(name, asset, amount, period_days)

Create an IMMUTABLE recurring-billing plan; send payers to result.mini_app_subscribe_url. See the subscriptions doc.

输入模式

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Plan name shown to payers (≤64)."
    },
    "asset": {
      "type": "string",
      "description": "Asset code, e.g. USDT."
    },
    "amount": {
      "type": "string",
      "description": "Decimal string in MAJOR units, e.g. \"5\" = 5 USDT. Never a float. Charged per period."
    },
    "period_days": {
      "type": "integer",
      "description": "Billing period in days."
    }
  },
  "required": [
    "name",
    "asset",
    "amount",
    "period_days"
  ]
}
⚪archiveSubscriptionPlan(plan_id)

Stop new signups for a plan (live subscriptions keep renewing).

输入模式

{
  "type": "object",
  "properties": {
    "plan_id": {
      "type": "integer",
      "description": "The plan to archive."
    }
  },
  "required": [
    "plan_id"
  ]
}
🔴cancelSubscription(subscription_id)

Stop future charges for one subscription (paid time runs out).

输入模式

{
  "type": "object",
  "properties": {
    "subscription_id": {
      "type": "integer",
      "description": "The subscription."
    }
  },
  "required": [
    "subscription_id"
  ]
}
🟡updateApp(name, webhook_url, webhook_events)

Update app name / webhook_url (https) / webhook_events opt-in list. Needs the 'webhooks' scope (the connect-issued token has it) or the primary token. See the webhooks doc for the event types and signature verification.

输入模式

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "New app name (1-64)."
    },
    "webhook_url": {
      "type": "string",
      "description": "https URL for webhook delivery; \"\" clears it."
    },
    "webhook_events": {
      "type": "array",
      "description": "Extended event types to opt into (invoice_paid is always delivered); [] = invoice_paid-only.",
      "items": {
        "type": "string",
        "description": "Event type."
      }
    }
  }
}

社区

评价此服务器

证据

最近观测

已验证未记录版本20 个工具
已验证未记录版本20 个工具
已验证未记录版本20 个工具
已验证未记录版本20 个工具
已验证未记录版本20 个工具
已验证未记录版本20 个工具