Cobroya

io.github.dan1dPublished by GitHub account dan1dv1.0.1Updated Oct 24, 2026

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

VerifiedSTDIODesktop onlyFinanceBusiness & Commerce

Overview

AI-generated overview

Local MCP server that lets an AI assistant create Mercado Pago payment links, look up and search payments, issue refunds, and read merchant profile info.

What you can do
Create Mercado Pago checkout payment links, optionally with back and notification URLs, and get a shareable checkout URL for buyers. Retrieve full details of a single payment by ID, including status, amount and payer info. Search payments by status with sorting and pagination. Issue full or partial refunds on a payment. Read the authenticated merchant's profile: user ID, nickname and site.
When to use it
Useful when an assistant should handle Mercado Pago collections in chat: generating a payment link for a product or course, checking whether today's payments were approved, or refunding a buyer. Suited to merchants already using Mercado Pago who want payment actions inside an AI tool.
Requirements
Runs locally via npx as a stdio process; Node.js is needed. Requires a Mercado Pago access token supplied in the MERCADO_PAGO_ACCESS_TOKEN environment variable. Network access to the Mercado Pago API. Optional variables cover Telegram, WhatsApp, webhook secret, default currency and redirect URL.
Before you install
The Mercado Pago access token is a live payment credential with real money behind it; anyone holding it can create charges and refunds. Refunds and payment-link creation change real financial state, so confirm amounts and payment IDs before letting an assistant act. The token is stored in plain text in the client configuration file.

Installation

In SourceWeft

  1. Open Cobroya in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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

Source: README.md at commit 4e4c6f3

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.0.1LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts