mariapay-mcp 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Laercio Borges
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,84 @@
1
- # Temporary Holding Version
1
+ # mariapay-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Servidor MCP da [Maria Pay](https://sniperpay-api-production.up.railway.app/docs): Pix, boleto, carnê, checkout, links de pagamento, reembolso e webhooks para agentes de IA (Claude Desktop, Claude Code, Codex CLI, Cursor, VS Code, Windsurf, Gemini CLI e qualquer cliente MCP).
4
+
5
+ Valores sempre em centavos (R$ 19,90 = `1990`).
6
+
7
+ ## Uso
8
+
9
+ ```bash
10
+ MARIAPAY_API_KEY=sp_test_... npx -y mariapay-mcp
11
+ ```
12
+
13
+ | Variável | |
14
+ |---|---|
15
+ | `MARIAPAY_API_KEY` | chave da API (`sp_test_` ou `sp_live_`), obrigatória |
16
+ | `MARIAPAY_BASE_URL` | padrão `https://sniperpay-api-production.up.railway.app` |
17
+ | `MARIAPAY_TOOLSETS` | grupos: `pix`, `boleto`, `billing`, `catalog`, `webhooks`, `account`, `v1` (padrão: todos) |
18
+
19
+ Os nomes antigos `SNIPERPAY_API_KEY`, `SNIPERPAY_BASE_URL` e `SNIPERPAY_TOOLSETS` também são aceitos.
20
+
21
+ Com chave `sp_live_`, as ferramentas de simulação de pagamento não aparecem.
22
+
23
+ ### Claude Desktop (`claude_desktop_config.json`)
24
+
25
+ ```json
26
+ {
27
+ "mcpServers": {
28
+ "maria-pay": {
29
+ "command": "npx",
30
+ "args": ["-y", "mariapay-mcp"],
31
+ "env": { "MARIAPAY_API_KEY": "sp_test_..." }
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ ### Codex CLI (`~/.codex/config.toml`)
38
+
39
+ ```toml
40
+ [mcp_servers.maria-pay]
41
+ command = "npx"
42
+ args = ["-y", "mariapay-mcp"]
43
+ env = { MARIAPAY_API_KEY = "sp_test_..." }
44
+ ```
45
+
46
+ ### Claude Code
47
+
48
+ ```bash
49
+ claude mcp add maria-pay --env MARIAPAY_API_KEY=sp_test_... -- npx -y mariapay-mcp
50
+ ```
51
+
52
+ Sem instalar nada, use o servidor remoto: `https://sniperpay-api-production.up.railway.app/mcp` com `Authorization: Bearer sp_test_...`. Configuração de Cursor, VS Code, Windsurf, Gemini CLI e ChatGPT em [/docs#mcp-clientes](https://sniperpay-api-production.up.railway.app/docs#mcp-clientes).
53
+
54
+ ## Function calling (DeepSeek, Groq, OpenRouter, OpenAI)
55
+
56
+ ```ts
57
+ import OpenAI from 'openai';
58
+ import { openAITools, executeTool, httpCaller } from 'mariapay-mcp';
59
+
60
+ const llm = new OpenAI({ apiKey: process.env.DEEPSEEK_API_KEY, baseURL: 'https://api.deepseek.com' });
61
+ const call = httpCaller({ apiKey: process.env.MARIAPAY_API_KEY! });
62
+ const tools = openAITools({ toolsets: ['pix', 'account'] });
63
+
64
+ const messages: any[] = [{ role: 'user', content: 'Crie um Pix de R$ 25,00 para o pedido 42.' }];
65
+ for (;;) {
66
+ const msg = (await llm.chat.completions.create({ model: 'deepseek-chat', messages, tools })).choices[0].message;
67
+ messages.push(msg);
68
+ if (!msg.tool_calls?.length) { console.log(msg.content); break; }
69
+ for (const tc of msg.tool_calls) {
70
+ const r = await executeTool(tc.function.name, JSON.parse(tc.function.arguments || '{}'), call);
71
+ messages.push({ role: 'tool', tool_call_id: tc.id, content: r.content[0].text });
72
+ }
73
+ }
74
+ ```
75
+
76
+ ## Ferramentas
77
+
78
+ `create_pix_charge`, `get_charge`, `check_pix_status`, `list_charges`, `simulate_pix_payment`, `refund_charge`, `cancel_charge`, `create_static_pix_qr`, `create_boleto`, `create_carne`, `get_carne`, `create_checkout`, `get_checkout`, `list_checkouts`, `refund_checkout`, `create_payment_link`, `get_payment_link`, `list_payment_links`, `refund_payment_link`, `create_product`, `get_product`, `list_products`, `delete_product`, `create_customer`, `get_customer`, `list_customers`, `delete_customer`, `create_coupon`, `get_coupon`, `list_coupons`, `toggle_coupon`, `delete_coupon`, `create_webhook`, `list_webhooks`, `get_webhook`, `delete_webhook`, `get_balance`, `get_fee_table`, `list_pix_keys`, `register_pix_key`, `set_legacy_webhook_url`, `v1_create_pix_charge`, `v1_create_boleto`, `v1_get_charge`, `v1_list_charges`, `v1_simulate_payment`.
79
+
80
+ Reembolso, cancelamento e exclusões são marcados como destrutivos; o cliente MCP pede confirmação antes. Recursos: `mariapay://docs/guia`, `mariapay://docs/integracao`, `mariapay://fees`. Prompts: `criar_cobranca_pix`, `integrar_mariapay`, `resumo_recebimentos`.
81
+
82
+ ## Licença
83
+
84
+ MIT · VERTAL COMPANY
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ // Servidor MCP local (stdio) da Maria Pay: npx -y mariapay-mcp
3
+ // Variáveis: MARIAPAY_API_KEY (obrigatória), MARIAPAY_BASE_URL, MARIAPAY_TOOLSETS (ex.: pix,account).
4
+ // Os nomes antigos SNIPERPAY_* continuam valendo quando o MARIAPAY_* correspondente não está definido.
5
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
+ import { httpCaller, modeOfKey } from './client.js';
7
+ import { DEFAULT_BASE_URL } from './guide.js';
8
+ import { createMariaPayMcpServer, MCP_SERVER_VERSION } from './server.js';
9
+ import { parseToolsets, selectTools, TOOLSETS } from './tools.js';
10
+ const env = (name) => process.env[`MARIAPAY_${name}`] ?? process.env[`SNIPERPAY_${name}`];
11
+ const arg = (name) => {
12
+ const i = process.argv.findIndex(a => a === `--${name}` || a.startsWith(`--${name}=`));
13
+ if (i < 0)
14
+ return undefined;
15
+ const a = process.argv[i];
16
+ return a.includes('=') ? a.slice(a.indexOf('=') + 1) : process.argv[i + 1];
17
+ };
18
+ if (process.argv.includes('--help') || process.argv.includes('-h')) {
19
+ console.error(`mariapay-mcp ${MCP_SERVER_VERSION}: servidor MCP (stdio) da Maria Pay
20
+
21
+ Uso: MARIAPAY_API_KEY=sp_test_... npx -y mariapay-mcp [--toolsets pix,account] [--base-url URL]
22
+
23
+ MARIAPAY_API_KEY chave da API (sp_test_ ou sp_live_), obrigatória
24
+ MARIAPAY_BASE_URL padrão ${DEFAULT_BASE_URL}
25
+ MARIAPAY_TOOLSETS grupos de ferramentas: ${TOOLSETS.join(', ')} (padrão: todos)
26
+
27
+ Os nomes antigos SNIPERPAY_* também são aceitos.`);
28
+ process.exit(0);
29
+ }
30
+ if (process.argv.includes('--version')) {
31
+ console.log(MCP_SERVER_VERSION);
32
+ process.exit(0);
33
+ }
34
+ const apiKey = (env('API_KEY') ?? '').trim();
35
+ if (!apiKey) {
36
+ console.error('mariapay-mcp: defina MARIAPAY_API_KEY com a sua chave (sp_test_... ou sp_live_...).');
37
+ process.exit(1);
38
+ }
39
+ const baseUrl = arg('base-url') ?? env('BASE_URL') ?? DEFAULT_BASE_URL;
40
+ let toolsets = null;
41
+ try {
42
+ toolsets = parseToolsets(arg('toolsets') ?? env('TOOLSETS'));
43
+ }
44
+ catch (e) {
45
+ console.error(`mariapay-mcp: ${e.message}`);
46
+ process.exit(1);
47
+ }
48
+ const mode = modeOfKey(apiKey);
49
+ const filter = { mode, toolsets, allowSimulate: env('ALLOW_SIMULATE') === 'true' };
50
+ const server = createMariaPayMcpServer({ ...filter, call: httpCaller({ apiKey, baseUrl }), baseUrl });
51
+ await server.connect(new StdioServerTransport());
52
+ console.error(`mariapay-mcp ${MCP_SERVER_VERSION} pronto: ${selectTools(filter).length} ferramentas, modo ${mode}, ${baseUrl}`);
@@ -0,0 +1,9 @@
1
+ import { type ApiCaller } from './server.js';
2
+ export interface HttpCallerOptions {
3
+ apiKey: string;
4
+ baseUrl?: string;
5
+ fetch?: typeof fetch;
6
+ timeoutMs?: number;
7
+ }
8
+ export declare function httpCaller(o: HttpCallerOptions): ApiCaller;
9
+ export declare const modeOfKey: (key: string) => "test" | "live" | "unknown";
package/dist/client.js ADDED
@@ -0,0 +1,31 @@
1
+ // Chamador HTTP da API REST da Maria Pay (usado pelo servidor stdio e por quem executa function calling).
2
+ import { buildPath, MCP_SERVER_VERSION } from './server.js';
3
+ import { DEFAULT_BASE_URL } from './guide.js';
4
+ export function httpCaller(o) {
5
+ const base = (o.baseUrl || DEFAULT_BASE_URL).replace(/\/$/, '');
6
+ const f = o.fetch ?? fetch;
7
+ return async (req) => {
8
+ const hasBody = req.method !== 'GET';
9
+ const res = await f(base + buildPath(req), {
10
+ method: req.method,
11
+ headers: {
12
+ Authorization: `Bearer ${o.apiKey}`,
13
+ Accept: 'application/json',
14
+ 'User-Agent': `mariapay-mcp/${MCP_SERVER_VERSION}`,
15
+ ...(hasBody ? { 'Content-Type': 'application/json' } : {}),
16
+ },
17
+ body: hasBody ? JSON.stringify(req.body ?? {}) : undefined,
18
+ signal: AbortSignal.timeout(o.timeoutMs ?? 30_000),
19
+ });
20
+ const text = await res.text();
21
+ let body;
22
+ try {
23
+ body = text ? JSON.parse(text) : null;
24
+ }
25
+ catch {
26
+ body = { error: text.slice(0, 500) || res.statusText };
27
+ }
28
+ return { status: res.status, body };
29
+ };
30
+ }
31
+ export const modeOfKey = (key) => key.startsWith('sp_test_') ? 'test' : key.startsWith('sp_live_') ? 'live' : 'unknown';
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_BASE_URL = "https://sniperpay-api-production.up.railway.app";
2
+ export declare function llmsTxt(baseUrl?: string): string;
3
+ export declare const INTEGRATION_GUIDE = "Como integrar a Maria Pay num app:\n1. Guarde a chave (sp_test_ para desenvolver) numa vari\u00E1vel de ambiente do servidor, ex.: MARIAPAY_API_KEY. Nunca no front-end.\n2. No checkout do seu app, o servidor chama POST /v2/transparents/create com method PIX, amount em centavos e externalId = id do pedido.\n3. Mostre ao cliente o brCode (copia e cola) e o QR (brCodeBase64 em <img>), ou redirecione para url.\n4. Cadastre um webhook (POST /v2/webhooks/create, evento transparent.completed) apontando para uma rota HTTPS do seu servidor.\n5. Na rota do webhook: confira X-Webhook-Secret e X-Webhook-Signature, ache o pedido por data.externalId (ou pelo id da cobran\u00E7a) e marque como pago. Seja idempotente.\n6. Em teste, use POST /v2/transparents/simulate-payment para disparar o webhook sem dinheiro real.\n7. Troque para sp_live_ quando for para produ\u00E7\u00E3o.\nSDK Node/TypeScript: npm install mariapay (sp.v2.transparents.create, sp.v2.webhooks.create, MariaPay.verifyWebhook).";
package/dist/guide.js ADDED
@@ -0,0 +1,60 @@
1
+ // Texto para agentes: servido em /llms.txt e como recurso MCP mariapay://docs/guia.
2
+ export const DEFAULT_BASE_URL = 'https://sniperpay-api-production.up.railway.app';
3
+ export function llmsTxt(baseUrl = DEFAULT_BASE_URL) {
4
+ const B = baseUrl.replace(/\/$/, '');
5
+ return `# Maria Pay
6
+
7
+ > Gateway brasileiro de pagamentos por Pix, boleto e carnê, com API REST simples. Valores sempre em centavos (R$ 19,90 = 1990). Taxa fixa só quando pago: Pix R$ 0,99, boleto R$ 3,49.
8
+
9
+ Base URL: ${B}
10
+ Autenticação: header \`Authorization: Bearer <chave>\`. Chaves \`sp_test_...\` (teste, nada é cobrado de verdade, permite simular pagamento) e \`sp_live_...\` (produção). A chave fica só no servidor, nunca no front-end ou no app.
11
+ Respostas v2: \`{ "data": ..., "success": true, "error": null }\`; listas trazem \`pagination: { hasMore, next, before }\`. Erros: 400/401/404/409/422/429 com \`error\` em texto.
12
+ Limite: 100 requisições por segundo por loja (headers RateLimit-*).
13
+
14
+ ## Pix (checkout transparente, v2)
15
+ - POST /v2/transparents/create \`{ "method": "PIX", "data": { "amount": 1990, "description": "Pedido 42", "expiresIn": 3600, "externalId": "pedido-42", "customer": { "name": "...", "taxId": "CPF/CNPJ" } } }\` → \`id\` (pix_char_...), \`brCode\` (copia e cola), \`brCodeBase64\` (PNG), \`url\` (página de pagamento), \`status\`.
16
+ - GET /v2/transparents/get?id= · GET /v2/transparents/check?id= · GET /v2/transparents/list?method=PIX&status=PAID
17
+ - POST /v2/transparents/simulate-payment \`{ "id" }\` (só sp_test_)
18
+ - POST /v2/transparents/refund \`{ "id", "reason" }\` (valor total; sai do saldo; a taxa não volta)
19
+ - POST /v1/pix/charges/:id/cancel (cancela pendente)
20
+
21
+ ## Boleto e carnê
22
+ - POST /v2/transparents/create \`{ "method": "BOLETO", "data": { "amount": 5000, "dueDate": "YYYY-MM-DD", "customer": { "name", "taxId", "address"? }, "interest"?: { "value" }, "fine"?: { "value", "type": "PERCENTAGE|FIXED" } } }\`
23
+ - POST /v1/boletos/carne \`{ "description", "customer", "totalAmount", "installments": 2..24, "firstDueDate" }\` · GET /v1/boletos/carne/:carnetId
24
+
25
+ ## Checkout hospedado e links de pagamento
26
+ - POST /v2/products/create \`{ "externalId", "name", "price" }\`
27
+ - POST /v2/checkouts/create \`{ "items": [{ "id": "prod_...", "quantity": 1 }], "methods": ["PIX","BOLETO"], "completionUrl"? }\` → \`url\` para o cliente pagar
28
+ - POST /v2/payment-links/create (mesmo corpo, vários pagamentos)
29
+ - GET /v2/checkouts/get|list · POST /v2/checkouts/refund
30
+ - Clientes: /v2/customers/create|list|get|delete · Cupons: /v2/coupons/create|list|get|toggle|delete
31
+
32
+ ## Webhooks
33
+ - POST /v2/webhooks/create \`{ "name", "endpoint": "https://...", "events": ["transparent.completed","checkout.completed", ...], "secret"? }\` · GET /v2/webhooks/list|get · POST /v2/webhooks/delete
34
+ - Cada entrega traz o secret em \`?webhookSecret=\` e no header \`X-Webhook-Secret\`, e \`X-Webhook-Signature\` = base64(HMAC-SHA256(corpo cru, chave pública da Maria Pay)). Confira os dois antes de dar baixa no pedido. A chave pública está em ${B}/docs#seguranca-webhooks.
35
+ - Eventos: transparent.completed, transparent.refunded, checkout.completed, checkout.refunded. API v1: charge.paid, charge.expired, charge.cancelled.
36
+ - Responda 2xx rápido. Falhas são repetidas (5 s, 30 s, 2 min) com o mesmo \`id\`; trate duplicadas.
37
+
38
+ ## Conta
39
+ - GET /v1/merchant/balance (bruto, taxas, reembolsado, líquido) · GET /fees (público) · GET/POST /v1/pix/keys
40
+
41
+ ## Para agentes de IA
42
+ - Servidor MCP remoto (Streamable HTTP): ${B}/mcp com \`Authorization: Bearer <chave>\`.
43
+ - Servidor MCP local (stdio): \`npx -y mariapay-mcp\` com a variável MARIAPAY_API_KEY.
44
+ - Ferramentas no formato de function calling da OpenAI (DeepSeek, Groq, OpenRouter, etc.): GET ${B}/mcp/tools.json. Para executar uma chamada: POST ${B}/mcp/call \`{ "name", "arguments" }\` com a mesma chave.
45
+ - Boas práticas: confirme com o usuário antes de reembolsar ou cancelar; teste com sp_test_ e simule o pagamento; nunca exponha a chave.
46
+
47
+ ## Documentação
48
+ - ${B}/docs : guia completo em português
49
+ - ${B}/docs#mcp : configuração para Claude, Codex, Cursor, VS Code, Windsurf, Gemini CLI, ChatGPT e DeepSeek
50
+ `;
51
+ }
52
+ export const INTEGRATION_GUIDE = `Como integrar a Maria Pay num app:
53
+ 1. Guarde a chave (sp_test_ para desenvolver) numa variável de ambiente do servidor, ex.: MARIAPAY_API_KEY. Nunca no front-end.
54
+ 2. No checkout do seu app, o servidor chama POST /v2/transparents/create com method PIX, amount em centavos e externalId = id do pedido.
55
+ 3. Mostre ao cliente o brCode (copia e cola) e o QR (brCodeBase64 em <img>), ou redirecione para url.
56
+ 4. Cadastre um webhook (POST /v2/webhooks/create, evento transparent.completed) apontando para uma rota HTTPS do seu servidor.
57
+ 5. Na rota do webhook: confira X-Webhook-Secret e X-Webhook-Signature, ache o pedido por data.externalId (ou pelo id da cobrança) e marque como pago. Seja idempotente.
58
+ 6. Em teste, use POST /v2/transparents/simulate-payment para disparar o webhook sem dinheiro real.
59
+ 7. Troque para sp_live_ quando for para produção.
60
+ SDK Node/TypeScript: npm install mariapay (sp.v2.transparents.create, sp.v2.webhooks.create, MariaPay.verifyWebhook).`;
@@ -0,0 +1,5 @@
1
+ export { TOOLS, TOOLSETS, selectTools, findTool, parseToolsets, type ToolDef, type Toolset, type ToolFilter, type ApiRequest } from './tools.js';
2
+ export { createMariaPayMcpServer, createSniperPayMcpServer, executeTool, runTool, buildPath, MCP_SERVER_NAME, MCP_SERVER_VERSION, type ApiCaller, type ApiResponse, type ToolResult } from './server.js';
3
+ export { openAITools, type OpenAITool } from './openai.js';
4
+ export { httpCaller, modeOfKey } from './client.js';
5
+ export { llmsTxt, INTEGRATION_GUIDE, DEFAULT_BASE_URL } from './guide.js';
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { TOOLS, TOOLSETS, selectTools, findTool, parseToolsets } from './tools.js';
2
+ export { createMariaPayMcpServer, createSniperPayMcpServer, executeTool, runTool, buildPath, MCP_SERVER_NAME, MCP_SERVER_VERSION } from './server.js';
3
+ export { openAITools } from './openai.js';
4
+ export { httpCaller, modeOfKey } from './client.js';
5
+ export { llmsTxt, INTEGRATION_GUIDE, DEFAULT_BASE_URL } from './guide.js';
@@ -0,0 +1,10 @@
1
+ import { type ToolFilter } from './tools.js';
2
+ export interface OpenAITool {
3
+ type: 'function';
4
+ function: {
5
+ name: string;
6
+ description: string;
7
+ parameters: Record<string, unknown>;
8
+ };
9
+ }
10
+ export declare function openAITools(filter?: ToolFilter): OpenAITool[];
package/dist/openai.js ADDED
@@ -0,0 +1,16 @@
1
+ // As mesmas ferramentas no formato de function calling da OpenAI
2
+ // (serve para DeepSeek, Groq, OpenRouter, Mistral, Ollama e qualquer API compatível).
3
+ import { z } from 'zod';
4
+ import { zodToJsonSchema } from 'zod-to-json-schema';
5
+ import { selectTools } from './tools.js';
6
+ export function openAITools(filter = {}) {
7
+ return selectTools(filter).map(t => {
8
+ const schema = zodToJsonSchema(z.object(t.input).strict(), { target: 'openApi3', $refStrategy: 'none' });
9
+ delete schema.$schema;
10
+ const hints = [
11
+ t.annotations.destructiveHint ? 'Ação irreversível: confirme com o usuário antes.' : '',
12
+ t.testOnly ? 'Só funciona com chave sp_test_.' : '',
13
+ ].filter(Boolean).join(' ');
14
+ return { type: 'function', function: { name: t.name, description: hints ? `${t.description} ${hints}` : t.description, parameters: schema } };
15
+ });
16
+ }
@@ -0,0 +1,28 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { type ApiRequest, type ToolDef, type ToolFilter } from './tools.js';
3
+ export declare const MCP_SERVER_NAME = "maria-pay";
4
+ export declare const MCP_SERVER_VERSION = "0.1.0";
5
+ export interface ApiResponse {
6
+ status: number;
7
+ body: unknown;
8
+ }
9
+ export type ApiCaller = (req: ApiRequest) => Promise<ApiResponse>;
10
+ export interface ToolResult {
11
+ [k: string]: unknown;
12
+ content: {
13
+ type: 'text';
14
+ text: string;
15
+ }[];
16
+ isError?: boolean;
17
+ }
18
+ export declare function buildPath(req: ApiRequest): string;
19
+ /** Valida os argumentos, chama a API e devolve o resultado no formato de ferramenta MCP. */
20
+ export declare function runTool(tool: ToolDef, args: unknown, call: ApiCaller): Promise<ToolResult>;
21
+ export declare function executeTool(name: string, args: unknown, call: ApiCaller): Promise<ToolResult>;
22
+ export interface ServerOptions extends ToolFilter {
23
+ call: ApiCaller;
24
+ baseUrl: string;
25
+ }
26
+ export declare function createMariaPayMcpServer(o: ServerOptions): McpServer;
27
+ /** Nome antigo, mantido por compatibilidade. */
28
+ export declare const createSniperPayMcpServer: typeof createMariaPayMcpServer;
package/dist/server.js ADDED
@@ -0,0 +1,159 @@
1
+ // Monta o servidor MCP da Maria Pay sobre qualquer forma de chamar a API REST
2
+ // (fetch para a URL pública no pacote npm, ou chamada interna dentro da própria API).
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { z } from 'zod';
5
+ import { INTEGRATION_GUIDE, llmsTxt } from './guide.js';
6
+ import { findTool, selectTools } from './tools.js';
7
+ export const MCP_SERVER_NAME = 'maria-pay';
8
+ export const MCP_SERVER_VERSION = '0.1.0';
9
+ /** Tira o QR em base64 (dezenas de KB) do texto devolvido ao modelo; o brCode e a url continuam. */
10
+ function slim(v) {
11
+ if (Array.isArray(v))
12
+ return v.map(slim);
13
+ if (v && typeof v === 'object') {
14
+ const out = {};
15
+ for (const [k, x] of Object.entries(v)) {
16
+ out[k] = k === 'brCodeBase64' && typeof x === 'string' ? '(QR Code PNG omitido; use brCode ou url)' : slim(x);
17
+ }
18
+ return out;
19
+ }
20
+ return v;
21
+ }
22
+ export function buildPath(req) {
23
+ const qs = new URLSearchParams();
24
+ for (const [k, v] of Object.entries(req.query ?? {}))
25
+ if (v !== undefined && v !== null && v !== '')
26
+ qs.set(k, String(v));
27
+ const s = qs.toString();
28
+ return s ? `${req.path}?${s}` : req.path;
29
+ }
30
+ /** Valida os argumentos, chama a API e devolve o resultado no formato de ferramenta MCP. */
31
+ export async function runTool(tool, args, call) {
32
+ const parsed = z.object(tool.input).safeParse(args ?? {});
33
+ if (!parsed.success) {
34
+ return { isError: true, content: [{ type: 'text', text: `Argumentos inválidos: ${parsed.error.issues.map(i => `${i.path.join('.') || 'args'}: ${i.message}`).join('; ')}` }] };
35
+ }
36
+ let res;
37
+ try {
38
+ res = await call(tool.request(parsed.data));
39
+ }
40
+ catch (e) {
41
+ return { isError: true, content: [{ type: 'text', text: `Falha ao chamar a API da Maria Pay: ${e.message}` }] };
42
+ }
43
+ const b = res.body;
44
+ const failed = res.status >= 400 || b?.success === false || (b != null && typeof b === 'object' && 'error' in b && b.error != null);
45
+ if (failed) {
46
+ const msg = typeof b?.error === 'string' ? b.error : JSON.stringify(res.body);
47
+ return { isError: true, content: [{ type: 'text', text: `Erro ${res.status}: ${msg}` }] };
48
+ }
49
+ return { content: [{ type: 'text', text: JSON.stringify(slim(res.body), null, 2) }] };
50
+ }
51
+ export async function executeTool(name, args, call) {
52
+ const tool = findTool(name);
53
+ if (!tool)
54
+ return { isError: true, content: [{ type: 'text', text: `Ferramenta desconhecida: ${name}` }] };
55
+ return runTool(tool, args, call);
56
+ }
57
+ export function createMariaPayMcpServer(o) {
58
+ const server = new McpServer({ name: MCP_SERVER_NAME, title: 'Maria Pay', version: MCP_SERVER_VERSION, websiteUrl: `${o.baseUrl.replace(/\/$/, '')}/docs` }, {
59
+ instructions: 'Maria Pay: cobranças Pix, boleto e carnê no Brasil. Valores sempre em centavos (R$ 19,90 = 1990). ' +
60
+ (o.mode === 'test' ? 'Esta chave é de TESTE (sp_test_): nada é cobrado de verdade e simulate_pix_payment está disponível. ' : '') +
61
+ (o.mode === 'live' ? 'Esta chave é de PRODUÇÃO (sp_live_): cobranças e reembolsos são reais. ' : '') +
62
+ 'Confirme com o usuário antes de reembolsar, cancelar ou excluir. Para mostrar um Pix ao cliente, use brCode (copia e cola) ou url. ' +
63
+ 'O guia da API está no recurso mariapay://docs/guia.',
64
+ });
65
+ for (const t of selectTools(o)) {
66
+ server.registerTool(t.name, {
67
+ title: t.title,
68
+ description: t.description,
69
+ inputSchema: t.input,
70
+ annotations: { title: t.title, ...t.annotations },
71
+ }, async (args) => runTool(t, args, o.call));
72
+ }
73
+ const readers = {
74
+ 'mariapay://docs/guia': async (uri) => ({ contents: [{ uri: uri.href, mimeType: 'text/markdown', text: llmsTxt(o.baseUrl) }] }),
75
+ 'mariapay://fees': async (uri) => {
76
+ const r = await o.call({ method: 'GET', path: '/fees' });
77
+ return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(r.body?.data ?? r.body, null, 2) }] };
78
+ },
79
+ 'mariapay://docs/integracao': async (uri) => ({ contents: [{ uri: uri.href, mimeType: 'text/plain', text: INTEGRATION_GUIDE }] }),
80
+ };
81
+ server.registerResource('guia', 'mariapay://docs/guia', {
82
+ title: 'Guia da API Maria Pay',
83
+ description: 'Rotas, formatos, webhooks e boas práticas (llms.txt). / API guide for agents.',
84
+ mimeType: 'text/markdown',
85
+ }, readers['mariapay://docs/guia']);
86
+ server.registerResource('taxas', 'mariapay://fees', {
87
+ title: 'Tabela de taxas',
88
+ description: 'Taxas por forma de pagamento, em centavos. / Fee table.',
89
+ mimeType: 'application/json',
90
+ }, readers['mariapay://fees']);
91
+ server.registerResource('integracao', 'mariapay://docs/integracao', {
92
+ title: 'Passo a passo de integração',
93
+ description: 'Como ligar a Maria Pay num app, do Pix ao webhook. / Integration checklist.',
94
+ mimeType: 'text/plain',
95
+ }, readers['mariapay://docs/integracao']);
96
+ // Endereços antigos dos recursos (sniperpay://), de antes da troca de marca. Mesmo conteúdo.
97
+ for (const [name, uri, target] of [
98
+ ['guia-antigo', 'sniperpay://docs/guia', 'mariapay://docs/guia'],
99
+ ['taxas-antigo', 'sniperpay://fees', 'mariapay://fees'],
100
+ ['integracao-antigo', 'sniperpay://docs/integracao', 'mariapay://docs/integracao'],
101
+ ]) {
102
+ server.registerResource(name, uri, { title: `Endereço antigo de ${target}`, description: `Use ${target}.` }, async (u) => {
103
+ const r = await readers[target](new URL(target));
104
+ return { contents: r.contents.map(c => ({ ...c, uri: u.href })) };
105
+ });
106
+ }
107
+ server.registerPrompt('criar_cobranca_pix', {
108
+ title: 'Criar cobrança Pix',
109
+ description: 'Cria um Pix e devolve o copia e cola e o link de pagamento.',
110
+ argsSchema: {
111
+ valor: z.string().describe('Valor em reais, ex.: 19,90'),
112
+ descricao: z.string().optional().describe('O que está sendo cobrado'),
113
+ cliente: z.string().optional().describe('Nome e CPF/CNPJ do pagador, se houver'),
114
+ },
115
+ }, ({ valor, descricao, cliente }) => ({
116
+ messages: [{
117
+ role: 'user',
118
+ content: {
119
+ type: 'text',
120
+ text: `Crie uma cobrança Pix na Maria Pay de R$ ${valor}${descricao ? ` para "${descricao}"` : ''}${cliente ? `, pagador: ${cliente}` : ''}. ` +
121
+ 'Converta o valor para centavos e use a ferramenta create_pix_charge. Depois me mostre o Pix copia e cola (brCode), o link de pagamento (url), o id e a validade. ' +
122
+ 'Se a chave for de teste, pergunte se quero simular o pagamento com simulate_pix_payment.',
123
+ },
124
+ }],
125
+ }));
126
+ server.registerPrompt('integrar_mariapay', {
127
+ title: 'Integrar a Maria Pay no meu app',
128
+ description: 'Gera o código de integração (cobrança Pix e webhook) para a stack do seu projeto.',
129
+ argsSchema: { stack: z.string().optional().describe('Ex.: Next.js, NestJS, Express, Laravel, Django') },
130
+ }, ({ stack }) => ({
131
+ messages: [{
132
+ role: 'user',
133
+ content: {
134
+ type: 'text',
135
+ text: `Quero receber pagamentos por Pix no meu app${stack ? ` (${stack})` : ''} usando a Maria Pay.\n\n${INTEGRATION_GUIDE}\n\n` +
136
+ 'Leia o recurso mariapay://docs/guia, olhe o meu projeto e escreva a integração: rota no servidor que cria o Pix, tela que mostra o QR e o copia e cola, ' +
137
+ 'e a rota de webhook que confere o secret e a assinatura antes de marcar o pedido como pago. Use variáveis de ambiente para a chave. ' +
138
+ 'Se puder, teste com create_pix_charge e simulate_pix_payment usando a chave de teste.',
139
+ },
140
+ }],
141
+ }));
142
+ server.registerPrompt('resumo_recebimentos', {
143
+ title: 'Resumo de recebimentos',
144
+ description: 'Saldo e vendas recentes da loja.',
145
+ argsSchema: { periodo: z.string().optional().describe('Ex.: hoje, últimos 7 dias, novembro') },
146
+ }, ({ periodo }) => ({
147
+ messages: [{
148
+ role: 'user',
149
+ content: {
150
+ type: 'text',
151
+ text: `Me dê um resumo dos recebimentos da Maria Pay${periodo ? ` (${periodo})` : ''}: use get_balance e list_charges (status PAID e REFUNDED, com startDate/endDate se fizer sentido). ` +
152
+ 'Mostre total recebido, taxas, reembolsos e líquido em reais, e as maiores vendas.',
153
+ },
154
+ }],
155
+ }));
156
+ return server;
157
+ }
158
+ /** Nome antigo, mantido por compatibilidade. */
159
+ export const createSniperPayMcpServer = createMariaPayMcpServer;
@@ -0,0 +1,42 @@
1
+ import { type ZodRawShape } from 'zod';
2
+ export type HttpMethod = 'GET' | 'POST' | 'PUT';
3
+ export interface ApiRequest {
4
+ method: HttpMethod;
5
+ path: string;
6
+ query?: Record<string, unknown>;
7
+ body?: unknown;
8
+ }
9
+ /** Grupos de ferramentas. Dá para carregar só alguns (MARIAPAY_TOOLSETS ou ?toolsets=). */
10
+ export declare const TOOLSETS: readonly ["pix", "boleto", "billing", "catalog", "webhooks", "account", "v1"];
11
+ export type Toolset = (typeof TOOLSETS)[number];
12
+ export interface ToolAnnotations {
13
+ readOnlyHint?: boolean;
14
+ destructiveHint?: boolean;
15
+ idempotentHint?: boolean;
16
+ openWorldHint?: boolean;
17
+ }
18
+ export interface ToolDef {
19
+ name: string;
20
+ title: string;
21
+ description: string;
22
+ toolset: Toolset;
23
+ /** permissão da chave exigida pela rota (null = rota pública) */
24
+ permission: string | null;
25
+ /** só faz sentido com chave sp_test_ (simulação de pagamento) */
26
+ testOnly?: boolean;
27
+ annotations: ToolAnnotations;
28
+ input: ZodRawShape;
29
+ request: (args: any) => ApiRequest;
30
+ }
31
+ export declare const TOOLS: ToolDef[];
32
+ export interface ToolFilter {
33
+ /** modo da chave; em 'live' as ferramentas de simulação somem (a não ser que allowSimulate) */
34
+ mode?: 'test' | 'live' | 'unknown';
35
+ allowSimulate?: boolean;
36
+ /** permissões da chave (null/undefined = todas) */
37
+ permissions?: string[] | null;
38
+ toolsets?: string[] | null;
39
+ }
40
+ export declare function parseToolsets(input: string | null | undefined): Toolset[] | null;
41
+ export declare function selectTools(f?: ToolFilter): ToolDef[];
42
+ export declare const findTool: (name: string) => ToolDef | undefined;
package/dist/tools.js ADDED
@@ -0,0 +1,435 @@
1
+ // Ferramentas da Maria Pay para agentes de IA (MCP e function calling).
2
+ // Cada ferramenta vira uma chamada à API REST, com a mesma chave, permissões e modo (teste/produção).
3
+ import { z } from 'zod';
4
+ /** Grupos de ferramentas. Dá para carregar só alguns (MARIAPAY_TOOLSETS ou ?toolsets=). */
5
+ export const TOOLSETS = ['pix', 'boleto', 'billing', 'catalog', 'webhooks', 'account', 'v1'];
6
+ // ---------- Pedaços de schema ----------
7
+ const cents = (min, what) => z.number().int().min(min).max(100_000_000)
8
+ .describe(`${what} em centavos (R$ 19,90 = 1990). Mínimo ${min}. / ${what} in cents (BRL).`);
9
+ const date = (d) => z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'use YYYY-MM-DD').describe(d);
10
+ const meta = z.record(z.unknown()).describe('Seus dados livres, devolvidos nos webhooks. / Free-form metadata echoed in webhooks.');
11
+ const address = z.object({
12
+ zipCode: z.string().describe('CEP, 8 dígitos'),
13
+ street: z.string().min(1).max(200),
14
+ number: z.string().min(1).max(20),
15
+ neighborhood: z.string().min(1).max(120).describe('Bairro'),
16
+ city: z.string().min(1).max(120),
17
+ state: z.string().length(2).describe('UF, ex.: SP'),
18
+ complement: z.string().max(120).optional(),
19
+ }).describe('Endereço do pagador (alguns provedores exigem no boleto). / Payer address.');
20
+ const payer = z.object({
21
+ name: z.string().min(1).max(200).describe('Nome do pagador / payer name'),
22
+ taxId: z.string().max(30).describe('CPF ou CNPJ / Brazilian tax id'),
23
+ email: z.string().email().optional(),
24
+ cellphone: z.string().max(30).optional(),
25
+ address: address.optional(),
26
+ });
27
+ const page = {
28
+ limit: z.number().int().min(1).max(100).optional().describe('Itens por página (1 a 100, padrão 100). / Page size.'),
29
+ after: z.string().optional().describe('Cursor `pagination.next` da página anterior. / Next-page cursor.'),
30
+ before: z.string().optional().describe('Cursor `pagination.before`. / Previous-page cursor.'),
31
+ startDate: date('Criados a partir de (YYYY-MM-DD). / Created on or after.').optional(),
32
+ endDate: date('Criados até (YYYY-MM-DD). / Created on or before.').optional(),
33
+ };
34
+ const pageQuery = (a) => ({ limit: a.limit, after: a.after, before: a.before, startDate: a.startDate, endDate: a.endDate });
35
+ const idArg = (what) => ({ id: z.string().min(1).describe(`Id ${what}. / ${what} id.`) });
36
+ const refundArgs = (what) => ({
37
+ id: z.string().min(1).describe(`Id ${what}. / ${what} id.`),
38
+ reason: z.string().max(500).optional().describe('Motivo do reembolso. / Refund reason.'),
39
+ });
40
+ const READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
41
+ const CREATE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true };
42
+ const WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
43
+ const DESTRUCTIVE = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true };
44
+ const DELETE = { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false };
45
+ const checkoutCreate = {
46
+ items: z.array(z.object({
47
+ id: z.string().min(1).describe('Id do produto (prod_...) / product id'),
48
+ quantity: z.number().int().min(1).max(100_000).default(1),
49
+ })).min(1).max(100).describe('Produtos já cadastrados (create_product). / Products created with create_product.'),
50
+ methods: z.array(z.enum(['PIX', 'BOLETO'])).optional().describe('Formas de pagamento aceitas (padrão: PIX). / Accepted methods.'),
51
+ returnUrl: z.string().url().optional().describe('Link do botão "voltar". / Back button URL.'),
52
+ completionUrl: z.string().url().optional().describe('Para onde o cliente vai depois de pagar. / Redirect after payment.'),
53
+ coupons: z.array(z.string().min(1).max(100)).max(50).optional().describe('Códigos de cupom aceitos. / Allowed coupon codes.'),
54
+ externalId: z.string().min(1).max(200).optional().describe('Seu id do pedido. / Your order id.'),
55
+ metadata: meta.optional(),
56
+ };
57
+ const checkoutFilters = {
58
+ status: z.enum(['PENDING', 'PAID', 'EXPIRED', 'CANCELLED', 'REFUNDED']).optional(),
59
+ externalId: z.string().optional(),
60
+ customerId: z.string().optional(),
61
+ };
62
+ function v2Billing(prefix, name, pt, en) {
63
+ const link = name === 'payment_link';
64
+ return [
65
+ {
66
+ name: `create_${name}`, title: `Criar ${pt}`, toolset: 'billing', permission: 'CHECKOUT:CREATE', annotations: CREATE,
67
+ description: link
68
+ ? 'Cria um link de pagamento reutilizável (vários clientes podem pagar). Devolve `url` para compartilhar. / Creates a reusable payment link; returns a shareable `url`.'
69
+ : 'Cria um checkout hospedado de pagamento único com produtos do catálogo. Devolve `url` da página de pagamento. / Creates a one-time hosted checkout; returns the payment page `url`.',
70
+ input: link ? checkoutCreate : { ...checkoutCreate, customerId: z.string().optional().describe('Cliente já cadastrado (cust_...). / Existing customer id.') },
71
+ request: a => ({ method: 'POST', path: `/v2${prefix}/create`, body: a }),
72
+ },
73
+ {
74
+ name: `get_${name}`, title: `Consultar ${pt}`, toolset: 'billing', permission: 'CHECKOUT:READ', annotations: READ,
75
+ description: `Consulta um ${pt} por id (bill_...), externalId${link ? '' : ' ou customerId'}. Informe ao menos um. / Gets a ${en} by id, externalId${link ? '' : ' or customerId'}.`,
76
+ input: { id: z.string().optional(), externalId: z.string().optional(), ...(link ? {} : { customerId: z.string().optional() }) },
77
+ request: a => ({ method: 'GET', path: `/v2${prefix}/get`, query: a }),
78
+ },
79
+ {
80
+ name: `list_${name}s`, title: `Listar ${pt}s`, toolset: 'billing', permission: 'CHECKOUT:READ', annotations: READ,
81
+ description: `Lista ${pt}s do mais novo para o mais antigo, com filtros e paginação. / Lists ${en}s, newest first.`,
82
+ input: { ...checkoutFilters, ...page },
83
+ request: a => ({ method: 'GET', path: `/v2${prefix}/list`, query: { status: a.status, externalId: a.externalId, customerId: a.customerId, ...pageQuery(a) } }),
84
+ },
85
+ {
86
+ name: `refund_${name}`, title: `Reembolsar ${pt}`, toolset: 'billing', permission: 'REFUND:CREATE', annotations: DESTRUCTIVE,
87
+ description: link
88
+ ? 'Reembolsa o valor total de um pagamento feito pelo link. Use o id da cobrança individual (pix_char_/char_), não o bill_ do link. Sai do saldo; a taxa não volta. Irreversível. / Refunds one payment made through a link (use the individual charge id). Irreversible.'
89
+ : 'Reembolsa o valor total de um checkout pago (id bill_ ou da cobrança). Sai do saldo; a taxa não volta. Irreversível. / Fully refunds a paid checkout. Irreversible.',
90
+ input: refundArgs(link ? 'da cobrança (pix_char_/char_)' : 'do checkout (bill_) ou da cobrança'),
91
+ request: a => ({ method: 'POST', path: `/v2${prefix}/refund`, body: a }),
92
+ },
93
+ ];
94
+ }
95
+ // ---------- Ferramentas ----------
96
+ export const TOOLS = [
97
+ // ===== Pix (v2, checkout transparente) =====
98
+ {
99
+ name: 'create_pix_charge', title: 'Criar cobrança Pix', toolset: 'pix', permission: 'TRANSPARENT:CREATE', annotations: CREATE,
100
+ description: 'Cria uma cobrança Pix (QR Code de uso único, confirmação automática e webhook `transparent.completed`). Devolve `brCode` (copia e cola), `url` (página de pagamento) e `id` (pix_char_...). Taxa de R$ 0,99 só quando pago. / Creates a single-use Pix charge; returns `brCode`, payment `url` and `id`.',
101
+ input: {
102
+ amount: cents(100, 'Valor'),
103
+ description: z.string().max(500).optional().describe('Descrição que o pagador vê. / Description shown to the payer.'),
104
+ expiresIn: z.number().int().min(300).max(2_592_000).optional().describe('Validade em segundos (300 a 2592000, padrão 3600). / Expiry in seconds.'),
105
+ customer: payer.optional().describe('Pagador (opcional no Pix). / Payer (optional for Pix).'),
106
+ externalId: z.string().min(1).max(200).optional().describe('Seu id do pedido; repetir com uma cobrança pendente devolve a mesma. / Your order id (idempotent while pending).'),
107
+ coupon: z.string().max(100).optional().describe('Código de cupom. / Coupon code.'),
108
+ metadata: meta.optional(),
109
+ },
110
+ request: a => ({ method: 'POST', path: '/v2/transparents/create', body: { method: 'PIX', data: a } }),
111
+ },
112
+ {
113
+ name: 'get_charge', title: 'Consultar cobrança', toolset: 'pix', permission: 'TRANSPARENT:READ', annotations: READ,
114
+ description: 'Consulta uma cobrança Pix ou boleto criada por create_pix_charge/create_boleto (status, valor, taxa, datas, links). / Gets a Pix or boleto charge with its current status.',
115
+ input: idArg('da cobrança (pix_char_... ou bole_...)'),
116
+ request: a => ({ method: 'GET', path: '/v2/transparents/get', query: { id: a.id } }),
117
+ },
118
+ {
119
+ name: 'check_pix_status', title: 'Ver status do Pix', toolset: 'pix', permission: 'TRANSPARENT:READ', annotations: READ,
120
+ description: 'Status rápido de um Pix: PENDING, PAID, EXPIRED, CANCELLED ou REFUNDED. / Quick Pix status check.',
121
+ input: idArg('do Pix (pix_char_...)'),
122
+ request: a => ({ method: 'GET', path: '/v2/transparents/check', query: { id: a.id } }),
123
+ },
124
+ {
125
+ name: 'list_charges', title: 'Listar cobranças', toolset: 'pix', permission: 'TRANSPARENT:READ', annotations: READ,
126
+ description: 'Lista cobranças Pix e boleto (extrato de vendas), da mais nova para a mais antiga, com filtros e paginação. / Lists Pix and boleto charges (sales statement), newest first.',
127
+ input: {
128
+ method: z.enum(['PIX', 'BOLETO']).optional(),
129
+ status: z.enum(['PENDING', 'PAID', 'EXPIRED', 'CANCELLED', 'REFUNDED']).optional(),
130
+ externalId: z.string().optional(),
131
+ ...page,
132
+ },
133
+ request: a => ({ method: 'GET', path: '/v2/transparents/list', query: { method: a.method, status: a.status, externalId: a.externalId, ...pageQuery(a) } }),
134
+ },
135
+ {
136
+ name: 'simulate_pix_payment', title: 'Simular pagamento Pix (teste)', toolset: 'pix', permission: 'TRANSPARENT:CREATE', testOnly: true, annotations: WRITE,
137
+ description: 'Só com chave sp_test_: marca um Pix pendente como pago e dispara os webhooks, como se o cliente tivesse pago. Nenhum dinheiro se move. / Test mode only: marks a pending Pix as paid and fires webhooks.',
138
+ input: idArg('do Pix pendente (pix_char_...)'),
139
+ request: a => ({ method: 'POST', path: '/v2/transparents/simulate-payment', body: { id: a.id } }),
140
+ },
141
+ {
142
+ name: 'refund_charge', title: 'Reembolsar cobrança', toolset: 'pix', permission: 'REFUND:CREATE', annotations: DESTRUCTIVE,
143
+ description: 'Reembolsa o valor total de uma cobrança paga (Pix devolvido ao pagador). Sai do saldo e a taxa não volta. Irreversível: confirme com o usuário antes. / Fully refunds a paid charge. Irreversible: confirm with the user first.',
144
+ input: refundArgs('da cobrança paga (pix_char_...)'),
145
+ request: a => ({ method: 'POST', path: '/v2/transparents/refund', body: a }),
146
+ },
147
+ {
148
+ name: 'cancel_charge', title: 'Cancelar cobrança', toolset: 'pix', permission: 'V1:ALL', annotations: DESTRUCTIVE,
149
+ description: 'Cancela uma cobrança Pix ou boleto ainda pendente (o QR/boleto deixa de valer). Não serve para cobrança paga: use refund_charge. / Cancels a pending Pix or boleto charge.',
150
+ input: {
151
+ ...idArg('da cobrança pendente'),
152
+ method: z.enum(['PIX', 'BOLETO']).optional().describe('Padrão: pelo prefixo do id (pix_char_ = PIX). / Defaults from the id prefix.'),
153
+ },
154
+ request: a => {
155
+ const pix = a.method ? a.method === 'PIX' : String(a.id).startsWith('pix_char_');
156
+ return { method: 'POST', path: `/v1/${pix ? 'pix/charges' : 'boletos'}/${encodeURIComponent(a.id)}/cancel` };
157
+ },
158
+ },
159
+ {
160
+ name: 'create_static_pix_qr', title: 'QR Pix estático', toolset: 'pix', permission: 'V1:ALL', annotations: WRITE,
161
+ description: 'Gera um QR Pix estático e reutilizável (balcão, doação), com valor fixo ou livre. Não tem confirmação automática; para rastrear o pagamento use create_pix_charge. / Builds a reusable static Pix QR (no automatic confirmation).',
162
+ input: {
163
+ amount: z.number().int().min(1).max(100_000_000).optional().describe('Centavos; sem valor = valor livre. / Cents; omit for open amount.'),
164
+ description: z.string().max(40).optional(),
165
+ },
166
+ request: a => ({ method: 'POST', path: '/v1/pix/static', body: a }),
167
+ },
168
+ // ===== Boleto e carnê =====
169
+ {
170
+ name: 'create_boleto', title: 'Criar boleto', toolset: 'boleto', permission: 'TRANSPARENT:CREATE', annotations: CREATE,
171
+ description: 'Cria um boleto (com QR Pix quando o provedor suporta). Exige pagador com nome e CPF/CNPJ. Taxa de R$ 3,49 só quando pago. Devolve linha digitável (`identificationNumber`), `barCode` e `url`. / Creates a boleto; requires payer name and tax id.',
172
+ input: {
173
+ amount: cents(300, 'Valor'),
174
+ customer: payer.describe('Pagador (obrigatório). / Payer (required).'),
175
+ dueDate: date('Vencimento YYYY-MM-DD (padrão: 3 dias úteis). / Due date.').optional(),
176
+ description: z.string().max(500).optional(),
177
+ interest: z.object({ value: z.number().int().min(0) }).optional().describe('Juros ao mês, em centésimos de % (100 = 1%). / Monthly interest.'),
178
+ fine: z.object({ value: z.number().int().min(0), type: z.enum(['PERCENTAGE', 'FIXED']) }).optional().describe('Multa por atraso. / Late fine.'),
179
+ externalId: z.string().min(1).max(200).optional(),
180
+ coupon: z.string().max(100).optional(),
181
+ metadata: meta.optional(),
182
+ },
183
+ request: a => ({ method: 'POST', path: '/v2/transparents/create', body: { method: 'BOLETO', data: a } }),
184
+ },
185
+ {
186
+ name: 'create_carne', title: 'Criar carnê', toolset: 'boleto', permission: 'V1:ALL', annotations: CREATE,
187
+ description: 'Cria um carnê: o valor total dividido em 2 a 24 boletos mensais (cada parcela de no mínimo R$ 5,00). / Creates an installment plan of 2-24 monthly boletos.',
188
+ input: {
189
+ description: z.string().min(1).max(255),
190
+ customer: payer.describe('Pagador (obrigatório). / Payer (required).'),
191
+ totalAmount: z.number().int().min(1000).max(1_000_000_000).describe('Valor total em centavos. / Total in cents.'),
192
+ installments: z.number().int().min(2).max(24).describe('Número de parcelas. / Number of installments.'),
193
+ firstDueDate: date('Vencimento da 1ª parcela (YYYY-MM-DD). / First due date.'),
194
+ finePercent: z.number().min(0).max(2).optional().describe('Multa em % (máx. 2). / Fine %.'),
195
+ interestMonthly: z.number().min(0).max(10).optional().describe('Juros em % ao mês. / Monthly interest %.'),
196
+ metadata: meta.optional(),
197
+ },
198
+ request: a => ({ method: 'POST', path: '/v1/boletos/carne', body: a }),
199
+ },
200
+ {
201
+ name: 'get_carne', title: 'Consultar carnê', toolset: 'boleto', permission: 'V1:ALL', annotations: READ,
202
+ description: 'Consulta um carnê e o status de cada parcela. / Gets an installment plan and each installment status.',
203
+ input: { carnetId: z.string().min(1).describe('Id do carnê (carnetId). / Plan id.') },
204
+ request: a => ({ method: 'GET', path: `/v1/boletos/carne/${encodeURIComponent(a.carnetId)}` }),
205
+ },
206
+ // ===== Checkout hospedado e links =====
207
+ ...v2Billing('/checkouts', 'checkout', 'checkout', 'checkout'),
208
+ ...v2Billing('/payment-links', 'payment_link', 'link de pagamento', 'payment link'),
209
+ // ===== Catálogo: produtos, clientes, cupons =====
210
+ {
211
+ name: 'create_product', title: 'Criar produto', toolset: 'catalog', permission: 'PRODUCT:CREATE', annotations: WRITE,
212
+ description: 'Cadastra um produto para usar em checkouts e links. / Creates a product for checkouts and links.',
213
+ input: {
214
+ externalId: z.string().min(1).max(200).describe('Seu id do produto (único). / Your product id.'),
215
+ name: z.string().min(1).max(200),
216
+ price: cents(1, 'Preço'),
217
+ description: z.string().max(2000).optional(),
218
+ imageUrl: z.string().url().optional(),
219
+ },
220
+ request: a => ({ method: 'POST', path: '/v2/products/create', body: a }),
221
+ },
222
+ {
223
+ name: 'get_product', title: 'Consultar produto', toolset: 'catalog', permission: 'PRODUCT:READ', annotations: READ,
224
+ description: 'Consulta um produto por id (prod_...), externalId ou nome. / Gets a product.',
225
+ input: { id: z.string().optional(), externalId: z.string().optional(), name: z.string().optional() },
226
+ request: a => ({ method: 'GET', path: '/v2/products/get', query: a }),
227
+ },
228
+ {
229
+ name: 'list_products', title: 'Listar produtos', toolset: 'catalog', permission: 'PRODUCT:READ', annotations: READ,
230
+ description: 'Lista produtos ativos (ou arquivados). / Lists products.',
231
+ input: { status: z.enum(['ACTIVE', 'ARCHIVED']).optional(), name: z.string().optional(), externalId: z.string().optional(), ...page },
232
+ request: a => ({ method: 'GET', path: '/v2/products/list', query: { status: a.status, name: a.name, externalId: a.externalId, ...pageQuery(a) } }),
233
+ },
234
+ {
235
+ name: 'delete_product', title: 'Arquivar produto', toolset: 'catalog', permission: 'PRODUCT:DELETE', annotations: DELETE,
236
+ description: 'Arquiva um produto (some do catálogo; checkouts antigos continuam). / Archives a product.',
237
+ input: idArg('do produto (prod_...)'),
238
+ request: a => ({ method: 'POST', path: '/v2/products/delete', body: { id: a.id } }),
239
+ },
240
+ {
241
+ name: 'create_customer', title: 'Cadastrar cliente', toolset: 'catalog', permission: 'CUSTOMER:CREATE', annotations: WRITE,
242
+ description: 'Cadastra ou atualiza um cliente (o mesmo CPF/CNPJ, e-mail ou celular atualiza o existente). / Creates or updates (upsert) a customer.',
243
+ input: {
244
+ email: z.string().email(),
245
+ name: z.string().min(1).max(200).optional(),
246
+ cellphone: z.string().max(30).optional(),
247
+ taxId: z.string().max(30).optional().describe('CPF ou CNPJ'),
248
+ address: address.optional(),
249
+ metadata: z.record(z.string()).optional(),
250
+ },
251
+ request: a => ({ method: 'POST', path: '/v2/customers/create', body: a }),
252
+ },
253
+ {
254
+ name: 'get_customer', title: 'Consultar cliente', toolset: 'catalog', permission: 'CUSTOMER:READ', annotations: READ,
255
+ description: 'Consulta um cliente por id (cust_...), e-mail ou CPF/CNPJ. / Gets a customer.',
256
+ input: { id: z.string().optional(), email: z.string().optional(), taxId: z.string().optional() },
257
+ request: a => ({ method: 'GET', path: '/v2/customers/get', query: a }),
258
+ },
259
+ {
260
+ name: 'list_customers', title: 'Listar clientes', toolset: 'catalog', permission: 'CUSTOMER:READ', annotations: READ,
261
+ description: 'Lista clientes, com filtros por nome, e-mail, CPF/CNPJ ou celular. / Lists customers.',
262
+ input: { name: z.string().optional(), email: z.string().optional(), taxId: z.string().optional(), cellphone: z.string().optional(), ...page },
263
+ request: a => ({ method: 'GET', path: '/v2/customers/list', query: { name: a.name, email: a.email, taxId: a.taxId, cellphone: a.cellphone, ...pageQuery(a) } }),
264
+ },
265
+ {
266
+ name: 'delete_customer', title: 'Excluir cliente', toolset: 'catalog', permission: 'CUSTOMER:DELETE', annotations: DELETE,
267
+ description: 'Exclui um cliente do cadastro (cobranças antigas continuam). / Deletes a customer.',
268
+ input: idArg('do cliente (cust_...)'),
269
+ request: a => ({ method: 'POST', path: '/v2/customers/delete', body: { id: a.id } }),
270
+ },
271
+ {
272
+ name: 'create_coupon', title: 'Criar cupom', toolset: 'catalog', permission: 'COUPON:CREATE', annotations: WRITE,
273
+ description: 'Cria um cupom de desconto em % ou valor fixo, com limite de usos e validade. / Creates a discount coupon.',
274
+ input: {
275
+ code: z.string().min(1).max(100).regex(/^[A-Za-z0-9_-]+$/).describe('Código, ex.: BEMVINDO10'),
276
+ discountKind: z.enum(['PERCENTAGE', 'FIXED']),
277
+ discount: z.number().int().min(1).describe('PERCENTAGE: centésimos de % (1000 = 10%, máx. 10000). FIXED: centavos (mín. 100). / Basis points or cents.'),
278
+ maxRedeems: z.number().int().describe('Limite de usos (-1 = sem limite). / Max uses (-1 = unlimited).'),
279
+ notes: z.string().max(500).optional(),
280
+ startsAt: z.string().optional().describe('Início (ISO 8601).'),
281
+ expiresAt: z.string().optional().describe('Fim (ISO 8601).'),
282
+ },
283
+ request: a => ({ method: 'POST', path: '/v2/coupons/create', body: a }),
284
+ },
285
+ {
286
+ name: 'get_coupon', title: 'Consultar cupom', toolset: 'catalog', permission: 'COUPON:READ', annotations: READ,
287
+ description: 'Consulta um cupom pelo código. / Gets a coupon by code.',
288
+ input: idArg('do cupom (é o próprio código, ex.: BEMVINDO10)'),
289
+ request: a => ({ method: 'GET', path: '/v2/coupons/get', query: { id: a.id } }),
290
+ },
291
+ {
292
+ name: 'list_coupons', title: 'Listar cupons', toolset: 'catalog', permission: 'COUPON:READ', annotations: READ,
293
+ description: 'Lista cupons. / Lists coupons.',
294
+ input: { status: z.enum(['ACTIVE', 'EXPIRED', 'DISABLED']).optional(), ...page },
295
+ request: a => ({ method: 'GET', path: '/v2/coupons/list', query: { status: a.status, ...pageQuery(a) } }),
296
+ },
297
+ {
298
+ name: 'toggle_coupon', title: 'Ativar/desativar cupom', toolset: 'catalog', permission: 'COUPON:UPDATE', annotations: WRITE,
299
+ description: 'Liga ou desliga um cupom (alterna entre ACTIVE e DISABLED). / Toggles a coupon on or off.',
300
+ input: idArg('do cupom (é o próprio código, ex.: BEMVINDO10)'),
301
+ request: a => ({ method: 'POST', path: '/v2/coupons/toggle', body: { id: a.id } }),
302
+ },
303
+ {
304
+ name: 'delete_coupon', title: 'Excluir cupom', toolset: 'catalog', permission: 'COUPON:DELETE', annotations: DELETE,
305
+ description: 'Exclui um cupom. / Deletes a coupon.',
306
+ input: idArg('do cupom (é o próprio código, ex.: BEMVINDO10)'),
307
+ request: a => ({ method: 'POST', path: '/v2/coupons/delete', body: { id: a.id } }),
308
+ },
309
+ // ===== Webhooks =====
310
+ {
311
+ name: 'create_webhook', title: 'Cadastrar webhook', toolset: 'webhooks', permission: 'WEBHOOK:CREATE', annotations: WRITE,
312
+ description: 'Cadastra uma URL HTTPS pública para receber eventos. Sem `secret`, a Maria Pay gera um e mostra só nesta resposta: guarde-o. / Registers an HTTPS endpoint for events; a generated secret is shown only once.',
313
+ input: {
314
+ name: z.string().min(1).max(200),
315
+ endpoint: z.string().url().describe('URL HTTPS pública. / Public HTTPS URL.'),
316
+ events: z.array(z.enum([
317
+ 'checkout.completed', 'checkout.refunded', 'checkout.disputed', 'checkout.lost',
318
+ 'transparent.completed', 'transparent.refunded', 'transparent.disputed', 'transparent.lost',
319
+ ])).min(1).describe('Eventos. Pix/boleto avulso: transparent.*; checkout e link: checkout.*'),
320
+ secret: z.string().min(32).max(512).optional().describe('Seu secret (32+ caracteres). / Your secret.'),
321
+ },
322
+ request: a => ({ method: 'POST', path: '/v2/webhooks/create', body: a }),
323
+ },
324
+ {
325
+ name: 'list_webhooks', title: 'Listar webhooks', toolset: 'webhooks', permission: 'WEBHOOK:READ', annotations: READ,
326
+ description: 'Lista webhooks cadastrados (busca por nome, id ou URL). / Lists webhooks.',
327
+ input: { search: z.string().optional(), ...page },
328
+ request: a => ({ method: 'GET', path: '/v2/webhooks/list', query: { search: a.search, ...pageQuery(a) } }),
329
+ },
330
+ {
331
+ name: 'get_webhook', title: 'Consultar webhook', toolset: 'webhooks', permission: 'WEBHOOK:READ', annotations: READ,
332
+ description: 'Consulta um webhook. / Gets a webhook.',
333
+ input: idArg('do webhook (webh_...)'),
334
+ request: a => ({ method: 'GET', path: '/v2/webhooks/get', query: { id: a.id } }),
335
+ },
336
+ {
337
+ name: 'delete_webhook', title: 'Excluir webhook', toolset: 'webhooks', permission: 'WEBHOOK:DELETE', annotations: DELETE,
338
+ description: 'Exclui um webhook (para de receber eventos). / Deletes a webhook.',
339
+ input: idArg('do webhook (webh_...)'),
340
+ request: a => ({ method: 'POST', path: '/v2/webhooks/delete', body: { id: a.id } }),
341
+ },
342
+ // ===== Conta =====
343
+ {
344
+ name: 'get_balance', title: 'Saldo', toolset: 'account', permission: 'V1:ALL', annotations: READ,
345
+ description: 'Saldo do modo da chave: recebido bruto, taxas, reembolsado e líquido, em centavos e formatado. / Balance: gross, fees, refunded and net.',
346
+ input: {},
347
+ request: () => ({ method: 'GET', path: '/v1/merchant/balance' }),
348
+ },
349
+ {
350
+ name: 'get_fee_table', title: 'Tabela de taxas', toolset: 'account', permission: null, annotations: READ,
351
+ description: 'Taxas da Maria Pay por forma de pagamento (cobradas só quando pago). / Fee table (charged only when paid).',
352
+ input: {},
353
+ request: () => ({ method: 'GET', path: '/fees' }),
354
+ },
355
+ {
356
+ name: 'list_pix_keys', title: 'Listar chaves Pix', toolset: 'account', permission: 'V1:ALL', annotations: READ,
357
+ description: 'Lista as chaves Pix da loja; a mais recente recebe as cobranças. / Lists the store Pix keys.',
358
+ input: {},
359
+ request: () => ({ method: 'GET', path: '/v1/pix/keys' }),
360
+ },
361
+ {
362
+ name: 'register_pix_key', title: 'Cadastrar chave Pix', toolset: 'account', permission: 'V1:ALL', annotations: WRITE,
363
+ description: 'Cadastra uma chave Pix existente (CPF, CNPJ, e-mail, +55 telefone ou aleatória) ou, sem `key`, gera uma aleatória quando o provedor permite. / Registers or generates a Pix key.',
364
+ input: { key: z.string().max(77).optional() },
365
+ request: a => ({ method: 'POST', path: '/v1/pix/keys', body: a }),
366
+ },
367
+ {
368
+ name: 'set_legacy_webhook_url', title: 'URL de webhook (v1)', toolset: 'account', permission: 'V1:ALL', annotations: WRITE,
369
+ description: 'Define (ou remove, com null) a URL única de webhook da conta, usada pelas cobranças v1. Prefira create_webhook. / Sets the account-level v1 webhook URL.',
370
+ input: { url: z.string().url().nullable() },
371
+ request: a => ({ method: 'PUT', path: '/v1/merchant/webhook', body: { url: a.url } }),
372
+ },
373
+ // ===== API v1 (cobranças simples) =====
374
+ {
375
+ name: 'v1_create_pix_charge', title: 'Criar Pix (v1)', toolset: 'v1', permission: 'V1:ALL', annotations: CREATE,
376
+ description: 'Cria uma cobrança Pix pela API v1 (webhook `charge.paid`). Para integrações novas prefira create_pix_charge. / Creates a Pix charge via API v1.',
377
+ input: {
378
+ amount: cents(100, 'Valor'),
379
+ expiresIn: z.number().int().min(60).max(2_592_000).optional().describe('Segundos (padrão 3600).'),
380
+ description: z.string().max(140).optional(),
381
+ customer: z.object({ name: z.string().min(2).max(200).optional(), email: z.string().email().optional(), taxId: z.string().max(20).optional(), cellphone: z.string().max(20).optional() }).optional(),
382
+ metadata: meta.optional(),
383
+ },
384
+ request: a => ({ method: 'POST', path: '/v1/pix/charges', body: a }),
385
+ },
386
+ {
387
+ name: 'v1_create_boleto', title: 'Criar boleto (v1)', toolset: 'v1', permission: 'V1:ALL', annotations: CREATE,
388
+ description: 'Cria um boleto pela API v1 (mínimo R$ 5,00, multa e juros em %). / Creates a boleto via API v1.',
389
+ input: {
390
+ amount: cents(500, 'Valor'),
391
+ dueDate: date('Vencimento YYYY-MM-DD.'),
392
+ description: z.string().min(1).max(255),
393
+ customer: payer.describe('Pagador (obrigatório). / Payer (required).'),
394
+ finePercent: z.number().min(0).max(2).optional(),
395
+ interestMonthly: z.number().min(0).max(10).optional(),
396
+ metadata: meta.optional(),
397
+ },
398
+ request: a => ({ method: 'POST', path: '/v1/boletos', body: a }),
399
+ },
400
+ {
401
+ name: 'v1_get_charge', title: 'Consultar cobrança (v1)', toolset: 'v1', permission: 'V1:ALL', annotations: READ,
402
+ description: 'Consulta uma cobrança v1 (Pix ou boleto) já atualizada com o provedor. / Gets a v1 charge.',
403
+ input: { kind: z.enum(['pix', 'boleto']), id: z.string().min(1) },
404
+ request: a => ({ method: 'GET', path: `/v1/${a.kind === 'pix' ? 'pix/charges' : 'boletos'}/${encodeURIComponent(a.id)}` }),
405
+ },
406
+ {
407
+ name: 'v1_list_charges', title: 'Listar cobranças (v1)', toolset: 'v1', permission: 'V1:ALL', annotations: READ,
408
+ description: 'Lista as cobranças v1 mais recentes de um tipo. / Lists recent v1 charges.',
409
+ input: { kind: z.enum(['pix', 'boleto']), limit: z.number().int().min(1).max(100).optional() },
410
+ request: a => ({ method: 'GET', path: `/v1/${a.kind === 'pix' ? 'pix/charges' : 'boletos'}`, query: { limit: a.limit } }),
411
+ },
412
+ {
413
+ name: 'v1_simulate_payment', title: 'Simular pagamento (v1, teste)', toolset: 'v1', permission: 'V1:ALL', testOnly: true, annotations: WRITE,
414
+ description: 'Só com chave sp_test_: marca uma cobrança v1 pendente (Pix ou boleto) como paga. / Test mode only: marks a pending v1 charge as paid.',
415
+ input: { kind: z.enum(['pix', 'boleto']), id: z.string().min(1) },
416
+ request: a => ({ method: 'POST', path: `/v1/${a.kind === 'pix' ? 'pix/charges' : 'boletos'}/${encodeURIComponent(a.id)}/simulate-payment` }),
417
+ },
418
+ ];
419
+ export function parseToolsets(input) {
420
+ if (!input)
421
+ return null;
422
+ const list = input.split(',').map(s => s.trim().toLowerCase()).filter(Boolean);
423
+ if (!list.length || list.includes('all'))
424
+ return null;
425
+ const bad = list.filter(s => !TOOLSETS.includes(s));
426
+ if (bad.length)
427
+ throw new Error(`Toolsets desconhecidos: ${bad.join(', ')}. Use: ${TOOLSETS.join(', ')}`);
428
+ return list;
429
+ }
430
+ export function selectTools(f = {}) {
431
+ return TOOLS.filter(t => (!f.toolsets || f.toolsets.includes(t.toolset)) &&
432
+ (!t.testOnly || f.mode !== 'live' || f.allowSimulate) &&
433
+ (t.permission == null || f.permissions == null || f.permissions.includes(t.permission)));
434
+ }
435
+ export const findTool = (name) => TOOLS.find(t => t.name === name);
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "mariapay-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Servidor MCP da Maria Pay: Pix, boleto, carnê, checkout, reembolso e webhooks para Claude, Codex, Cursor, VS Code, Windsurf, Gemini CLI e outros agentes",
5
+ "type": "module",
6
+ "bin": {
7
+ "mariapay-mcp": "dist/cli.js"
8
+ },
9
+ "main": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "scripts": {
26
+ "build": "tsc -p tsconfig.json && chmod +x dist/cli.js",
27
+ "prepublishOnly": "npm run build"
28
+ },
29
+ "keywords": [
30
+ "mcp",
31
+ "model-context-protocol",
32
+ "pix",
33
+ "boleto",
34
+ "pagamentos",
35
+ "mariapay",
36
+ "maria-pay",
37
+ "claude",
38
+ "codex",
39
+ "cursor",
40
+ "ai-agents"
41
+ ],
42
+ "author": "Laercio Borges (VERTAL COMPANY)",
43
+ "license": "MIT",
44
+ "homepage": "https://sniperpay-api-production.up.railway.app/docs#mcp",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/kuboprotocol/SniperPay.git",
48
+ "directory": "packages/mcp"
49
+ },
50
+ "dependencies": {
51
+ "@modelcontextprotocol/sdk": "^1.32.2",
52
+ "zod": "^3.25.76",
53
+ "zod-to-json-schema": "^3.25.2"
54
+ },
55
+ "devDependencies": {
56
+ "@types/node": "^22.10.2",
57
+ "typescript": "^5.7.2"
58
+ },
59
+ "publishConfig": {
60
+ "access": "public"
61
+ }
62
+ }