neuron-mcp-server 1.0.0 → 1.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.
Files changed (150) hide show
  1. package/.env +13 -0
  2. package/AI_PERSONALITY_DESIGN_RESEARCH.md +1020 -0
  3. package/Dockerfile +18 -0
  4. package/README.md +146 -131
  5. package/dist/client.d.ts +6 -0
  6. package/dist/client.js +50 -12
  7. package/dist/client.js.map +1 -1
  8. package/dist/index.js +51 -7
  9. package/dist/index.js.map +1 -1
  10. package/dist/tools/ai.js +9 -3
  11. package/dist/tools/ai.js.map +1 -1
  12. package/dist/tools/approvals.d.ts +2 -0
  13. package/dist/tools/approvals.js +181 -0
  14. package/dist/tools/approvals.js.map +1 -0
  15. package/dist/tools/audit.js +7 -4
  16. package/dist/tools/audit.js.map +1 -1
  17. package/dist/tools/auth.js +119 -19
  18. package/dist/tools/auth.js.map +1 -1
  19. package/dist/tools/billing.js +22 -6
  20. package/dist/tools/billing.js.map +1 -1
  21. package/dist/tools/blog.js +98 -34
  22. package/dist/tools/blog.js.map +1 -1
  23. package/dist/tools/bot-api-keys.js +27 -12
  24. package/dist/tools/bot-api-keys.js.map +1 -1
  25. package/dist/tools/bot-api.js +53 -27
  26. package/dist/tools/bot-api.js.map +1 -1
  27. package/dist/tools/bots.js +116 -68
  28. package/dist/tools/bots.js.map +1 -1
  29. package/dist/tools/broadcasts.js +78 -38
  30. package/dist/tools/broadcasts.js.map +1 -1
  31. package/dist/tools/builtin-tools.js +19 -12
  32. package/dist/tools/builtin-tools.js.map +1 -1
  33. package/dist/tools/campaigns.js +149 -61
  34. package/dist/tools/campaigns.js.map +1 -1
  35. package/dist/tools/channels.js +163 -53
  36. package/dist/tools/channels.js.map +1 -1
  37. package/dist/tools/contact-lists.js +111 -51
  38. package/dist/tools/contact-lists.js.map +1 -1
  39. package/dist/tools/contacts.js +117 -44
  40. package/dist/tools/contacts.js.map +1 -1
  41. package/dist/tools/conversations.js +95 -50
  42. package/dist/tools/conversations.js.map +1 -1
  43. package/dist/tools/flows.d.ts +2 -0
  44. package/dist/tools/flows.js +242 -0
  45. package/dist/tools/flows.js.map +1 -0
  46. package/dist/tools/group-management.d.ts +2 -0
  47. package/dist/tools/group-management.js +239 -0
  48. package/dist/tools/group-management.js.map +1 -0
  49. package/dist/tools/leads.d.ts +2 -0
  50. package/dist/tools/leads.js +100 -0
  51. package/dist/tools/leads.js.map +1 -0
  52. package/dist/tools/list-campaigns.d.ts +2 -0
  53. package/dist/tools/list-campaigns.js +152 -0
  54. package/dist/tools/list-campaigns.js.map +1 -0
  55. package/dist/tools/list-pool.js +250 -33
  56. package/dist/tools/list-pool.js.map +1 -1
  57. package/dist/tools/media.js +12 -7
  58. package/dist/tools/media.js.map +1 -1
  59. package/dist/tools/newsletters.js +106 -26
  60. package/dist/tools/newsletters.js.map +1 -1
  61. package/dist/tools/organizations.js +76 -35
  62. package/dist/tools/organizations.js.map +1 -1
  63. package/dist/tools/outbound-webhooks.js +32 -20
  64. package/dist/tools/outbound-webhooks.js.map +1 -1
  65. package/dist/tools/payouts.js +44 -17
  66. package/dist/tools/payouts.js.map +1 -1
  67. package/dist/tools/personas.d.ts +2 -0
  68. package/dist/tools/personas.js +141 -0
  69. package/dist/tools/personas.js.map +1 -0
  70. package/dist/tools/polls.d.ts +2 -0
  71. package/dist/tools/polls.js +30 -0
  72. package/dist/tools/polls.js.map +1 -0
  73. package/dist/tools/pool.js +101 -43
  74. package/dist/tools/pool.js.map +1 -1
  75. package/dist/tools/products.d.ts +2 -0
  76. package/dist/tools/products.js +277 -0
  77. package/dist/tools/products.js.map +1 -0
  78. package/dist/tools/profile-privacy.d.ts +2 -0
  79. package/dist/tools/profile-privacy.js +195 -0
  80. package/dist/tools/profile-privacy.js.map +1 -0
  81. package/dist/tools/reflections.js +25 -13
  82. package/dist/tools/reflections.js.map +1 -1
  83. package/dist/tools/scheduled-messages.d.ts +2 -0
  84. package/dist/tools/scheduled-messages.js +124 -0
  85. package/dist/tools/scheduled-messages.js.map +1 -0
  86. package/dist/tools/social-channels.d.ts +2 -0
  87. package/dist/tools/social-channels.js +318 -0
  88. package/dist/tools/social-channels.js.map +1 -0
  89. package/dist/tools/tasks.d.ts +2 -0
  90. package/dist/tools/tasks.js +155 -0
  91. package/dist/tools/tasks.js.map +1 -0
  92. package/dist/tools/tools.js +86 -40
  93. package/dist/tools/tools.js.map +1 -1
  94. package/dist/tools/wallets.js +34 -12
  95. package/dist/tools/wallets.js.map +1 -1
  96. package/dist/tools/webhooks.js +35 -20
  97. package/dist/tools/webhooks.js.map +1 -1
  98. package/dist/tools/whatsapp-actions.d.ts +2 -0
  99. package/dist/tools/whatsapp-actions.js +186 -0
  100. package/dist/tools/whatsapp-actions.js.map +1 -0
  101. package/package.json +4 -31
  102. package/scripts/setup-delivahere-bot.ts +804 -0
  103. package/scripts/test-delivahere-bot.ts +128 -0
  104. package/scripts/update-letschop-prompt.ts +194 -0
  105. package/server.json +26 -0
  106. package/smithery.yaml +19 -0
  107. package/src/client.ts +169 -0
  108. package/src/index.ts +256 -0
  109. package/src/tools/ai.ts +35 -0
  110. package/src/tools/approvals.ts +231 -0
  111. package/src/tools/audit.ts +49 -0
  112. package/src/tools/auth.ts +536 -0
  113. package/src/tools/billing.ts +79 -0
  114. package/src/tools/blog.ts +264 -0
  115. package/src/tools/bot-api-keys.ts +87 -0
  116. package/src/tools/bot-api.ts +193 -0
  117. package/src/tools/bots.ts +320 -0
  118. package/src/tools/broadcasts.ts +224 -0
  119. package/src/tools/builtin-tools.ts +108 -0
  120. package/src/tools/campaigns.ts +429 -0
  121. package/src/tools/channels.ts +520 -0
  122. package/src/tools/contact-lists.ts +320 -0
  123. package/src/tools/contacts.ts +395 -0
  124. package/src/tools/conversations.ts +349 -0
  125. package/src/tools/flows.ts +298 -0
  126. package/src/tools/group-management.ts +265 -0
  127. package/src/tools/knowledge-bases.ts +451 -0
  128. package/src/tools/leads.ts +104 -0
  129. package/src/tools/list-campaigns.ts +190 -0
  130. package/src/tools/list-pool.ts +389 -0
  131. package/src/tools/media.ts +50 -0
  132. package/src/tools/newsletters.ts +271 -0
  133. package/src/tools/organizations.ts +287 -0
  134. package/src/tools/outbound-webhooks.ts +181 -0
  135. package/src/tools/payouts.ts +133 -0
  136. package/src/tools/personas.ts +145 -0
  137. package/src/tools/polls.ts +32 -0
  138. package/src/tools/pool.ts +293 -0
  139. package/src/tools/products.ts +280 -0
  140. package/src/tools/profile-privacy.ts +215 -0
  141. package/src/tools/reflections.ts +124 -0
  142. package/src/tools/scheduled-messages.ts +144 -0
  143. package/src/tools/social-channels.ts +396 -0
  144. package/src/tools/tasks.ts +198 -0
  145. package/src/tools/tools.ts +255 -0
  146. package/src/tools/wallets.ts +107 -0
  147. package/src/tools/webhooks.ts +166 -0
  148. package/src/tools/whatsapp-actions.ts +203 -0
  149. package/tsconfig.json +20 -0
  150. package/LICENSE +0 -21
@@ -0,0 +1,203 @@
1
+ import { z } from "zod";
2
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { api, jsonResult, errorResult } from "../client.js";
4
+
5
+ export function registerWhatsAppActionTools(server: McpServer): void {
6
+ // 1. Send Reaction
7
+ server.registerTool(
8
+ "neuron_send_reaction",
9
+ {
10
+ title: "Send Reaction",
11
+ description: "Send or remove an emoji reaction on a WhatsApp message. Pass an empty emoji string to remove a reaction.",
12
+ inputSchema: z.object({
13
+ channelId: z.string().describe("WhatsApp channel identifier (UUID)"),
14
+ to: z.string().describe("Chat JID (e.g. '2348012345678@s.whatsapp.net' or group JID)"),
15
+ messageId: z.string().describe("WhatsApp message ID to react to"),
16
+ emoji: z.string().describe("Emoji character (e.g. '👍', '❤️'), or empty string to remove reaction"),
17
+ }),
18
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
19
+ },
20
+ async (args) => {
21
+ try {
22
+ const res = await api("POST", `/whatsapp-actions/${args.channelId}/react`, {
23
+ to: args.to, messageId: args.messageId, emoji: args.emoji,
24
+ });
25
+ return jsonResult(res);
26
+ } catch (error) { return errorResult(error); }
27
+ },
28
+ );
29
+
30
+ // 2. Send Sticker
31
+ server.registerTool(
32
+ "neuron_send_sticker",
33
+ {
34
+ title: "Send Sticker",
35
+ description:
36
+ "Send a sticker via WhatsApp. The easy way: pass `sticker` as a mood or label (e.g. 'laughing', 'thumbs up', 'fire', 'celebrate') and a matching sticker is found automatically from the platform-wide community sticker library (falling back to this org's own stickers). Advanced: pass `stickerUrl` with a direct public WebP image URL instead. Provide one of the two. Only supported on Baileys channels.",
37
+ inputSchema: z.object({
38
+ channelId: z.string().describe("WhatsApp channel identifier (UUID)"),
39
+ to: z.string().describe("Recipient JID or phone number"),
40
+ sticker: z
41
+ .string()
42
+ .optional()
43
+ .describe("Mood or label to auto-match a sticker (e.g. 'laughing', 'fire', 'celebrate'). Preferred over stickerUrl."),
44
+ stickerUrl: z
45
+ .string()
46
+ .optional()
47
+ .describe("Advanced: direct URL to a public WebP sticker image. Use only if no mood/label fits."),
48
+ }),
49
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
50
+ },
51
+ async (args) => {
52
+ try {
53
+ const res = await api("POST", `/whatsapp-actions/${args.channelId}/send-sticker`, {
54
+ to: args.to, sticker: args.sticker, stickerUrl: args.stickerUrl,
55
+ });
56
+ return jsonResult(res);
57
+ } catch (error) { return errorResult(error); }
58
+ },
59
+ );
60
+
61
+ // 3. Send Location
62
+ server.registerTool(
63
+ "neuron_send_location",
64
+ {
65
+ title: "Send Location",
66
+ description: "Send a location pin via WhatsApp with coordinates and optional name/address.",
67
+ inputSchema: z.object({
68
+ channelId: z.string().describe("WhatsApp channel identifier (UUID)"),
69
+ to: z.string().describe("Recipient JID or phone number"),
70
+ latitude: z.number().describe("Latitude in decimal degrees"),
71
+ longitude: z.number().describe("Longitude in decimal degrees"),
72
+ name: z.string().optional().describe("Location name (e.g. 'Eko Hotel')"),
73
+ address: z.string().optional().describe("Street address"),
74
+ }),
75
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
76
+ },
77
+ async (args) => {
78
+ try {
79
+ const res = await api("POST", `/whatsapp-actions/${args.channelId}/send-location`, {
80
+ to: args.to, latitude: args.latitude, longitude: args.longitude,
81
+ name: args.name, address: args.address,
82
+ });
83
+ return jsonResult(res);
84
+ } catch (error) { return errorResult(error); }
85
+ },
86
+ );
87
+
88
+ // 4. Send Contact Card
89
+ server.registerTool(
90
+ "neuron_send_contact_card",
91
+ {
92
+ title: "Send Contact Card",
93
+ description: "Send a vCard contact card via WhatsApp with name, phone, and optional organization.",
94
+ inputSchema: z.object({
95
+ channelId: z.string().describe("WhatsApp channel identifier (UUID)"),
96
+ to: z.string().describe("Recipient JID or phone number"),
97
+ contactName: z.string().describe("Full name of the contact to share"),
98
+ contactPhone: z.string().describe("Phone number in international format (e.g. '+2348012345678')"),
99
+ contactOrg: z.string().optional().describe("Organization or company name"),
100
+ }),
101
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
102
+ },
103
+ async (args) => {
104
+ try {
105
+ const res = await api("POST", `/whatsapp-actions/${args.channelId}/send-contact`, {
106
+ to: args.to, contactName: args.contactName,
107
+ contactPhone: args.contactPhone, contactOrg: args.contactOrg,
108
+ });
109
+ return jsonResult(res);
110
+ } catch (error) { return errorResult(error); }
111
+ },
112
+ );
113
+
114
+ // 5. Forward Message
115
+ server.registerTool(
116
+ "neuron_forward_message",
117
+ {
118
+ title: "Forward Message",
119
+ description: "Forward a WhatsApp message from one chat to another. Uses copy-send approach — the message content is re-sent to the destination.",
120
+ inputSchema: z.object({
121
+ channelId: z.string().describe("WhatsApp channel identifier (UUID)"),
122
+ messageId: z.string().describe("WhatsApp message ID to forward"),
123
+ from: z.string().describe("Source chat JID"),
124
+ to: z.string().describe("Destination chat JID"),
125
+ }),
126
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
127
+ },
128
+ async (args) => {
129
+ try {
130
+ const res = await api("POST", `/whatsapp-actions/${args.channelId}/forward`, {
131
+ messageId: args.messageId, from: args.from, to: args.to,
132
+ });
133
+ return jsonResult(res);
134
+ } catch (error) { return errorResult(error); }
135
+ },
136
+ );
137
+
138
+ // 6. Mark as Read
139
+ server.registerTool(
140
+ "neuron_mark_as_read",
141
+ {
142
+ title: "Mark as Read",
143
+ description: "Mark a WhatsApp message as read, sending read receipts to the sender.",
144
+ inputSchema: z.object({
145
+ channelId: z.string().describe("WhatsApp channel identifier (UUID)"),
146
+ chatJid: z.string().describe("Chat JID the message belongs to"),
147
+ messageId: z.string().describe("WhatsApp message ID to mark as read"),
148
+ }),
149
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
150
+ },
151
+ async (args) => {
152
+ try {
153
+ const res = await api("POST", `/whatsapp-actions/${args.channelId}/mark-read`, {
154
+ messageId: args.messageId, chatJid: args.chatJid,
155
+ });
156
+ return jsonResult(res);
157
+ } catch (error) { return errorResult(error); }
158
+ },
159
+ );
160
+
161
+ // 7. Set Presence
162
+ server.registerTool(
163
+ "neuron_set_presence",
164
+ {
165
+ title: "Set Presence",
166
+ description: "Set typing indicator or online/offline presence on a WhatsApp chat. Only supported on Baileys channels.",
167
+ inputSchema: z.object({
168
+ channelId: z.string().describe("WhatsApp channel identifier (UUID)"),
169
+ to: z.string().describe("Chat JID to set presence for"),
170
+ type: z.enum(["composing", "paused", "available", "unavailable"]).describe("Presence type"),
171
+ }),
172
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
173
+ },
174
+ async (args) => {
175
+ try {
176
+ const res = await api("POST", `/whatsapp-actions/${args.channelId}/presence`, {
177
+ to: args.to, type: args.type,
178
+ });
179
+ return jsonResult(res);
180
+ } catch (error) { return errorResult(error); }
181
+ },
182
+ );
183
+
184
+ // 8. Get Group Invite Link
185
+ server.registerTool(
186
+ "neuron_get_group_invite_link",
187
+ {
188
+ title: "Get Group Invite Link",
189
+ description: "Get the invite link for a WhatsApp group. Only supported on Baileys channels where the bot is a group admin.",
190
+ inputSchema: z.object({
191
+ channelId: z.string().describe("WhatsApp channel identifier (UUID)"),
192
+ groupJid: z.string().describe("Group JID (ending in @g.us)"),
193
+ }),
194
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
195
+ },
196
+ async (args) => {
197
+ try {
198
+ const res = await api("GET", `/whatsapp-actions/${args.channelId}/groups/${args.groupJid}/invite-link`);
199
+ return jsonResult(res);
200
+ } catch (error) { return errorResult(error); }
201
+ },
202
+ );
203
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "Node16",
5
+ "moduleResolution": "Node16",
6
+ "lib": ["ES2022"],
7
+ "types": ["node"],
8
+ "outDir": "./dist",
9
+ "rootDir": "./src",
10
+ "strict": true,
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "declaration": true,
15
+ "sourceMap": true,
16
+ "allowSyntheticDefaultImports": true
17
+ },
18
+ "include": ["src/**/*"],
19
+ "exclude": ["node_modules", "dist"]
20
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Neuron (https://neuron.ng)
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.