Cobroya

io.github.dan1d由 GitHub 账号 dan1d 发布v1.0.1更新于 Oct 24, 2026

Mercado Pago payments for AI agents: payment links, search, refunds, merchant info.

已验证STDIO仅桌面金融商业与电商

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手创建 Mercado Pago 支付链接、查询与搜索付款、发起退款,并读取商户资料。

可以做什么
创建 Mercado Pago 结账支付链接,可附带回跳与通知地址,并返回可分享给买家的结账链接。按付款 ID 获取单笔付款的完整详情,包括状态、金额和付款人信息。按状态筛选搜索付款,支持排序和分页。对某笔付款发起全额或部分退款。读取已认证商户的资料:用户 ID、昵称和站点。
适用场景
适合让助手在对话中处理 Mercado Pago 收款:为商品或课程生成支付链接、查看当天付款是否已批准,或为买家退款。适用于已在使用 Mercado Pago、希望在 AI 工具内完成收款操作的商户。
运行要求
通过 npx 以 stdio 进程在本地运行,需要 Node.js。需要在 MERCADO_PAGO_ACCESS_TOKEN 环境变量中提供 Mercado Pago 访问令牌。需要能访问 Mercado Pago API 的网络。可选变量涉及 Telegram、WhatsApp、webhook 密钥、默认货币和跳转地址。
安装前请注意
Mercado Pago 访问令牌是关联真实资金的支付凭证,持有者可创建收款和退款。退款和创建支付链接会改变真实财务状态,让助手操作前应确认金额和付款 ID。该令牌以明文形式保存在客户端配置文件中。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Cobroya,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

CobroYa

Cobra con Mercado Pago en 10 segundos.

[npm version] [tests] [coverage] [license]

CobroYa is an open-source Mercado Pago payment tool for AI agents, Telegram, WhatsApp, and automation platforms. Create payment links, search payments, issue refunds -- all from your AI assistant or chat bot.

Website | npm | GitHub


Quick Start with AI

CobroYa is an MCP (Model Context Protocol) server. Add it to your AI tool in one step -- no cloning, no building. Just provide your Mercado Pago access token.

Claude Desktop

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "cobroya": {      "command": "npx",      "args": ["-y", "cobroya"],      "env": {        "MERCADO_PAGO_ACCESS_TOKEN": "APP_USR-..."      }    }  }}

Claude Code

bash
claude mcp add cobroya -- npx -y cobroya \  --env MERCADO_PAGO_ACCESS_TOKEN=APP_USR-...

Cursor

Add to .cursor/mcp.json in your project root:

json
{  "mcpServers": {    "cobroya": {      "command": "npx",      "args": ["-y", "cobroya"],      "env": {        "MERCADO_PAGO_ACCESS_TOKEN": "APP_USR-..."      }    }  }}

Windsurf

Add to your Windsurf MCP configuration:

json
{  "mcpServers": {    "cobroya": {      "command": "npx",      "args": ["-y", "cobroya"],      "env": {        "MERCADO_PAGO_ACCESS_TOKEN": "APP_USR-..."      }    }  }}

Once configured, ask your AI assistant things like: "Create a payment link for $5000 for a Python course" or "Show me today's approved payments".


Available Tools

CobroYa exposes 5 MCP tools that any connected AI agent can call:

ToolDescription
create_payment_preferenceCreate a Mercado Pago checkout payment link. Returns an init_point URL to share with buyers. Supports back_urls and notification_url.
get_paymentRetrieve full details of a payment by ID, including status, amount, and payer info.
search_paymentsSearch payments with filters: status (approved, pending, rejected, etc.), sort order, and pagination.
create_refundIssue a full or partial refund for a payment. Omit amount for a full refund.
get_merchant_infoGet the authenticated merchant's profile: user ID, nickname, and site.

Telegram Bot

CobroYa includes a ready-to-use Telegram bot: @CobroYa_bot

Self-hosting the bot

  1. Create a bot via @BotFather and get your token.
  2. Set environment variables:
bash
export MERCADO_PAGO_ACCESS_TOKEN="APP_USR-..."export TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
  1. Run:
bash
npx cobroya-telegram

Or from source:

bash
npm run bot

WhatsApp

CobroYa supports WhatsApp Business Cloud API for receiving commands and sending payment notifications.

  1. Create a Meta app at Meta for Developers and enable WhatsApp Business API.
  2. Set environment variables:
bash
export WHATSAPP_ACCESS_TOKEN="your-meta-graph-api-token"export WHATSAPP_PHONE_NUMBER_ID="your-phone-number-id"export WHATSAPP_VERIFY_TOKEN="your-webhook-verify-token"
  1. Run the webhook server:
bash
npm run whatsapp# Starts on http://localhost:3000/webhook
  1. Expose with ngrok (ngrok http 3000) and configure the webhook URL in your Meta Dashboard.

For full details on supported commands and payment notifications, see the WhatsApp documentation.


Automation Platforms

Pre-built packages for popular automation platforms are available in the packages/ directory:

  • n8n -- packages/n8n-nodes-mercadopago
  • Zapier -- packages/zapier-mercadopago
  • Make -- packages/make-mercadopago
  • Pipedream -- packages/pipedream-mercadopago

Each package wraps the CobroYa core with platform-specific configuration. See the README in each package for setup instructions.


AI Framework Adapters

LangChain (Python)

bash
pip install langchain-mercadopago
python
from langchain_mercadopago import create_mercadopago_tools
tools = create_mercadopago_tools("APP_USR-...")
# Use with any LangChain agentfrom langchain.agents import initialize_agent, AgentTypefrom langchain_openai import ChatOpenAI
agent = initialize_agent(    tools=tools,    llm=ChatOpenAI(model="gpt-4"),    agent=AgentType.OPENAI_FUNCTIONS,)agent.run("Create a payment link for $5000 for a Python course")

PyPI

OpenAI Function Calling (TypeScript)

bash
npm install openai-mercadopago
typescript
import { createMercadoPagoExecutor } from "openai-mercadopago";
const executor = createMercadoPagoExecutor(process.env.MERCADO_PAGO_ACCESS_TOKEN!);
// Pass executor.definitions to OpenAI's tools parameterconst response = await openai.chat.completions.create({  model: "gpt-4",  messages,  tools: executor.definitions,});
// Execute the tool callconst result = await executor.handleToolCall(  toolCall.function.name,  JSON.parse(toolCall.function.arguments),);

npm


Programmatic Usage

Install as a dependency:

bash
npm install cobroya
typescript
import { createMercadoPagoTools } from "cobroya";
const mp = createMercadoPagoTools(process.env.MERCADO_PAGO_ACCESS_TOKEN!);
// Create a payment linkconst pref = await mp.tools.create_payment_preference({  title: "Premium Plan",  quantity: 1,  currency: "ARS",  unit_price: 5000,});console.log(pref.init_point); // Checkout URL to share with the buyer
// Search approved paymentsconst payments = await mp.tools.search_payments({ status: "approved", limit: 10 });
// Get payment detailsconst payment = await mp.tools.get_payment({ payment_id: "123456789" });
// Full refundawait mp.tools.create_refund({ payment_id: "123456789" });
// Partial refundawait mp.tools.create_refund({ payment_id: "123456789", amount: 500 });
// Merchant profileconst merchant = await mp.tools.get_merchant_info();

Error Handling

typescript
import { MercadoPagoError } from "cobroya";
try {  await mp.tools.get_payment({ payment_id: "invalid" });} catch (err) {  if (err instanceof MercadoPagoError) {    console.log(err.status);        // 404    console.log(err.isNotFound);     // true    console.log(err.isUnauthorized); // false    console.log(err.isRateLimited);  // false  }}

Environment Variables

VariableRequiredDescription
MERCADO_PAGO_ACCESS_TOKENYesMercado Pago API access token (get one here)
TELEGRAM_BOT_TOKENFor TelegramTelegram bot token from @BotFather
WHATSAPP_ACCESS_TOKENFor WhatsAppMeta Graph API token
WHATSAPP_PHONE_NUMBER_IDFor WhatsAppWhatsApp Business phone number ID
WHATSAPP_VERIFY_TOKENFor WhatsAppWebhook verification token
WA_NOTIFY_PHONENoPhone number for WhatsApp payment notifications
MERCADO_PAGO_WEBHOOK_SECRETNoHMAC secret for Mercado Pago webhook signature validation
MP_CURRENCYNoDefault currency (defaults to ARS)
MP_SUCCESS_URLNoDefault success redirect URL for payment preferences

Development

bash
# Install dependenciesnpm install
# Buildnpm run build
# Run all testsnpm test
# Run tests with coveragenpm run test:coverage
# Watch modenpm run test:watch
# Type-check without emittingnpx tsc --noEmit
# Integration test against real Mercado Pago APIMERCADO_PAGO_ACCESS_TOKEN=APP_USR-... npm run integration
# Start the unified server (Telegram + WhatsApp + webhooks)npm start
# Dev mode with auto-reloadnpm run dev:server
# Dockerdocker compose up -d

License

MIT -- by dan1d

来源:README.md,提交 4e4c6f3

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分