Cupom Center MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cupom Center MCP find eligible coupons for my cart and quote the best discount"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Cupom Center MCP
Servidor MCP local que ajuda agentes de IA a integrar sistemas clientes à API REST do Cupom Center.
O servidor roda no computador do cliente por stdio. Ele não hospeda modelo de IA e não abre uma porta de rede: recebe chamadas MCP do host local e acessa https://api.cupom.center com a API key do projeto.
O que ele faz
Além de representar os endpoints REST como ferramentas MCP, o servidor ensina o agente a seguir o ciclo correto:
descobrir cupons elegíveis sem reservar ou consumir;
calcular o desconto e reservar uma quote temporária;
confirmar o resgate com o mesmo contexto;
registrar pagamento somente após confirmação externa;
consultar e reconciliar a operação;
reverter usos e budgets sem fingir que movimentou dinheiro.
recommend_integration_flow decide o fluxo sem chamar a API e sem consumir a franquia do Cupom Center. As demais ferramentas acessam a REST e estão sujeitas ao rate limit e à medição de consumo da organização.
Related MCP server: Elementary POS MCP
Requisitos
Node.js 20 ou superior;
uma API key criada para o projeto e ambiente corretos no Cupom Center;
permissões compatíveis com as ferramentas usadas.
Operação | Permissão |
Descoberta, consulta de operação |
|
Emissão, consulta e revogação de código individual |
|
Quote, resgate e reversão |
|
Pagamento no resgate ou posterior |
|
Organização, ambiente e projeto são sempre derivados da API key. O MCP não permite selecionar outro tenant por argumento.
Desenvolvimento local
cd mcp
bun install
bun run buildInstalação publicada
Depois da publicação no npm, fixe uma versão no host MCP:
{
"mcpServers": {
"cupom-center": {
"command": "npx",
"args": ["-y", "@cupom_center/mcp@0.1.0"],
"env": {
"CUPOM_API_KEY": "cpm_..."
}
}
}
}As instruções de release, npm Trusted Publishing e MCP Registry estão em PUBLISHING.md.
Configure o host MCP para executar o arquivo compilado usando um caminho absoluto:
{
"mcpServers": {
"cupom-center": {
"command": "node",
"args": ["/caminho/absoluto/para/Cupom/mcp/dist/index.js"],
"env": {
"CUPOM_API_KEY": "cpm_...",
"CUPOM_API_URL": "https://api.cupom.center"
}
}
}
}CUPOM_API_URL é opcional e usa https://api.cupom.center por padrão. HTTP só é aceito para localhost, facilitando desenvolvimento sem permitir credenciais em conexões remotas inseguras.
CUPOM_API_TIMEOUT_MS é opcional, usa 20 segundos por padrão e aceita valores entre 1.000 e 120.000 ms.
O servidor pode iniciar sem uma API key para consultar o guia e executar recommend_integration_flow. As ferramentas que acessam a REST retornarão um erro de configuração até CUPOM_API_KEY ser definida.
Para produção, prefira que o instalador recupere a API key do cofre de credenciais do sistema operacional. Configurá-la diretamente no JSON do host é simples, mas exige proteger esse arquivo contra leitura, backup ou compartilhamento indevido.
Ferramentas
recommend_integration_flowfind_eligible_couponsquote_single_couponquote_multiple_couponsselect_coupons_for_unitscreate_coupon_issuanceget_coupon_issuancerevoke_coupon_issuanceredeem_single_couponredeem_multiple_couponsget_coupon_operationrecord_operation_paymentreverse_operation
O recurso MCP cupom://integration-guide contém as regras de decisão compartilhadas pelo servidor.
Segurança e retries
O servidor nunca escreve a API key em logs ou respostas.
stdouté reservado exclusivamente ao protocolo MCP; diagnósticos usamstderr.Requisições com efeito comercial não recebem retry automático.
Depois de timeout, não altere os dados e tente novamente às cegas.
Emissão usa
Idempotency-Key; repetir a mesma chave exige o mesmo comando.Resgates devem preservar carrinho, contexto, códigos, ordem, estratégia, quote e pagamento.
Cupom Center registra pagamentos confirmados pelo cliente, mas não cobra nem estorna dinheiro.
Reversões são integrais e liberam usos e budgets; o estorno financeiro continua sendo responsabilidade do provedor de pagamento do cliente.
O MCP não administra cupons, campanhas, organizações, membros ou API keys. Essas operações pertencem à superfície GraphQL autenticada do painel.
Validação
bun run typecheck
bun run buildO projeto evita testes unitários isolados. A validação de protocolo deve ser feita conectando o binário compilado a um cliente MCP ou ao MCP Inspector, e a validação da REST deve usar um ambiente/projeto de homologação.
Available Tools
13 toolscreate_coupon_issuanceIssue an individual coupon codeBIdempotent
Create an individual code from an existing coupon configured with ISSUED distribution, typically for cart recovery, CRM, or individualized delivery. This never creates discount rules. Requires COUPON_ISSUE and a stable idempotency key.
Inputs: cart (required), subject (required), coupon_id (required), idempotency_key (required), +4 more.
find_eligible_couponsFind eligible couponsARead-onlyIdempotent
Discover coupons whose configured rules match the known customer/cart context. This does not calculate final totals, reserve budget, or consume a coupon. Missing context intentionally excludes coupons that require that fact. public defaults to true.
Inputs: context, pagination.
get_coupon_issuanceGet coupon issuanceBRead-onlyIdempotent
Read the current state and immutable commercial details of an individual issued code.
Inputs: issuance_id (required).
get_coupon_operationGet coupon operationARead-onlyIdempotent
Inspect a redemption operation, immutable receipts, current payment, and reversals. Use for reconciliation and as the first recovery step after a timeout when operation_id is known.
Inputs: operation_id (required).
quote_multiple_couponsCalculate and reserve multiple couponsB
Validate and calculate 2–10 known coupon codes. code_order stacks sequentially in supplied order; highest_discount_per_product applies only the best coupon to each product. Every supplied code must be eligible and applied.
Inputs: context (required), selection (required), coupon_codes (required), cart_id.
quote_single_couponCalculate and reserve one couponA
Validate a known coupon code against the current cart, calculate authoritative totals, and create a temporary quote reservation. Use before redeeming or displaying a final discount. Do not use for catalog discovery.
Inputs: context (required), coupon_code (required), cart_id.
recommend_integration_flowRecommend Cupom Center integration flowARead-onlyIdempotent
Choose the correct Cupom Center workflow before making API calls. This tool is local, has no commercial effect, and consumes no Cupom Center API allowance. Use it whenever it is unclear whether to discover, quote, issue, redeem, record payment, inspect, or reverse.
Inputs: business_goal (required), payment_confirmed, operation_id_known.
record_operation_paymentRecord confirmed operation paymentAIdempotent
Record an integral payment that an external payment provider has already confirmed. This does not charge or capture money and does not consume coupons again. Requires PAYMENT_WRITE.
Inputs: payment (required), operation_id (required).
redeem_multiple_couponsRedeem multiple couponsADestructiveIdempotent
Atomically confirm 2–10 coupons previously calculated together. Preserve code order and selection strategy from the quote. Either all applicable uses/budgets confirm or none do.
Inputs: context (required), selection (required), coupon_codes (required), cart_id, +3 more.
redeem_single_couponRedeem one couponADestructiveIdempotent
Confirm one coupon as a commercial operation. Normally call after quote_single_coupon and send the same cart/context. Provide cart_id, context.user.id, or quote_id for correlation. Include payment only after external confirmation; Cupom Center does not charge money.
Inputs: context (required), coupon_code (required), cart_id, payment, +2 more.
reverse_operationCancel or refund a coupon operationADestructiveIdempotent
Fully reverse one coupon operation and release its usage counters and budgets. The backend classifies it as cancellation without payment or refund with confirmed payment. This does not move money at the payment provider and accepts no reason or partial amount.
Inputs: operation_id (required).
revoke_coupon_issuanceRevoke coupon issuanceADestructiveIdempotent
Revoke one active individual issuance. This is idempotent but cannot reactivate a consumed or expired code. Use only when the individual code must no longer be accepted.
Inputs: issuance_id (required).
select_coupons_for_unitsSelect coupons per unitA
Automatically select public coupons for 1–20 marketplace/store units. Use only when a cart is partitioned into units and the integration wants Cupom Center to choose by coverage or total discount. This is not for validating a known code.
Inputs: mode (required), units (required), context, priority, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools have clearly distinct purposes, especially with explicit 'do not use for' guidance separating discovery, quoting, selection, issuance, redemption, and operation inspection. Some boundaries between find_eligible_coupons, select_coupons_for_units, and quote_multiple_coupons require careful reading, and single/multiple quote and redeem pairs could be confused at a glance.
All tool names use snake_case with a predictable verb-first pattern, and related operations consistently use shared nouns such as coupon_issuance, coupon_operation, single_coupon, and multiple_coupons. The naming convention is stable throughout the set.
The 13 tools map cleanly onto the coupon lifecycle: guidance, discovery, quoting, selection, issuance, redemption, payment recording, inspection, and reversal. The set is large enough to cover the workflow without appearing bloated or redundant.
The core lifecycle from discovery through quoting, issuance, redemption, inspection, payment recording, and reversal is covered. Minor gaps exist, such as no list/search operations for issuances or redemption operations and no direct quote retrieval by quote_id, but these are workable around.
Maintenance
Related MCP Connectors
Hosted MCP for e-commerce: live product catalog, stock, and pricing for AI agents.
Directory of APIs, merchants, and tools AI agents can actually use.
Build, validate, deploy — HTTP APIs, cron jobs, webhooks and MCP tools — from your AI client.
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Related MCP Servers
- FlicenseAqualityDmaintenanceConnects AI agents to a live offers API, returning structured product offers in real time.1-
- FlicenseNot gradedqualityDmaintenanceEnables AI clients to interact with a point-of-sale public API through 32 MCP tools for managing bills, customers, items, orders, receipts, stock, suppliers, taxes, and webhooks over stdio and HTTP transports.-
- AlicenseAqualityBmaintenanceEnables AI agents to list, search, create, update, mark used, and delete vouchers, coupons, gift cards, and loyalty cards via a token-authenticated JSON API.6MIT
- FlicenseNot gradedqualityCmaintenanceEnables an AI agent to investigate AcmeShop operational data and create incidents through a mock REST API using a local stdio transport.-