mergeon-mcp 1.63.0 → 1.65.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/README.md +9 -6
- package/dist/index.js +9 -9
- package/dist/tools/admin.js +14 -3
- package/dist/tools/admin.js.map +1 -1
- package/dist/tools/forms.js +19 -19
- package/dist/tools/nurturing.js +7 -7
- package/dist/tools/webhooks.js +2 -2
- package/package.json +1 -1
- package/scripts/install-skills.js +149 -149
- package/skills/forms-creation.md +196 -196
- package/skills/meta-events-debug.md +103 -103
- package/skills/nurturing-creation.md +190 -190
- package/skills/reviews-usage.md +78 -78
- package/skills/sales-analysis.md +93 -93
- package/skills/social-tracking.md +100 -100
- package/skills/webhooks-usage.md +184 -184
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Y Claude usa el MCP para hacerlo directamente contra tu backend de MergeOn.
|
|
|
17
17
|
|
|
18
18
|
1. [¿Qué expone el MCP?](#qué-expone-el-mcp)
|
|
19
19
|
2. [Setup en Claude Desktop / Claude Code](#setup)
|
|
20
|
-
3. [Tools disponibles (
|
|
20
|
+
3. [Tools disponibles (202)](#tools-disponibles)
|
|
21
21
|
4. [Skills incluidos](#skills-incluidos)
|
|
22
22
|
5. [Variables de entorno](#variables-de-entorno)
|
|
23
23
|
6. [Desarrollo local](#desarrollo-local)
|
|
@@ -36,7 +36,7 @@ Cada tool es una función que Claude puede invocar. Internamente, el MCP autenti
|
|
|
36
36
|
|
|
37
37
|
> **Cross-tenant (`ecommerce_id` override):** todas las tools aceptan un parámetro opcional `ecommerce_id` para apuntar a otro tenant (ej. `agent_prompts_update({ wpp_prompt_text: "...", ecommerce_id: "57" })`). La key de ecommerce 1 (superadmin) puede apuntar a **cualquier** tenant; una key de **implementador** puede apuntar a los ecommerces que gestiona; cualquier otra key solo opera sobre el suyo. El backend (`authorize_ecommerce_target`) valida la propiedad y devuelve 403 si no aplica.
|
|
38
38
|
|
|
39
|
-
Las
|
|
39
|
+
Las 202 tools cubren los principales dominios de MergeOn: **CRM, pedidos, productos, conversaciones, flujos de automatización (con catálogo de triggers/conditions/actions descubrible y filtros por reel específico via `media_ids`), calendario, marketing masivo, analytics legacy, analítica de ventas (revenue, top productos, comparativas y filtros por canal), eventos a Meta CAPI (auditoría + reenvío), nurturing/hidratación de leads, formularios dinámicos con tracking codes + UTMs, videos sociales con auto-tracking y funnel de conversión, webhooks entrantes, workers, reparto automático de contactos entre asesores con avisos dirigidos por WhatsApp, admin, configuración del agente IA (prompts + tools), business context (conocimiento dinámico para el agente), plantillas de WhatsApp avanzadas y configuración general del ecommerce**.
|
|
40
40
|
|
|
41
41
|
### B. Skills (guías de experto instalables en `CLAUDE.md`)
|
|
42
42
|
|
|
@@ -128,7 +128,7 @@ npx mergeon-mcp skills list
|
|
|
128
128
|
|
|
129
129
|
## Tools disponibles
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
202 tools organizadas en 24 dominios. Cada nombre corresponde a la cadena exacta que verás en Claude Desktop.
|
|
132
132
|
|
|
133
133
|
> 💡 Los dominios marcados con **(catálogo descubrible)** exponen un tool `<dominio>_get_catalog` que devuelve los enums, shapes y reglas válidas. Llámalo SIEMPRE antes de crear/modificar para no inventar campos.
|
|
134
134
|
|
|
@@ -357,7 +357,7 @@ Endpoints HTTP que MergeOn expone para que sistemas externos creen contactos, ve
|
|
|
357
357
|
| `custom_tools_delete` | Elimina la tool definitivamente (preferir `is_active=false` para solo apagarla). |
|
|
358
358
|
| `custom_tools_test` | Ejecuta la tool en el sandbox con params de prueba → `{ok, output, error, duration_ms}`. Correrla SIEMPRE tras crear/editar. |
|
|
359
359
|
|
|
360
|
-
### Admin (
|
|
360
|
+
### Admin (18 tools — superadmin `ecommerce_id=1` o implementador)
|
|
361
361
|
| Tool | Qué hace |
|
|
362
362
|
|---|---|
|
|
363
363
|
| `admin_ecommerces_list` | Lista ecommerces. Superadmin: todos. Implementador: solo los que gestiona. |
|
|
@@ -368,8 +368,11 @@ Endpoints HTTP que MergeOn expone para que sistemas externos creen contactos, ve
|
|
|
368
368
|
| `admin_subscription_update` | **Nuevo en 1.45.0:** PATCH parcial de la suscripción (status, plan_id, payer_email, periodo). `status: "canceled"` la cancela. **Superadmin.** |
|
|
369
369
|
| `admin_ecommerce_set_trial` | Otorga/extiende la prueba gratuita: `trial_ends_at = now + days` (days=0 la quita). Con trial vigente el negocio opera como pagado. **Superadmin.** |
|
|
370
370
|
| `admin_ecommerce_set_implementer` | Solo superadmin: marca/desmarca un ecommerce como implementador (`is_implementer`) y/o asigna su dueño (`implementer_id`, null para desasignar). |
|
|
371
|
-
| `admin_whatsapp_link` |
|
|
372
|
-
| `admin_whatsapp_disconnect` | Desconecta WhatsApp de
|
|
371
|
+
| `admin_whatsapp_link` | **Solo superadmin (1.65.0):** vincula la WABA + número de un cliente a un ecommerce (sin registrar en Meta). Un implementador recibe 403: conecta a su cliente mandándole el link de conexión, y mueve los suyos con `admin_portfolio_*`. |
|
|
372
|
+
| `admin_whatsapp_disconnect` | Desconecta WhatsApp de un ecommerce (no borra el ecommerce). **1.65.0:** el número de un cliente solo lo suelta el propio negocio o MergeOn; el implementador recibe 403 salvo que el número sea de su portafolio. |
|
|
373
|
+
| `admin_portfolio_numbers_list` | **Nuevo en 1.65.0:** números de tu propio portafolio de Meta (demos y operación propia), con el negocio que usa cada uno o `Libre`. Devuelve además `portfolio`: los demás números de las WABAs que ya conectaste. El alta se hace por Embedded Signup en el dashboard (Integraciones → Mi portafolio comercial). |
|
|
374
|
+
| `admin_portfolio_number_assign` | **Nuevo en 1.65.0:** conecta un número propio a un negocio tuyo que esté sin WhatsApp. 409 si el negocio ya tiene número o si este sigue en uso en otro. Un número atiende a un negocio a la vez. |
|
|
375
|
+
| `admin_portfolio_number_release` | **Nuevo en 1.65.0:** libera un número propio del negocio que lo usa y lo devuelve al pool. |
|
|
373
376
|
| `admin_subscriptions_list` | Suscripciones con filtros `status` y `plan`. Solo superadmin. |
|
|
374
377
|
| `admin_prompts_get` | Prompts del agente IA de un ecommerce concreto. Solo superadmin. |
|
|
375
378
|
| `admin_prompts_update` | Actualiza prompts del agente IA de un ecommerce. Solo superadmin. |
|
package/dist/index.js
CHANGED
|
@@ -5,15 +5,15 @@ import { z } from "zod";
|
|
|
5
5
|
import { MergeOnClient } from "./client.js";
|
|
6
6
|
import { registerAllTools } from "./tools/index.js";
|
|
7
7
|
const client = new MergeOnClient();
|
|
8
|
-
const MERGEON_INSTRUCTIONS = `Eres el consultor de implementación de MergeOn Seller para este usuario. Tu trabajo NO es solo listar datos ni volcar resultados: es entender el negocio y ayudar a IMPLEMENTAR sobre la plataforma.
|
|
9
|
-
|
|
10
|
-
Postura por defecto (aplícala en TODA interacción sobre MergeOn):
|
|
11
|
-
- No te limites a listar/leer y devolver un volcado. Cuando el usuario describe una necesidad ("quiero responder pautas", "que confirme ventas", "seguir leads fríos", "capturar de un reel"), haz 1–3 preguntas concretas para llenar los huecos y luego CREA la solución con las tools (flows_create, agent_prompts_update, nurturing_flow_create, forms_create, templates_create, etc.).
|
|
12
|
-
- Sé proactivo: propón qué automatizar y cómo, no esperes a que el usuario sepa el nombre exacto de la feature. Traduce lo que pide a triggers, conditions y actions concretas.
|
|
13
|
-
- Antes de crear algo con datos del negocio (mensajes, precios, envíos, tono), confirma los detalles mínimos que faltan en UNA pregunta agrupada, no en diez separadas.
|
|
14
|
-
- Después de crear/modificar algo, di en una frase qué quedó activo y ofrece el siguiente paso lógico (verificar, encadenar otro flow, activar el agente).
|
|
15
|
-
- Solo listar sin más cuando el usuario pide explícitamente ver/consultar datos ("muéstrame las ventas de hoy", "lista mis flows").
|
|
16
|
-
|
|
8
|
+
const MERGEON_INSTRUCTIONS = `Eres el consultor de implementación de MergeOn Seller para este usuario. Tu trabajo NO es solo listar datos ni volcar resultados: es entender el negocio y ayudar a IMPLEMENTAR sobre la plataforma.
|
|
9
|
+
|
|
10
|
+
Postura por defecto (aplícala en TODA interacción sobre MergeOn):
|
|
11
|
+
- No te limites a listar/leer y devolver un volcado. Cuando el usuario describe una necesidad ("quiero responder pautas", "que confirme ventas", "seguir leads fríos", "capturar de un reel"), haz 1–3 preguntas concretas para llenar los huecos y luego CREA la solución con las tools (flows_create, agent_prompts_update, nurturing_flow_create, forms_create, templates_create, etc.).
|
|
12
|
+
- Sé proactivo: propón qué automatizar y cómo, no esperes a que el usuario sepa el nombre exacto de la feature. Traduce lo que pide a triggers, conditions y actions concretas.
|
|
13
|
+
- Antes de crear algo con datos del negocio (mensajes, precios, envíos, tono), confirma los detalles mínimos que faltan en UNA pregunta agrupada, no en diez separadas.
|
|
14
|
+
- Después de crear/modificar algo, di en una frase qué quedó activo y ofrece el siguiente paso lógico (verificar, encadenar otro flow, activar el agente).
|
|
15
|
+
- Solo listar sin más cuando el usuario pide explícitamente ver/consultar datos ("muéstrame las ventas de hoy", "lista mis flows").
|
|
16
|
+
|
|
17
17
|
Conocimiento experto: las skills instaladas en el CLAUDE.md del usuario (prompt-creation, flows-creation, nurturing-creation, forms-creation, templates-creation, webhooks-usage, social-tracking, sales-analysis, meta-events-debug, reviews-usage) contienen la guía detallada de cada dominio. Si el usuario aún no las tiene, puede instalarlas todas con \`npx mergeon-mcp skills add all\`.`;
|
|
18
18
|
const server = new McpServer({
|
|
19
19
|
name: "mergeon",
|
package/dist/tools/admin.js
CHANGED
|
@@ -36,7 +36,7 @@ export function registerAdminTools(server, client) {
|
|
|
36
36
|
body.implementer_id = params.implementer_id;
|
|
37
37
|
return text(await client.post("/admin/ecommerces", body));
|
|
38
38
|
});
|
|
39
|
-
server.tool("admin_whatsapp_link", "
|
|
39
|
+
server.tool("admin_whatsapp_link", "Superadmin only (ecommerce_id=1): link a client's WhatsApp WABA + phone number to an ecommerce (no Meta registration; for already-active WABAs). Implementers get 403 here — they connect a client by sending it a connection link, and move their OWN numbers with admin_portfolio_*.", {
|
|
40
40
|
target_ecommerce_id: z.string().describe("ID of the ecommerce to link the number to (must be one you own)"),
|
|
41
41
|
waba_id: z.string().describe("WhatsApp Business Account ID"),
|
|
42
42
|
phone_number_id: z.string().describe("Meta phone_number_id"),
|
|
@@ -47,9 +47,20 @@ export function registerAdminTools(server, client) {
|
|
|
47
47
|
body.display_phone_number = display_phone_number;
|
|
48
48
|
return text(await client.post(`/admin/ecommerces/${target_ecommerce_id}/link-whatsapp`, body));
|
|
49
49
|
});
|
|
50
|
-
server.tool("admin_whatsapp_disconnect", "Disconnect WhatsApp (WABA + number) from
|
|
51
|
-
target_ecommerce_id: z.string().describe("ID of the ecommerce to disconnect WhatsApp from
|
|
50
|
+
server.tool("admin_whatsapp_disconnect", "Disconnect WhatsApp (WABA + number) from an ecommerce. Clears the integration but does NOT delete the ecommerce. A client's number can only be released by the business itself or by MergeOn (superadmin): an implementer gets 403 unless the number belongs to its own portfolio (use admin_portfolio_number_release for those).", {
|
|
51
|
+
target_ecommerce_id: z.string().describe("ID of the ecommerce to disconnect WhatsApp from"),
|
|
52
52
|
}, async ({ target_ecommerce_id }) => text(await client.delete(`/ecommerce/${target_ecommerce_id}/whatsapp`)));
|
|
53
|
+
// --- Portafolio propio del implementador ------------------------------
|
|
54
|
+
// Números que el socio trae de SU cuenta de Meta (demos, operación propia).
|
|
55
|
+
// El alta pasa por el Embedded Signup en el dashboard; por aquí se mueven.
|
|
56
|
+
server.tool("admin_portfolio_numbers_list", "List the WhatsApp numbers in your own portfolio (numbers you onboarded from your own Meta business, not your clients'), showing which ecommerce each one serves or that it is free. Also returns 'portfolio': the other numbers Meta reports in the WABAs you already connected, so you can see what else you could bring in.", {}, async () => text(await client.get("/admin/my-numbers")));
|
|
57
|
+
server.tool("admin_portfolio_number_assign", "Connect one of your own portfolio numbers to an ecommerce you own that has no WhatsApp linked. Fails with 409 if the target already has a number or if this number is still in use elsewhere (release it first). A number serves one ecommerce at a time.", {
|
|
58
|
+
number_id: z.number().describe("id of the portfolio number (from admin_portfolio_numbers_list)"),
|
|
59
|
+
target_ecommerce_id: z.number().describe("ID of the ecommerce to connect it to (must be one you own, with no WhatsApp linked)"),
|
|
60
|
+
}, async ({ number_id, target_ecommerce_id }) => text(await client.post(`/admin/my-numbers/${number_id}/assign`, { ecommerce_id: target_ecommerce_id })));
|
|
61
|
+
server.tool("admin_portfolio_number_release", "Release one of your own portfolio numbers from the ecommerce using it, leaving it free for another one. The ecommerce stops receiving messages through it.", {
|
|
62
|
+
number_id: z.number().describe("id of the portfolio number (from admin_portfolio_numbers_list)"),
|
|
63
|
+
}, async ({ number_id }) => text(await client.post(`/admin/my-numbers/${number_id}/release`, {})));
|
|
53
64
|
server.tool("admin_subscriptions_list", "List all subscriptions with ecommerce data. Filter by status or plan. Superadmin only.", {
|
|
54
65
|
status: z.string().optional().describe("Filter: active, canceled, expired"),
|
|
55
66
|
plan: z.string().optional().describe("Filter by plan name"),
|
package/dist/tools/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/tools/admin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,SAAS,IAAI,CAAC,IAAS;IACrB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACvF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAqB;IACzE,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,2KAA2K,EAC3K,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CACxD,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,2QAA2Q,EAC3Q;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACrE,SAAS,EAAE,CAAC,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AAM,CAAC,KAAK,CAAC,qBAAqB,mBAAmB,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;IACpF,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/forms.js
CHANGED
|
@@ -38,21 +38,21 @@ export function registerFormsTools(server, client) {
|
|
|
38
38
|
// ──────────────────────────────────────────────────────────────────
|
|
39
39
|
server.tool("forms_list", "Lists all forms for this ecommerce. Each form includes aggregated metrics (total_submissions, total_codes, last_submission_at). Use this before creating a tracking code or before designing a similar form.", {}, async () => text(await client.get("/forms/")));
|
|
40
40
|
server.tool("forms_get", "Returns one form with full form_schema and metrics by id.", { form_id: z.number().int() }, async ({ form_id }) => text(await client.get(`/forms/${form_id}`)));
|
|
41
|
-
server.tool("forms_create", `Creates a new form template. The form is rendered at mergeon.dev/form/{tracking_code} once you create at least one tracking code (see forms_tracking_codes_create).
|
|
42
|
-
|
|
43
|
-
Field types (FieldType): ${FIELD_TYPES.join(", ")}.
|
|
44
|
-
- 'phone' supports default_country (e.g. '+57') and country_options.
|
|
45
|
-
- 'select' / 'multi_select' require an options[] of {value,label}.
|
|
46
|
-
- show_if: { field, equals } shows the field only when another field equals a value (e.g. show "crm_name" only when "uses_crm" equals "yes").
|
|
47
|
-
|
|
48
|
-
destination_mode:
|
|
49
|
-
- 'mergeon_hosted' (default): renders at mergeon.dev/form/{code} using the schema.
|
|
50
|
-
- 'external_redirect': /r/{code} 302s to external_url with UTMs appended. No schema rendering. external_url is required.
|
|
51
|
-
|
|
52
|
-
after_submit:
|
|
53
|
-
- { type:'message', success_message:'...' } → muestra el mensaje y se queda en la página.
|
|
54
|
-
- { type:'redirect_url', value:'https://calendly...', open_in_new_tab:true } → redirige tras guardar.
|
|
55
|
-
|
|
41
|
+
server.tool("forms_create", `Creates a new form template. The form is rendered at mergeon.dev/form/{tracking_code} once you create at least one tracking code (see forms_tracking_codes_create).
|
|
42
|
+
|
|
43
|
+
Field types (FieldType): ${FIELD_TYPES.join(", ")}.
|
|
44
|
+
- 'phone' supports default_country (e.g. '+57') and country_options.
|
|
45
|
+
- 'select' / 'multi_select' require an options[] of {value,label}.
|
|
46
|
+
- show_if: { field, equals } shows the field only when another field equals a value (e.g. show "crm_name" only when "uses_crm" equals "yes").
|
|
47
|
+
|
|
48
|
+
destination_mode:
|
|
49
|
+
- 'mergeon_hosted' (default): renders at mergeon.dev/form/{code} using the schema.
|
|
50
|
+
- 'external_redirect': /r/{code} 302s to external_url with UTMs appended. No schema rendering. external_url is required.
|
|
51
|
+
|
|
52
|
+
after_submit:
|
|
53
|
+
- { type:'message', success_message:'...' } → muestra el mensaje y se queda en la página.
|
|
54
|
+
- { type:'redirect_url', value:'https://calendly...', open_in_new_tab:true } → redirige tras guardar.
|
|
55
|
+
|
|
56
56
|
webhook_url (optional): se firma con HMAC-SHA256 en X-Webhook-Signature usando SECRET_KEY del backend; el body lleva el submission completo.`, {
|
|
57
57
|
name: z.string().describe("Internal name shown in the app."),
|
|
58
58
|
title: z.string().optional().describe("Public-facing title rendered on the page."),
|
|
@@ -93,10 +93,10 @@ webhook_url (optional): se firma con HMAC-SHA256 en X-Webhook-Signature usando S
|
|
|
93
93
|
const qs = form_id !== undefined ? `?form_id=${form_id}` : "";
|
|
94
94
|
return text(await client.get(`/forms/tracking-codes/${qs}`));
|
|
95
95
|
});
|
|
96
|
-
server.tool("forms_tracking_codes_create", `Creates a tracking code (URL slug) for a form. One form → many tracking codes. Each code typically corresponds to a video/reel/channel so attribution is separate.
|
|
97
|
-
|
|
98
|
-
If 'code' is omitted, an 8-char random slug is generated. If a provided code clashes, the backend auto-falls-back to random.
|
|
99
|
-
|
|
96
|
+
server.tool("forms_tracking_codes_create", `Creates a tracking code (URL slug) for a form. One form → many tracking codes. Each code typically corresponds to a video/reel/channel so attribution is separate.
|
|
97
|
+
|
|
98
|
+
If 'code' is omitted, an 8-char random slug is generated. If a provided code clashes, the backend auto-falls-back to random.
|
|
99
|
+
|
|
100
100
|
Bind to a video by setting tracked_media_id (use tracked_media_list to find it). The UTMs are bake-in: they get attached to the submission and to /r/{code} redirects.`, {
|
|
101
101
|
form_id: z.number().int(),
|
|
102
102
|
code: z.string().optional().describe("Readable slug like 'oferta-enero' OR omit for autogenerated."),
|
package/dist/tools/nurturing.js
CHANGED
|
@@ -66,13 +66,13 @@ export function registerNurturingTools(server, client) {
|
|
|
66
66
|
}));
|
|
67
67
|
// ───── CRUD ─────
|
|
68
68
|
server.tool("nurturing_flows_list", "List all nurturing/hydration flows for this ecommerce. Each flow shows lead_stage, hours_trigger, action and activation guardrails.", {}, async () => text(await client.get("/hydration/")));
|
|
69
|
-
server.tool("nurturing_flow_create", `Create a nurturing flow. Required: name, lead_stage (the CRM status to watch), hours_trigger (hours since last_message), action.
|
|
70
|
-
|
|
71
|
-
action MUST be one of:
|
|
72
|
-
- {"send_message": "texto"} — only when hours_trigger < 24 (WhatsApp 24h window)
|
|
73
|
-
- {"send_template": "template_name"} — preferred for >= 24h (HSM)
|
|
74
|
-
- {"run_agent": {"channel":"whatsapp","extra_context":"..."}} — hand off to the AI agent
|
|
75
|
-
|
|
69
|
+
server.tool("nurturing_flow_create", `Create a nurturing flow. Required: name, lead_stage (the CRM status to watch), hours_trigger (hours since last_message), action.
|
|
70
|
+
|
|
71
|
+
action MUST be one of:
|
|
72
|
+
- {"send_message": "texto"} — only when hours_trigger < 24 (WhatsApp 24h window)
|
|
73
|
+
- {"send_template": "template_name"} — preferred for >= 24h (HSM)
|
|
74
|
+
- {"run_agent": {"channel":"whatsapp","extra_context":"..."}} — hand off to the AI agent
|
|
75
|
+
|
|
76
76
|
Use max_activations + max_activations_window_days to avoid spamming the same lead.`, {
|
|
77
77
|
name: z.string().describe("Friendly name for the flow."),
|
|
78
78
|
lead_stage: z.string().describe("CRM status the flow watches (cold, warm, hot, sold, custom...)."),
|
package/dist/tools/webhooks.js
CHANGED
|
@@ -53,8 +53,8 @@ export function registerWebhooksTools(server, client) {
|
|
|
53
53
|
// ───── CRUD ─────
|
|
54
54
|
server.tool("webhooks_list", "List all webhook endpoints configured for this ecommerce. Returns id, name, event_type, flow_id (if linked), is_active, api_key_preview (last 4 chars only — full key is shown only on create/rotate).", {}, async () => text(await client.get("/webhooks/")));
|
|
55
55
|
server.tool("webhooks_get", "Get full configuration of a single webhook endpoint by id (does NOT return the api_key — use rotate to get a fresh one).", { webhook_id: z.number().int().describe("Webhook endpoint id.") }, async ({ webhook_id }) => text(await client.get(`/webhooks/${webhook_id}`)));
|
|
56
|
-
server.tool("webhooks_create", `Create a new webhook endpoint. Returns the FULL api_key (mk_wh_...) — it's only shown once, save it to the external system that will call this webhook.
|
|
57
|
-
|
|
56
|
+
server.tool("webhooks_create", `Create a new webhook endpoint. Returns the FULL api_key (mk_wh_...) — it's only shown once, save it to the external system that will call this webhook.
|
|
57
|
+
|
|
58
58
|
event_type must be one of: ${EVENT_TYPES.join(", ")}. Use webhooks_get_catalog for the available_fields per event.`, {
|
|
59
59
|
name: z.string().describe("Friendly name (e.g. 'Form contacto desde landing')."),
|
|
60
60
|
event_type: z.enum(EVENT_TYPES).describe("Event type — see webhooks_get_catalog for behavior + fields."),
|
package/package.json
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
3
|
-
import { join, resolve } from 'path';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
import { dirname } from 'path';
|
|
6
|
-
|
|
7
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
|
|
9
|
-
const AVAILABLE_SKILLS = {
|
|
10
|
-
'prompt-creation': {
|
|
11
|
-
file: join(__dirname, '..', 'skills', 'prompt-creation.md'),
|
|
12
|
-
description: 'Experto en crear prompts de agentes de ventas para WhatsApp e Instagram',
|
|
13
|
-
},
|
|
14
|
-
'flows-creation': {
|
|
15
|
-
file: join(__dirname, '..', 'skills', 'flows-creation.md'),
|
|
16
|
-
description: 'Experto en diseñar flows de automatización (post-venta, pautas, notificaciones, chatbots)',
|
|
17
|
-
},
|
|
18
|
-
'nurturing-creation': {
|
|
19
|
-
file: join(__dirname, '..', 'skills', 'nurturing-creation.md'),
|
|
20
|
-
description: 'Experto en hidratación de leads (secuencias multi-touch por stage del CRM)',
|
|
21
|
-
},
|
|
22
|
-
'templates-creation': {
|
|
23
|
-
file: join(__dirname, '..', 'skills', 'templates-creation.md'),
|
|
24
|
-
description: 'Experto en plantillas WhatsApp (HSM) avanzadas con headers media y botones',
|
|
25
|
-
},
|
|
26
|
-
'forms-creation': {
|
|
27
|
-
file: join(__dirname, '..', 'skills', 'forms-creation.md'),
|
|
28
|
-
description: 'Experto en forms dinámicos (mergeon.dev/form/{code}), tracking codes y atribución a video',
|
|
29
|
-
},
|
|
30
|
-
'social-tracking': {
|
|
31
|
-
file: join(__dirname, '..', 'skills', 'social-tracking.md'),
|
|
32
|
-
description: 'Experto en tracking de reels/posts de Instagram: funnel por video y flows ig_comment segmentados',
|
|
33
|
-
},
|
|
34
|
-
'webhooks-usage': {
|
|
35
|
-
file: join(__dirname, '..', 'skills', 'webhooks-usage.md'),
|
|
36
|
-
description: 'Experto en webhooks entrantes: integrar forms, pasarelas y CRMs externos',
|
|
37
|
-
},
|
|
38
|
-
'sales-analysis': {
|
|
39
|
-
file: join(__dirname, '..', 'skills', 'sales-analysis.md'),
|
|
40
|
-
description: 'Analista de ventas: revenue, comparativas, top productos, atribución a pauta',
|
|
41
|
-
},
|
|
42
|
-
'meta-events-debug': {
|
|
43
|
-
file: join(__dirname, '..', 'skills', 'meta-events-debug.md'),
|
|
44
|
-
description: 'Auditoría end-to-end de eventos a Meta CAPI y backfill de pendientes',
|
|
45
|
-
},
|
|
46
|
-
'reviews-usage': {
|
|
47
|
-
file: join(__dirname, '..', 'skills', 'reviews-usage.md'),
|
|
48
|
-
description: 'Subir reseñas/testimonios reales con foto vía media_upload + reviews_create',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const args = process.argv.slice(2);
|
|
53
|
-
const command = args[0];
|
|
54
|
-
const skillName = args[1];
|
|
55
|
-
|
|
56
|
-
function getClaudeMdPath() {
|
|
57
|
-
return resolve(process.cwd(), 'CLAUDE.md');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function ensureClaudeMd(path) {
|
|
61
|
-
if (!existsSync(path)) {
|
|
62
|
-
writeFileSync(path, '# CLAUDE.md\n\n', 'utf8');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function skillAlreadyInstalled(content, marker) {
|
|
67
|
-
return content.includes(marker);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Instala un skill en CLAUDE.md. Devuelve 'installed' | 'already' | 'unknown'.
|
|
71
|
-
function installSkill(name, claudeMdPath) {
|
|
72
|
-
const skill = AVAILABLE_SKILLS[name];
|
|
73
|
-
if (!skill) return 'unknown';
|
|
74
|
-
|
|
75
|
-
const marker = `<!-- mergeon-skill:${name} -->`;
|
|
76
|
-
const current = readFileSync(claudeMdPath, 'utf8');
|
|
77
|
-
|
|
78
|
-
if (skillAlreadyInstalled(current, marker)) return 'already';
|
|
79
|
-
|
|
80
|
-
const skillContent = readFileSync(skill.file, 'utf8');
|
|
81
|
-
const toAppend = `\n\n${marker}\n${skillContent}\n${marker}:end\n`;
|
|
82
|
-
writeFileSync(claudeMdPath, current + toAppend, 'utf8');
|
|
83
|
-
return 'installed';
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (command === 'add') {
|
|
87
|
-
const claudeMdPath = getClaudeMdPath();
|
|
88
|
-
ensureClaudeMd(claudeMdPath);
|
|
89
|
-
|
|
90
|
-
// `add all` → instala todos los skills disponibles de una vez.
|
|
91
|
-
if (skillName === 'all' || skillName === '*') {
|
|
92
|
-
let installed = 0;
|
|
93
|
-
let already = 0;
|
|
94
|
-
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
95
|
-
const result = installSkill(name, claudeMdPath);
|
|
96
|
-
if (result === 'installed') {
|
|
97
|
-
installed++;
|
|
98
|
-
console.log(`✅ ${name} — ${info.description}`);
|
|
99
|
-
} else if (result === 'already') {
|
|
100
|
-
already++;
|
|
101
|
-
console.log(`↷ ${name} (ya estaba instalado)`);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
console.log(`\n${installed} skill(s) instalado(s), ${already} ya presente(s). Total: ${Object.keys(AVAILABLE_SKILLS).length}.`);
|
|
105
|
-
process.exit(0);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (!skillName || !AVAILABLE_SKILLS[skillName]) {
|
|
109
|
-
console.error(`❌ Skill desconocido: "${skillName}"`);
|
|
110
|
-
console.log('\nSkills disponibles:');
|
|
111
|
-
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
112
|
-
console.log(` ${name} — ${info.description}`);
|
|
113
|
-
});
|
|
114
|
-
console.log('\nInstalar todos: npx mergeon-mcp skills add all');
|
|
115
|
-
process.exit(1);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const result = installSkill(skillName, claudeMdPath);
|
|
119
|
-
if (result === 'already') {
|
|
120
|
-
console.log(`✅ El skill "${skillName}" ya está instalado en CLAUDE.md`);
|
|
121
|
-
process.exit(0);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
console.log(`✅ Skill "${skillName}" instalado en CLAUDE.md`);
|
|
125
|
-
console.log(` ${AVAILABLE_SKILLS[skillName].description}`);
|
|
126
|
-
|
|
127
|
-
} else if (command === 'list') {
|
|
128
|
-
console.log('\nSkills disponibles de mergeon-mcp:\n');
|
|
129
|
-
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
130
|
-
console.log(` 📦 ${name}`);
|
|
131
|
-
console.log(` ${info.description}\n`);
|
|
132
|
-
});
|
|
133
|
-
console.log('Instalar uno: npx mergeon-mcp skills add <nombre-del-skill>');
|
|
134
|
-
console.log('Instalar todos: npx mergeon-mcp skills add all\n');
|
|
135
|
-
|
|
136
|
-
} else {
|
|
137
|
-
console.log(`
|
|
138
|
-
mergeon-mcp skills
|
|
139
|
-
|
|
140
|
-
Comandos:
|
|
141
|
-
add <skill> Instala un skill en tu CLAUDE.md
|
|
142
|
-
add all Instala TODOS los skills disponibles de una vez
|
|
143
|
-
list Lista todos los skills disponibles
|
|
144
|
-
|
|
145
|
-
Ejemplo:
|
|
146
|
-
npx mergeon-mcp skills add prompt-creation
|
|
147
|
-
npx mergeon-mcp skills add all
|
|
148
|
-
`);
|
|
149
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
3
|
+
import { join, resolve } from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname } from 'path';
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
9
|
+
const AVAILABLE_SKILLS = {
|
|
10
|
+
'prompt-creation': {
|
|
11
|
+
file: join(__dirname, '..', 'skills', 'prompt-creation.md'),
|
|
12
|
+
description: 'Experto en crear prompts de agentes de ventas para WhatsApp e Instagram',
|
|
13
|
+
},
|
|
14
|
+
'flows-creation': {
|
|
15
|
+
file: join(__dirname, '..', 'skills', 'flows-creation.md'),
|
|
16
|
+
description: 'Experto en diseñar flows de automatización (post-venta, pautas, notificaciones, chatbots)',
|
|
17
|
+
},
|
|
18
|
+
'nurturing-creation': {
|
|
19
|
+
file: join(__dirname, '..', 'skills', 'nurturing-creation.md'),
|
|
20
|
+
description: 'Experto en hidratación de leads (secuencias multi-touch por stage del CRM)',
|
|
21
|
+
},
|
|
22
|
+
'templates-creation': {
|
|
23
|
+
file: join(__dirname, '..', 'skills', 'templates-creation.md'),
|
|
24
|
+
description: 'Experto en plantillas WhatsApp (HSM) avanzadas con headers media y botones',
|
|
25
|
+
},
|
|
26
|
+
'forms-creation': {
|
|
27
|
+
file: join(__dirname, '..', 'skills', 'forms-creation.md'),
|
|
28
|
+
description: 'Experto en forms dinámicos (mergeon.dev/form/{code}), tracking codes y atribución a video',
|
|
29
|
+
},
|
|
30
|
+
'social-tracking': {
|
|
31
|
+
file: join(__dirname, '..', 'skills', 'social-tracking.md'),
|
|
32
|
+
description: 'Experto en tracking de reels/posts de Instagram: funnel por video y flows ig_comment segmentados',
|
|
33
|
+
},
|
|
34
|
+
'webhooks-usage': {
|
|
35
|
+
file: join(__dirname, '..', 'skills', 'webhooks-usage.md'),
|
|
36
|
+
description: 'Experto en webhooks entrantes: integrar forms, pasarelas y CRMs externos',
|
|
37
|
+
},
|
|
38
|
+
'sales-analysis': {
|
|
39
|
+
file: join(__dirname, '..', 'skills', 'sales-analysis.md'),
|
|
40
|
+
description: 'Analista de ventas: revenue, comparativas, top productos, atribución a pauta',
|
|
41
|
+
},
|
|
42
|
+
'meta-events-debug': {
|
|
43
|
+
file: join(__dirname, '..', 'skills', 'meta-events-debug.md'),
|
|
44
|
+
description: 'Auditoría end-to-end de eventos a Meta CAPI y backfill de pendientes',
|
|
45
|
+
},
|
|
46
|
+
'reviews-usage': {
|
|
47
|
+
file: join(__dirname, '..', 'skills', 'reviews-usage.md'),
|
|
48
|
+
description: 'Subir reseñas/testimonios reales con foto vía media_upload + reviews_create',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const args = process.argv.slice(2);
|
|
53
|
+
const command = args[0];
|
|
54
|
+
const skillName = args[1];
|
|
55
|
+
|
|
56
|
+
function getClaudeMdPath() {
|
|
57
|
+
return resolve(process.cwd(), 'CLAUDE.md');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function ensureClaudeMd(path) {
|
|
61
|
+
if (!existsSync(path)) {
|
|
62
|
+
writeFileSync(path, '# CLAUDE.md\n\n', 'utf8');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function skillAlreadyInstalled(content, marker) {
|
|
67
|
+
return content.includes(marker);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Instala un skill en CLAUDE.md. Devuelve 'installed' | 'already' | 'unknown'.
|
|
71
|
+
function installSkill(name, claudeMdPath) {
|
|
72
|
+
const skill = AVAILABLE_SKILLS[name];
|
|
73
|
+
if (!skill) return 'unknown';
|
|
74
|
+
|
|
75
|
+
const marker = `<!-- mergeon-skill:${name} -->`;
|
|
76
|
+
const current = readFileSync(claudeMdPath, 'utf8');
|
|
77
|
+
|
|
78
|
+
if (skillAlreadyInstalled(current, marker)) return 'already';
|
|
79
|
+
|
|
80
|
+
const skillContent = readFileSync(skill.file, 'utf8');
|
|
81
|
+
const toAppend = `\n\n${marker}\n${skillContent}\n${marker}:end\n`;
|
|
82
|
+
writeFileSync(claudeMdPath, current + toAppend, 'utf8');
|
|
83
|
+
return 'installed';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (command === 'add') {
|
|
87
|
+
const claudeMdPath = getClaudeMdPath();
|
|
88
|
+
ensureClaudeMd(claudeMdPath);
|
|
89
|
+
|
|
90
|
+
// `add all` → instala todos los skills disponibles de una vez.
|
|
91
|
+
if (skillName === 'all' || skillName === '*') {
|
|
92
|
+
let installed = 0;
|
|
93
|
+
let already = 0;
|
|
94
|
+
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
95
|
+
const result = installSkill(name, claudeMdPath);
|
|
96
|
+
if (result === 'installed') {
|
|
97
|
+
installed++;
|
|
98
|
+
console.log(`✅ ${name} — ${info.description}`);
|
|
99
|
+
} else if (result === 'already') {
|
|
100
|
+
already++;
|
|
101
|
+
console.log(`↷ ${name} (ya estaba instalado)`);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
console.log(`\n${installed} skill(s) instalado(s), ${already} ya presente(s). Total: ${Object.keys(AVAILABLE_SKILLS).length}.`);
|
|
105
|
+
process.exit(0);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!skillName || !AVAILABLE_SKILLS[skillName]) {
|
|
109
|
+
console.error(`❌ Skill desconocido: "${skillName}"`);
|
|
110
|
+
console.log('\nSkills disponibles:');
|
|
111
|
+
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
112
|
+
console.log(` ${name} — ${info.description}`);
|
|
113
|
+
});
|
|
114
|
+
console.log('\nInstalar todos: npx mergeon-mcp skills add all');
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const result = installSkill(skillName, claudeMdPath);
|
|
119
|
+
if (result === 'already') {
|
|
120
|
+
console.log(`✅ El skill "${skillName}" ya está instalado en CLAUDE.md`);
|
|
121
|
+
process.exit(0);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
console.log(`✅ Skill "${skillName}" instalado en CLAUDE.md`);
|
|
125
|
+
console.log(` ${AVAILABLE_SKILLS[skillName].description}`);
|
|
126
|
+
|
|
127
|
+
} else if (command === 'list') {
|
|
128
|
+
console.log('\nSkills disponibles de mergeon-mcp:\n');
|
|
129
|
+
Object.entries(AVAILABLE_SKILLS).forEach(([name, info]) => {
|
|
130
|
+
console.log(` 📦 ${name}`);
|
|
131
|
+
console.log(` ${info.description}\n`);
|
|
132
|
+
});
|
|
133
|
+
console.log('Instalar uno: npx mergeon-mcp skills add <nombre-del-skill>');
|
|
134
|
+
console.log('Instalar todos: npx mergeon-mcp skills add all\n');
|
|
135
|
+
|
|
136
|
+
} else {
|
|
137
|
+
console.log(`
|
|
138
|
+
mergeon-mcp skills
|
|
139
|
+
|
|
140
|
+
Comandos:
|
|
141
|
+
add <skill> Instala un skill en tu CLAUDE.md
|
|
142
|
+
add all Instala TODOS los skills disponibles de una vez
|
|
143
|
+
list Lista todos los skills disponibles
|
|
144
|
+
|
|
145
|
+
Ejemplo:
|
|
146
|
+
npx mergeon-mcp skills add prompt-creation
|
|
147
|
+
npx mergeon-mcp skills add all
|
|
148
|
+
`);
|
|
149
|
+
}
|