verbo-mcp-server 0.1.0 → 0.1.2

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 CHANGED
@@ -1,4 +1,4 @@
1
- # @verbo/mcp-server
1
+ # verbo-mcp-server
2
2
 
3
3
  AI-powered WhatsApp agent for developers. Set up your agent, connect WhatsApp, send messages, and manage conversations — all from Claude Code, Cursor, or any MCP client.
4
4
 
@@ -8,43 +8,18 @@ AI-powered WhatsApp agent for developers. Set up your agent, connect WhatsApp, s
8
8
 
9
9
  Sign up at [verbolab.co/developers](https://verbolab.co/developers) and create an API key.
10
10
 
11
- ### 2. Configure your MCP client
12
-
13
- **Claude Code / Cursor** — add to `.mcp.json`:
14
-
15
- ```json
16
- {
17
- "mcpServers": {
18
- "verbo": {
19
- "command": "npx",
20
- "args": ["@verbo/mcp-server"],
21
- "env": {
22
- "VERBO_API_KEY": "vb_live_..."
23
- }
24
- }
25
- }
26
- }
27
- ```
28
-
29
- ### 3. Set up your agent
30
-
31
- Just tell your AI assistant what you want. Example conversation:
11
+ ### 2. Install
32
12
 
13
+ ```bash
14
+ claude mcp add verbo -e VERBO_API_KEY=vb_live_... -- npx verbo-mcp-server
33
15
  ```
34
- You: "Set up a Verbo agent for meusite.com.br"
35
- → Crawls your site, extracts business info, FAQ, tone of voice
36
-
37
- You: "Connect WhatsApp"
38
- → Creates instance, gives you a URL to scan the QR code
39
16
 
40
- You: "What's the setup status?"
41
- → Shows checklist: account ✅, config ✅, whatsapp ✅, agent ✅
17
+ ### 3. Use it
42
18
 
43
- You: "Send a test message to +5511999999999: Oi, tudo bem?"
44
- → Delivers via WhatsApp
19
+ Open Claude Code and ask:
45
20
 
46
- You: "Disconnect WhatsApp"
47
- Frees your number immediately
21
+ ```
22
+ Set up a Verbo agent for meusite.com.br, connect WhatsApp, and send a test message to +5511999999999
48
23
  ```
49
24
 
50
25
  ## Available Tools
@@ -93,14 +68,6 @@ curl -X POST https://verbolab.co/api/v1/messages \
93
68
  -H "Content-Type: application/json" \
94
69
  -d '{"to": "+5511999999999", "message": "Hello!"}'
95
70
 
96
- # List conversations
97
- curl https://verbolab.co/api/v1/conversations \
98
- -H "Authorization: Bearer vb_live_..."
99
-
100
- # Agent status
101
- curl https://verbolab.co/api/v1/agent/status \
102
- -H "Authorization: Bearer vb_live_..."
103
-
104
71
  # Disconnect WhatsApp
105
72
  curl -X POST https://verbolab.co/api/v1/setup/disconnect \
106
73
  -H "Authorization: Bearer vb_live_..."
package/dist/client.js CHANGED
@@ -11,17 +11,39 @@ class VerboClient {
11
11
  }
12
12
  async request(path, options = {}) {
13
13
  const url = `${this.baseUrl}/api/v1${path}`;
14
- const res = await fetch(url, {
15
- ...options,
16
- headers: {
17
- "Authorization": `Bearer ${this.apiKey}`,
18
- "Content-Type": "application/json",
19
- ...options.headers,
20
- },
21
- });
22
- const data = await res.json();
14
+ let res;
15
+ try {
16
+ res = await fetch(url, {
17
+ ...options,
18
+ headers: {
19
+ "Authorization": `Bearer ${this.apiKey}`,
20
+ "Content-Type": "application/json",
21
+ ...options.headers,
22
+ },
23
+ });
24
+ }
25
+ catch (err) {
26
+ throw new Error(`Could not connect to Verbo API at ${this.baseUrl}. Check your internet connection or VERBO_API_URL setting.`);
27
+ }
28
+ let data;
29
+ try {
30
+ data = await res.json();
31
+ }
32
+ catch {
33
+ throw new Error(`Verbo API returned invalid response (HTTP ${res.status}). The server may be temporarily unavailable — try again in a moment.`);
34
+ }
23
35
  if (!res.ok) {
24
- throw new Error(`Verbo API error (${res.status}): ${data.error || "Unknown error"}`);
36
+ const errorMsg = data.error || "Unknown error";
37
+ if (res.status === 401) {
38
+ throw new Error(`API key is invalid or revoked. Create a new key at ${this.baseUrl}/developers`);
39
+ }
40
+ if (res.status === 403) {
41
+ throw new Error(`Subscription expired or inactive. Upgrade at ${this.baseUrl}/settings/billing — ${errorMsg}`);
42
+ }
43
+ if (res.status === 429) {
44
+ throw new Error(`Rate limit exceeded. ${errorMsg}`);
45
+ }
46
+ throw new Error(`Verbo API error (${res.status}): ${errorMsg}`);
25
47
  }
26
48
  return data;
27
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;AAEpC,MAAa,WAAW;IACd,OAAO,CAAS;IAChB,MAAM,CAAS;IAEvB,YAAY,MAAc,EAAE,OAAgB;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,CAAC,OAAO,IAAI,qBAAqB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACvE,CAAC;IAEO,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,UAAuB,EAAE;QAC3D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,UAAU,IAAI,EAAE,CAAC;QAC5C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC3B,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;gBACxC,cAAc,EAAE,kBAAkB;gBAClC,GAAG,OAAO,CAAC,OAAO;aACnB;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,oBAAoB,GAAG,CAAC,MAAM,MAAO,IAA2B,CAAC,KAAK,IAAI,eAAe,EAAE,CAC5F,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,QAAiB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;YAC/B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE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KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE;YACvC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;SACzB,CAAC,CAAC;IACL,CAAC;CACF;AApHD,kCAoHC"}
package/dist/index.js CHANGED
@@ -17,6 +17,26 @@ const client = new client_js_1.VerboClient(apiKey, baseUrl);
17
17
  const server = new mcp_js_1.McpServer({
18
18
  name: "Verbo",
19
19
  version: "0.1.0",
20
+ }, {
21
+ instructions: `Verbo is an AI-powered WhatsApp customer service agent. You plug it into your product and it handles customer conversations automatically — answers questions, classifies intent, escalates complaints, follows up.
22
+
23
+ ## Setup workflow (run in order):
24
+ 1. verbo_setup_crawl — Crawl the business website to auto-extract name, products, FAQ, hours, tone. This configures the agent.
25
+ 2. verbo_setup_connect — Creates a WhatsApp instance. Returns a URL to scan a QR code in the browser.
26
+ 3. verbo_setup_status — Check if all steps are done. Shows what's missing.
27
+
28
+ ## After setup:
29
+ - verbo_send_message — Send a WhatsApp message to any number
30
+ - verbo_list_conversations — See recent customer conversations
31
+ - verbo_get_conversation — Read messages in a specific conversation
32
+ - verbo_agent_status — Check WhatsApp connection and business config
33
+ - verbo_configure_agent — Update greeting, FAQ, or business hours
34
+ - verbo_setup_disconnect — Disconnect WhatsApp when done
35
+
36
+ ## Important:
37
+ - Do NOT search the web for information about Verbo. Everything you need is in these tools.
38
+ - The crawl step takes 15-30 seconds. This is normal — it fetches multiple pages and uses AI extraction.
39
+ - After connecting WhatsApp, the agent starts responding to incoming messages automatically.`,
20
40
  });
21
41
  for (const [name, tool] of Object.entries(tools_js_1.toolDefinitions)) {
22
42
  server.tool(name, tool.description, tool.schema, async (args) => {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceR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AAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -2,13 +2,13 @@ import { z } from "zod";
2
2
  import { type VerboClient } from "./client.js";
3
3
  export declare const setupToolDefinitions: {
4
4
  readonly verbo_setup_crawl: {
5
- readonly description: "Crawl a website to auto-configure the AI agent. Extracts business name, description, products, FAQ, hours, and tone of voice. Run this first after creating your account.";
5
+ readonly description: "Crawl a website to auto-configure the AI agent. Extracts business name, description, products, FAQ, hours, and tone of voice. Run this first after creating your account. Rate limited to 5 calls per 10 minutes.";
6
6
  readonly schema: {
7
7
  readonly url: z.ZodString;
8
8
  };
9
9
  };
10
10
  readonly verbo_setup_connect: {
11
- readonly description: "Start WhatsApp connection. Creates the WhatsApp instance and returns a URL where the developer can scan the QR code in their browser. After scanning, the AI agent starts handling messages automatically.";
11
+ readonly description: "Start WhatsApp connection. Creates the WhatsApp instance and returns a URL where the developer can scan the QR code in their browser. After scanning, the AI agent starts handling messages automatically. Each phone number can only be connected to one business at a time.";
12
12
  readonly schema: {};
13
13
  };
14
14
  readonly verbo_setup_status: {
@@ -6,13 +6,13 @@ exports.executeSetupTool = executeSetupTool;
6
6
  const zod_1 = require("zod");
7
7
  exports.setupToolDefinitions = {
8
8
  verbo_setup_crawl: {
9
- description: "Crawl a website to auto-configure the AI agent. Extracts business name, description, products, FAQ, hours, and tone of voice. Run this first after creating your account.",
9
+ description: "Crawl a website to auto-configure the AI agent. Extracts business name, description, products, FAQ, hours, and tone of voice. Run this first after creating your account. Rate limited to 5 calls per 10 minutes.",
10
10
  schema: {
11
11
  url: zod_1.z.string().describe("Website URL (e.g. meuemprego.com.br)"),
12
12
  },
13
13
  },
14
14
  verbo_setup_connect: {
15
- description: "Start WhatsApp connection. Creates the WhatsApp instance and returns a URL where the developer can scan the QR code in their browser. After scanning, the AI agent starts handling messages automatically.",
15
+ description: "Start WhatsApp connection. Creates the WhatsApp instance and returns a URL where the developer can scan the QR code in their browser. After scanning, the AI agent starts handling messages automatically. Each phone number can only be connected to one business at a time.",
16
16
  schema: {},
17
17
  },
18
18
  verbo_setup_status: {
@@ -28,19 +28,31 @@ async function executeSetupTool(client, name, args) {
28
28
  switch (name) {
29
29
  case "verbo_setup_crawl": {
30
30
  const result = await client.setupCrawl(args.url);
31
- return JSON.stringify(result, null, 2);
31
+ return JSON.stringify(result, null, 2) +
32
+ "\n\n→ Business configured from website. Next: run verbo_setup_connect to connect WhatsApp.";
32
33
  }
33
34
  case "verbo_setup_connect": {
34
35
  const result = await client.setupConnect();
35
- return JSON.stringify(result, null, 2);
36
+ const data = result;
37
+ const connectUrl = data.connectUrl || "";
38
+ return JSON.stringify(result, null, 2) +
39
+ `\n\n→ WhatsApp instance created. IMPORTANT: Tell the user to open ${connectUrl} in their browser and scan the QR code with their phone. After scanning, run verbo_setup_status to confirm the connection.`;
36
40
  }
37
41
  case "verbo_setup_status": {
38
42
  const result = await client.setupStatus();
39
- return JSON.stringify(result, null, 2);
43
+ const data = result;
44
+ const ready = data.ready;
45
+ if (ready) {
46
+ return JSON.stringify(result, null, 2) +
47
+ "\n\n→ All set! The AI agent is live and will respond to incoming WhatsApp messages automatically. Use verbo_send_message to send a test message.";
48
+ }
49
+ return JSON.stringify(result, null, 2) +
50
+ "\n\n→ Setup incomplete. Check the steps above and run the missing ones.";
40
51
  }
41
52
  case "verbo_setup_disconnect": {
42
53
  const result = await client.setupDisconnect();
43
- return JSON.stringify(result, null, 2);
54
+ return JSON.stringify(result, null, 2) +
55
+ "\n\n→ WhatsApp disconnected. The phone number is free to use elsewhere.";
44
56
  }
45
57
  default:
46
58
  return JSON.stringify({ error: `Unknown setup tool: ${name}` });
@@ -1 +1 @@
1
- {"version":3,"file":"setup-tools.js","sourceRoot":"","sources":["../src/setup-tools.ts"],"names":[],"mappings":";;;AA+BA,4CAyBC;AAxDD,yCAAyC;AACzC,6BAAwB;AAGX,QAAA,oBAAoB,GA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SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,qEAAqE,UAAU,4HAA4H,CAAC;QAChN,CAAC;QACD,KAAK,oBAAoB,CAAC,CAAC,CAAC;YAC1B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;YAC1C,MAAM,IAAI,GAAG,MAAiC,CAAC;YAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;oBACpC,kJAAkJ,CAAC;YACvJ,CAAC;YACD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,yEAAyE,CAAC;QAC9E,CAAC;QACD,KAAK,wBAAwB,CAAC,CAAC,CAAC;YAC9B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,CAAC;YAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,yEAAyE,CAAC;QAC9E,CAAC;QACD;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,uBAAuB,IAAI,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
package/dist/tools.d.ts CHANGED
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { type VerboClient } from "./client.js";
3
3
  export declare const toolDefinitions: {
4
4
  readonly verbo_send_message: {
5
- readonly description: "Enviar mensagem WhatsApp para um número. Suporta texto e imagem.";
5
+ readonly description: "Send a WhatsApp message to a phone number. Supports text and images.";
6
6
  readonly schema: {
7
7
  readonly to: z.ZodString;
8
8
  readonly message: z.ZodString;
@@ -10,7 +10,7 @@ export declare const toolDefinitions: {
10
10
  };
11
11
  };
12
12
  readonly verbo_list_conversations: {
13
- readonly description: "Listar conversas recentes. Filtrável por status (open/closed).";
13
+ readonly description: "List recent conversations. Filterable by status (open/closed).";
14
14
  readonly schema: {
15
15
  readonly status: z.ZodOptional<z.ZodEnum<{
16
16
  open: "open";
@@ -20,17 +20,17 @@ export declare const toolDefinitions: {
20
20
  };
21
21
  };
22
22
  readonly verbo_get_conversation: {
23
- readonly description: "Ver detalhes e mensagens de uma conversa específica.";
23
+ readonly description: "Get details and messages from a specific conversation.";
24
24
  readonly schema: {
25
25
  readonly conversation_id: z.ZodString;
26
26
  };
27
27
  };
28
28
  readonly verbo_agent_status: {
29
- readonly description: "Verificar status do agente: conexão WhatsApp, negócio configurado, etc.";
29
+ readonly description: "Check agent status: WhatsApp connection, business configuration, etc.";
30
30
  readonly schema: {};
31
31
  };
32
32
  readonly verbo_configure_agent: {
33
- readonly description: "Configurar o comportamento do agente de atendimento. Define greeting, FAQ, horário.";
33
+ readonly description: "Configure the AI agent behavior. Set greeting message, FAQ, and business hours.";
34
34
  readonly schema: {
35
35
  readonly greeting_message: z.ZodOptional<z.ZodString>;
36
36
  readonly faq: z.ZodOptional<z.ZodArray<z.ZodObject<{
package/dist/tools.js CHANGED
@@ -6,59 +6,59 @@ exports.executeTool = executeTool;
6
6
  const zod_1 = require("zod");
7
7
  exports.toolDefinitions = {
8
8
  verbo_send_message: {
9
- description: "Enviar mensagem WhatsApp para um número. Suporta texto e imagem.",
9
+ description: "Send a WhatsApp message to a phone number. Supports text and images.",
10
10
  schema: {
11
11
  to: zod_1.z
12
12
  .string()
13
- .describe("Número de telefone (ex: +5511999999999)"),
14
- message: zod_1.z.string().describe("Texto da mensagem"),
13
+ .describe("Phone number (e.g. +5511999999999)"),
14
+ message: zod_1.z.string().describe("Message text"),
15
15
  image_url: zod_1.z
16
16
  .string()
17
17
  .optional()
18
- .describe("URL da imagem (opcional)"),
18
+ .describe("Image URL (optional)"),
19
19
  },
20
20
  },
21
21
  verbo_list_conversations: {
22
- description: "Listar conversas recentes. Filtrável por status (open/closed).",
22
+ description: "List recent conversations. Filterable by status (open/closed).",
23
23
  schema: {
24
24
  status: zod_1.z
25
25
  .enum(["open", "closed"])
26
26
  .optional()
27
- .describe("Filtrar por status"),
27
+ .describe("Filter by status"),
28
28
  limit: zod_1.z
29
29
  .number()
30
30
  .optional()
31
- .describe("Máximo de resultados (1-100, default 20)"),
31
+ .describe("Max results (1-100, default 20)"),
32
32
  },
33
33
  },
34
34
  verbo_get_conversation: {
35
- description: "Ver detalhes e mensagens de uma conversa específica.",
35
+ description: "Get details and messages from a specific conversation.",
36
36
  schema: {
37
- conversation_id: zod_1.z.string().describe("ID da conversa"),
37
+ conversation_id: zod_1.z.string().describe("Conversation ID"),
38
38
  },
39
39
  },
40
40
  verbo_agent_status: {
41
- description: "Verificar status do agente: conexão WhatsApp, negócio configurado, etc.",
41
+ description: "Check agent status: WhatsApp connection, business configuration, etc.",
42
42
  schema: {},
43
43
  },
44
44
  verbo_configure_agent: {
45
- description: "Configurar o comportamento do agente de atendimento. Define greeting, FAQ, horário.",
45
+ description: "Configure the AI agent behavior. Set greeting message, FAQ, and business hours.",
46
46
  schema: {
47
47
  greeting_message: zod_1.z
48
48
  .string()
49
49
  .optional()
50
- .describe("Mensagem de saudação para novos clientes"),
50
+ .describe("Greeting message for new customers"),
51
51
  faq: zod_1.z
52
52
  .array(zod_1.z.object({
53
53
  question: zod_1.z.string(),
54
54
  answer: zod_1.z.string(),
55
55
  }))
56
56
  .optional()
57
- .describe("Perguntas frequentes"),
57
+ .describe("Frequently asked questions"),
58
58
  business_hours: zod_1.z
59
59
  .record(zod_1.z.string(), zod_1.z.string())
60
60
  .optional()
61
- .describe("Horário de funcionamento (ex: { monday: '9:00-18:00' })"),
61
+ .describe("Business hours (e.g. { monday: '9:00-18:00' })"),
62
62
  },
63
63
  },
64
64
  };
@@ -66,14 +66,16 @@ async function executeTool(client, name, args) {
66
66
  switch (name) {
67
67
  case "verbo_send_message": {
68
68
  const result = await client.sendMessage(args.to, args.message, args.image_url);
69
- return JSON.stringify(result, null, 2);
69
+ return JSON.stringify(result, null, 2) +
70
+ "\n\n→ Message sent. Use verbo_list_conversations to see the conversation.";
70
71
  }
71
72
  case "verbo_list_conversations": {
72
73
  const result = await client.listConversations({
73
74
  status: args.status,
74
75
  limit: args.limit,
75
76
  });
76
- return JSON.stringify(result, null, 2);
77
+ return JSON.stringify(result, null, 2) +
78
+ "\n\n→ Use verbo_get_conversation with a conversation ID to see full messages.";
77
79
  }
78
80
  case "verbo_get_conversation": {
79
81
  const result = await client.getConversation(args.conversation_id);
@@ -89,7 +91,8 @@ async function executeTool(client, name, args) {
89
91
  faqData: args.faq,
90
92
  businessHours: args.business_hours,
91
93
  });
92
- return JSON.stringify(result, null, 2);
94
+ return JSON.stringify(result, null, 2) +
95
+ "\n\n→ Agent updated. Use verbo_setup_status to verify the full setup.";
93
96
  }
94
97
  default:
95
98
  return JSON.stringify({ error: `Unknown tool: ${name}` });
package/dist/tools.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";;;AA0EA,kCA4CC;AAtHD,mCAAmC;AACnC,6BAAwB;AAGX,QAAA,eAAe,GAAG;IAC7B,kBAAkB,EAAE;QAClB,WAAW,EACT,kEAAkE;QACpE,MAAM,EAAE;YACN,EAAE,EAAE,OAAC;iBACF,MAAM,EAAE;iBACR,QAAQ,CAAC,yCAAyC,CAAC;YACtD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YACjD,SAAS,EAAE,OAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,0BAA0B,CAAC;SACxC;KACF;IACD,wBAAwB,EAAE;QACxB,WAAW,EACT,gEAAgE;QAClE,MAAM,EAAE;YACN,MAAM,EAAE,OAAC;iBACN,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;iBACxB,QAAQ,EAAE;iBACV,QAAQ,CAAC,oB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CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC;QACD,KAAK,uBAAuB,CAAC,CAAC,CAAC;YAC7B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC;gBACzC,eAAe,EAAE,IAAI,CAAC,gBAAsC;gBAC5D,OAAO,EAAE,IAAI,CAAC,GAA2C;gBACzD,aAAa,EAAE,IAAI,CAAC,cAEP;aACd,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,uEAAuE,CAAC;QAC5E,CAAC;QACD;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,iBAAiB,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verbo-mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Verbo MCP Server — AI WhatsApp agent for developers",
5
5
  "bin": {
6
6
  "verbo-mcp": "./dist/index.js"
@@ -20,6 +20,12 @@
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
23
- "keywords": ["mcp", "whatsapp", "ai", "verbo", "claude"],
23
+ "keywords": [
24
+ "mcp",
25
+ "whatsapp",
26
+ "ai",
27
+ "verbo",
28
+ "claude"
29
+ ],
24
30
  "license": "MIT"
25
31
  }
package/src/client.ts CHANGED
@@ -11,21 +11,50 @@ export class VerboClient {
11
11
 
12
12
  private async request(path: string, options: RequestInit = {}): Promise<unknown> {
13
13
  const url = `${this.baseUrl}/api/v1${path}`;
14
- const res = await fetch(url, {
15
- ...options,
16
- headers: {
17
- "Authorization": `Bearer ${this.apiKey}`,
18
- "Content-Type": "application/json",
19
- ...options.headers,
20
- },
21
- });
14
+ let res: Response;
15
+ try {
16
+ res = await fetch(url, {
17
+ ...options,
18
+ headers: {
19
+ "Authorization": `Bearer ${this.apiKey}`,
20
+ "Content-Type": "application/json",
21
+ ...options.headers,
22
+ },
23
+ });
24
+ } catch (err) {
25
+ throw new Error(
26
+ `Could not connect to Verbo API at ${this.baseUrl}. Check your internet connection or VERBO_API_URL setting.`
27
+ );
28
+ }
22
29
 
23
- const data = await res.json();
24
- if (!res.ok) {
30
+ let data: unknown;
31
+ try {
32
+ data = await res.json();
33
+ } catch {
25
34
  throw new Error(
26
- `Verbo API error (${res.status}): ${(data as { error?: string }).error || "Unknown error"}`
35
+ `Verbo API returned invalid response (HTTP ${res.status}). The server may be temporarily unavailable try again in a moment.`
27
36
  );
28
37
  }
38
+
39
+ if (!res.ok) {
40
+ const errorMsg = (data as { error?: string }).error || "Unknown error";
41
+ if (res.status === 401) {
42
+ throw new Error(
43
+ `API key is invalid or revoked. Create a new key at ${this.baseUrl}/developers`
44
+ );
45
+ }
46
+ if (res.status === 403) {
47
+ throw new Error(
48
+ `Subscription expired or inactive. Upgrade at ${this.baseUrl}/settings/billing — ${errorMsg}`
49
+ );
50
+ }
51
+ if (res.status === 429) {
52
+ throw new Error(
53
+ `Rate limit exceeded. ${errorMsg}`
54
+ );
55
+ }
56
+ throw new Error(`Verbo API error (${res.status}): ${errorMsg}`);
57
+ }
29
58
  return data;
30
59
  }
31
60
 
package/src/index.ts CHANGED
@@ -15,10 +15,33 @@ if (!apiKey) {
15
15
  const baseUrl = process.env.VERBO_API_URL;
16
16
  const client = new VerboClient(apiKey, baseUrl);
17
17
 
18
- const server = new McpServer({
19
- name: "Verbo",
20
- version: "0.1.0",
21
- });
18
+ const server = new McpServer(
19
+ {
20
+ name: "Verbo",
21
+ version: "0.1.0",
22
+ },
23
+ {
24
+ instructions: `Verbo is an AI-powered WhatsApp customer service agent. You plug it into your product and it handles customer conversations automatically — answers questions, classifies intent, escalates complaints, follows up.
25
+
26
+ ## Setup workflow (run in order):
27
+ 1. verbo_setup_crawl — Crawl the business website to auto-extract name, products, FAQ, hours, tone. This configures the agent.
28
+ 2. verbo_setup_connect — Creates a WhatsApp instance. Returns a URL to scan a QR code in the browser.
29
+ 3. verbo_setup_status — Check if all steps are done. Shows what's missing.
30
+
31
+ ## After setup:
32
+ - verbo_send_message — Send a WhatsApp message to any number
33
+ - verbo_list_conversations — See recent customer conversations
34
+ - verbo_get_conversation — Read messages in a specific conversation
35
+ - verbo_agent_status — Check WhatsApp connection and business config
36
+ - verbo_configure_agent — Update greeting, FAQ, or business hours
37
+ - verbo_setup_disconnect — Disconnect WhatsApp when done
38
+
39
+ ## Important:
40
+ - Do NOT search the web for information about Verbo. Everything you need is in these tools.
41
+ - The crawl step takes 15-30 seconds. This is normal — it fetches multiple pages and uses AI extraction.
42
+ - After connecting WhatsApp, the agent starts responding to incoming messages automatically.`,
43
+ },
44
+ );
22
45
 
23
46
  for (const [name, tool] of Object.entries(toolDefinitions)) {
24
47
  server.tool(name, tool.description, tool.schema, async (args: Record<string, unknown>) => {
@@ -5,14 +5,14 @@ import { type VerboClient } from "./client.js";
5
5
  export const setupToolDefinitions = {
6
6
  verbo_setup_crawl: {
7
7
  description:
8
- "Crawl a website to auto-configure the AI agent. Extracts business name, description, products, FAQ, hours, and tone of voice. Run this first after creating your account.",
8
+ "Crawl a website to auto-configure the AI agent. Extracts business name, description, products, FAQ, hours, and tone of voice. Run this first after creating your account. Rate limited to 5 calls per 10 minutes.",
9
9
  schema: {
10
10
  url: z.string().describe("Website URL (e.g. meuemprego.com.br)"),
11
11
  },
12
12
  },
13
13
  verbo_setup_connect: {
14
14
  description:
15
- "Start WhatsApp connection. Creates the WhatsApp instance and returns a URL where the developer can scan the QR code in their browser. After scanning, the AI agent starts handling messages automatically.",
15
+ "Start WhatsApp connection. Creates the WhatsApp instance and returns a URL where the developer can scan the QR code in their browser. After scanning, the AI agent starts handling messages automatically. Each phone number can only be connected to one business at a time.",
16
16
  schema: {},
17
17
  },
18
18
  verbo_setup_status: {
@@ -37,19 +37,31 @@ export async function executeSetupTool(
37
37
  switch (name) {
38
38
  case "verbo_setup_crawl": {
39
39
  const result = await client.setupCrawl(args.url as string);
40
- return JSON.stringify(result, null, 2);
40
+ return JSON.stringify(result, null, 2) +
41
+ "\n\n→ Business configured from website. Next: run verbo_setup_connect to connect WhatsApp.";
41
42
  }
42
43
  case "verbo_setup_connect": {
43
44
  const result = await client.setupConnect();
44
- return JSON.stringify(result, null, 2);
45
+ const data = result as Record<string, unknown>;
46
+ const connectUrl = data.connectUrl || "";
47
+ return JSON.stringify(result, null, 2) +
48
+ `\n\n→ WhatsApp instance created. IMPORTANT: Tell the user to open ${connectUrl} in their browser and scan the QR code with their phone. After scanning, run verbo_setup_status to confirm the connection.`;
45
49
  }
46
50
  case "verbo_setup_status": {
47
51
  const result = await client.setupStatus();
48
- return JSON.stringify(result, null, 2);
52
+ const data = result as Record<string, unknown>;
53
+ const ready = data.ready;
54
+ if (ready) {
55
+ return JSON.stringify(result, null, 2) +
56
+ "\n\n→ All set! The AI agent is live and will respond to incoming WhatsApp messages automatically. Use verbo_send_message to send a test message.";
57
+ }
58
+ return JSON.stringify(result, null, 2) +
59
+ "\n\n→ Setup incomplete. Check the steps above and run the missing ones.";
49
60
  }
50
61
  case "verbo_setup_disconnect": {
51
62
  const result = await client.setupDisconnect();
52
- return JSON.stringify(result, null, 2);
63
+ return JSON.stringify(result, null, 2) +
64
+ "\n\n→ WhatsApp disconnected. The phone number is free to use elsewhere.";
53
65
  }
54
66
  default:
55
67
  return JSON.stringify({ error: `Unknown setup tool: ${name}` });
package/src/tools.ts CHANGED
@@ -5,52 +5,52 @@ import { type VerboClient } from "./client.js";
5
5
  export const toolDefinitions = {
6
6
  verbo_send_message: {
7
7
  description:
8
- "Enviar mensagem WhatsApp para um número. Suporta texto e imagem.",
8
+ "Send a WhatsApp message to a phone number. Supports text and images.",
9
9
  schema: {
10
10
  to: z
11
11
  .string()
12
- .describe("Número de telefone (ex: +5511999999999)"),
13
- message: z.string().describe("Texto da mensagem"),
12
+ .describe("Phone number (e.g. +5511999999999)"),
13
+ message: z.string().describe("Message text"),
14
14
  image_url: z
15
15
  .string()
16
16
  .optional()
17
- .describe("URL da imagem (opcional)"),
17
+ .describe("Image URL (optional)"),
18
18
  },
19
19
  },
20
20
  verbo_list_conversations: {
21
21
  description:
22
- "Listar conversas recentes. Filtrável por status (open/closed).",
22
+ "List recent conversations. Filterable by status (open/closed).",
23
23
  schema: {
24
24
  status: z
25
25
  .enum(["open", "closed"])
26
26
  .optional()
27
- .describe("Filtrar por status"),
27
+ .describe("Filter by status"),
28
28
  limit: z
29
29
  .number()
30
30
  .optional()
31
- .describe("Máximo de resultados (1-100, default 20)"),
31
+ .describe("Max results (1-100, default 20)"),
32
32
  },
33
33
  },
34
34
  verbo_get_conversation: {
35
35
  description:
36
- "Ver detalhes e mensagens de uma conversa específica.",
36
+ "Get details and messages from a specific conversation.",
37
37
  schema: {
38
- conversation_id: z.string().describe("ID da conversa"),
38
+ conversation_id: z.string().describe("Conversation ID"),
39
39
  },
40
40
  },
41
41
  verbo_agent_status: {
42
42
  description:
43
- "Verificar status do agente: conexão WhatsApp, negócio configurado, etc.",
43
+ "Check agent status: WhatsApp connection, business configuration, etc.",
44
44
  schema: {},
45
45
  },
46
46
  verbo_configure_agent: {
47
47
  description:
48
- "Configurar o comportamento do agente de atendimento. Define greeting, FAQ, horário.",
48
+ "Configure the AI agent behavior. Set greeting message, FAQ, and business hours.",
49
49
  schema: {
50
50
  greeting_message: z
51
51
  .string()
52
52
  .optional()
53
- .describe("Mensagem de saudação para novos clientes"),
53
+ .describe("Greeting message for new customers"),
54
54
  faq: z
55
55
  .array(
56
56
  z.object({
@@ -59,12 +59,12 @@ export const toolDefinitions = {
59
59
  }),
60
60
  )
61
61
  .optional()
62
- .describe("Perguntas frequentes"),
62
+ .describe("Frequently asked questions"),
63
63
  business_hours: z
64
64
  .record(z.string(), z.string())
65
65
  .optional()
66
66
  .describe(
67
- "Horário de funcionamento (ex: { monday: '9:00-18:00' })",
67
+ "Business hours (e.g. { monday: '9:00-18:00' })",
68
68
  ),
69
69
  },
70
70
  },
@@ -84,14 +84,16 @@ export async function executeTool(
84
84
  args.message as string,
85
85
  args.image_url as string | undefined,
86
86
  );
87
- return JSON.stringify(result, null, 2);
87
+ return JSON.stringify(result, null, 2) +
88
+ "\n\n→ Message sent. Use verbo_list_conversations to see the conversation.";
88
89
  }
89
90
  case "verbo_list_conversations": {
90
91
  const result = await client.listConversations({
91
92
  status: args.status as string | undefined,
92
93
  limit: args.limit as number | undefined,
93
94
  });
94
- return JSON.stringify(result, null, 2);
95
+ return JSON.stringify(result, null, 2) +
96
+ "\n\n→ Use verbo_get_conversation with a conversation ID to see full messages.";
95
97
  }
96
98
  case "verbo_get_conversation": {
97
99
  const result = await client.getConversation(
@@ -111,7 +113,8 @@ export async function executeTool(
111
113
  | Record<string, unknown>
112
114
  | undefined,
113
115
  });
114
- return JSON.stringify(result, null, 2);
116
+ return JSON.stringify(result, null, 2) +
117
+ "\n\n→ Agent updated. Use verbo_setup_status to verify the full setup.";
115
118
  }
116
119
  default:
117
120
  return JSON.stringify({ error: `Unknown tool: ${name}` });