conduyt-mcp 4.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 (65) hide show
  1. package/.env.example +2 -0
  2. package/README.md +286 -0
  3. package/dist/client.d.ts +17 -0
  4. package/dist/client.js +43 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.js +79 -0
  7. package/dist/tools/activities.d.ts +3 -0
  8. package/dist/tools/activities.js +35 -0
  9. package/dist/tools/ai-extended.d.ts +3 -0
  10. package/dist/tools/ai-extended.js +38 -0
  11. package/dist/tools/ai.d.ts +3 -0
  12. package/dist/tools/ai.js +22 -0
  13. package/dist/tools/automations.d.ts +3 -0
  14. package/dist/tools/automations.js +66 -0
  15. package/dist/tools/bulk.d.ts +3 -0
  16. package/dist/tools/bulk.js +71 -0
  17. package/dist/tools/calendar.d.ts +3 -0
  18. package/dist/tools/calendar.js +81 -0
  19. package/dist/tools/companies.d.ts +3 -0
  20. package/dist/tools/companies.js +67 -0
  21. package/dist/tools/contacts.d.ts +3 -0
  22. package/dist/tools/contacts.js +64 -0
  23. package/dist/tools/custom-fields.d.ts +3 -0
  24. package/dist/tools/custom-fields.js +48 -0
  25. package/dist/tools/dashboard.d.ts +3 -0
  26. package/dist/tools/dashboard.js +7 -0
  27. package/dist/tools/deals.d.ts +3 -0
  28. package/dist/tools/deals.js +59 -0
  29. package/dist/tools/discovery.d.ts +3 -0
  30. package/dist/tools/discovery.js +28 -0
  31. package/dist/tools/drip-campaigns.d.ts +3 -0
  32. package/dist/tools/drip-campaigns.js +98 -0
  33. package/dist/tools/forms.d.ts +3 -0
  34. package/dist/tools/forms.js +54 -0
  35. package/dist/tools/invoices.d.ts +3 -0
  36. package/dist/tools/invoices.js +76 -0
  37. package/dist/tools/messaging.d.ts +3 -0
  38. package/dist/tools/messaging.js +25 -0
  39. package/dist/tools/notifications.d.ts +3 -0
  40. package/dist/tools/notifications.js +28 -0
  41. package/dist/tools/pipelines.d.ts +3 -0
  42. package/dist/tools/pipelines.js +7 -0
  43. package/dist/tools/products.d.ts +3 -0
  44. package/dist/tools/products.js +55 -0
  45. package/dist/tools/scoring.d.ts +3 -0
  46. package/dist/tools/scoring.js +48 -0
  47. package/dist/tools/sequences.d.ts +3 -0
  48. package/dist/tools/sequences.js +53 -0
  49. package/dist/tools/smart-lists.d.ts +3 -0
  50. package/dist/tools/smart-lists.js +54 -0
  51. package/dist/tools/tags.d.ts +3 -0
  52. package/dist/tools/tags.js +44 -0
  53. package/dist/tools/tasks.d.ts +3 -0
  54. package/dist/tools/tasks.js +40 -0
  55. package/dist/tools/templates.d.ts +3 -0
  56. package/dist/tools/templates.js +55 -0
  57. package/dist/tools/users.d.ts +3 -0
  58. package/dist/tools/users.js +65 -0
  59. package/dist/tools/webhooks.d.ts +3 -0
  60. package/dist/tools/webhooks.js +41 -0
  61. package/dist/tools/workflow-sandbox.d.ts +3 -0
  62. package/dist/tools/workflow-sandbox.js +90 -0
  63. package/dist/types.d.ts +20 -0
  64. package/dist/types.js +1 -0
  65. package/package.json +53 -0
package/.env.example ADDED
@@ -0,0 +1,2 @@
1
+ CONDUYT_API_URL=https://conduyt.app
2
+ CONDUYT_API_KEY=cdy_your_key_here
package/README.md ADDED
@@ -0,0 +1,286 @@
1
+ # Conduyt MCP Server
2
+
3
+ MCP server for [Conduyt CRM](https://conduyt.app) — expose your entire CRM as AI-accessible tools.
4
+
5
+ ## 107 Tools
6
+
7
+ ### Discovery
8
+ | Tool | Description |
9
+ |------|-------------|
10
+ | `conduyt_api_catalog` | Discover all 409 API endpoints |
11
+ | `conduyt_check_permissions` | Introspect current API key permissions |
12
+ | `conduyt_search` | Global search across contacts, deals, companies, tasks |
13
+
14
+ ### Contacts
15
+ | Tool | Description |
16
+ |------|-------------|
17
+ | `conduyt_list_contacts` | List and search contacts with filters |
18
+ | `conduyt_get_contact` | Get full contact details with timeline |
19
+ | `conduyt_create_contact` | Create a new contact |
20
+ | `conduyt_update_contact` | Update contact fields |
21
+ | `conduyt_add_tags` | Add tags to a contact |
22
+
23
+ ### Deals
24
+ | Tool | Description |
25
+ |------|-------------|
26
+ | `conduyt_list_deals` | List deals by pipeline, stage, or assignee |
27
+ | `conduyt_get_deal` | Get deal details with history |
28
+ | `conduyt_create_deal` | Create a deal in a pipeline |
29
+ | `conduyt_update_deal` | Move stage, change value, mark won/lost |
30
+
31
+ ### Tasks
32
+ | Tool | Description |
33
+ |------|-------------|
34
+ | `conduyt_list_tasks` | List tasks by assignee, status, due date |
35
+ | `conduyt_create_task` | Create and assign a task |
36
+
37
+ ### Pipelines
38
+ | Tool | Description |
39
+ |------|-------------|
40
+ | `conduyt_list_pipelines` | List pipelines with stages |
41
+
42
+ ### Activities
43
+ | Tool | Description |
44
+ |------|-------------|
45
+ | `conduyt_list_activities` | List recent CRM activities |
46
+ | `conduyt_create_activity` | Log a call, meeting, or note |
47
+
48
+ ### AI
49
+ | Tool | Description |
50
+ |------|-------------|
51
+ | `conduyt_ai_insights` | AI-powered CRM analytics (8 query types) |
52
+
53
+ ### Automations
54
+ | Tool | Description |
55
+ |------|-------------|
56
+ | `conduyt_list_automations` | List all automations with status |
57
+ | `conduyt_get_automation` | Get automation with full action graph |
58
+ | `conduyt_create_automation` | Create a new automation with triggers and actions |
59
+ | `conduyt_update_automation` | Update trigger, actions, or activation status |
60
+ | `conduyt_publish_automation` | Push draft actions to live |
61
+ | `conduyt_resolve_names` | Convert tag/pipeline/user names to UUIDs |
62
+
63
+ ### Workflow Sandbox
64
+ | Tool | Description |
65
+ |------|-------------|
66
+ | `conduyt_workflow_validate` | Validate a workflow graph without saving — returns errors and warnings |
67
+ | `conduyt_workflow_simulate` | Dry-run a workflow against a real or stub contact — step-by-step trace with compliance and provider checks |
68
+ | `conduyt_workflow_promote` | Safely publish a workflow — validates first, refuses if errors exist |
69
+
70
+ ### Email Sequences
71
+ | Tool | Description |
72
+ |------|-------------|
73
+ | `conduyt_list_sequences` | List email sequences with enrollment stats |
74
+ | `conduyt_get_sequence` | Get sequence with steps and stats |
75
+ | `conduyt_create_sequence` | Create a new email sequence with steps |
76
+ | `conduyt_enroll_in_sequence` | Enroll contacts into a sequence |
77
+ | `conduyt_unenroll_from_sequence` | Remove a contact from a sequence |
78
+
79
+ ### Messaging
80
+ | Tool | Description |
81
+ |------|-------------|
82
+ | `conduyt_send_sms` | Send SMS to a contact (max 1600 chars) |
83
+ | `conduyt_send_email` | Send a single email to a contact |
84
+
85
+ ### Companies
86
+ | Tool | Description |
87
+ |------|-------------|
88
+ | `conduyt_list_companies` | List and search companies |
89
+ | `conduyt_get_company` | Get company with contacts and deals |
90
+ | `conduyt_create_company` | Create a new company record |
91
+ | `conduyt_update_company` | Update company details |
92
+
93
+ ### Tags
94
+ | Tool | Description |
95
+ |------|-------------|
96
+ | `conduyt_list_tags` | List all tags with contact counts |
97
+ | `conduyt_create_tag` | Create a new tag |
98
+ | `conduyt_update_tag` | Rename or recolor a tag |
99
+ | `conduyt_delete_tag` | Delete a tag |
100
+ | `conduyt_merge_tags` | Merge two tags (deduplicate) |
101
+
102
+ ### Calendar & Appointments
103
+ | Tool | Description |
104
+ |------|-------------|
105
+ | `conduyt_list_calendars` | List calendars with appointment counts |
106
+ | `conduyt_list_appointments` | List appointments by date, calendar, contact, assignee |
107
+ | `conduyt_get_appointment` | Get appointment with contact and assignee details |
108
+ | `conduyt_create_appointment` | Create an appointment (times require timezone) |
109
+ | `conduyt_update_appointment` | Reschedule, reassign, or cancel |
110
+
111
+ ### Forms
112
+ | Tool | Description |
113
+ |------|-------------|
114
+ | `conduyt_list_forms` | List web forms with submission counts |
115
+ | `conduyt_get_form` | Get form with fields and settings |
116
+ | `conduyt_create_form` | Create a new web form |
117
+ | `conduyt_list_form_submissions` | List submissions for a form |
118
+
119
+ ### Invoices
120
+ | Tool | Description |
121
+ |------|-------------|
122
+ | `conduyt_list_invoices` | List invoices by status, contact, or date |
123
+ | `conduyt_get_invoice` | Get invoice with line items and payments |
124
+ | `conduyt_create_invoice` | Create invoice with line items (auto-calculates totals) |
125
+ | `conduyt_update_invoice` | Update draft invoice items or details |
126
+ | `conduyt_send_invoice` | Send invoice via email with PDF and Stripe payment link |
127
+
128
+ ### Webhooks
129
+ | Tool | Description |
130
+ |------|-------------|
131
+ | `conduyt_list_webhooks` | List registered webhooks |
132
+ | `conduyt_create_webhook` | Register a new webhook (returns signing secret) |
133
+ | `conduyt_update_webhook` | Update URL, events, or enable/disable |
134
+ | `conduyt_delete_webhook` | Delete a webhook endpoint |
135
+
136
+ ### Notifications
137
+ | Tool | Description |
138
+ |------|-------------|
139
+ | `conduyt_list_notifications` | List notifications for current user |
140
+ | `conduyt_create_notification` | Send in-app + push notification to a team member |
141
+
142
+ ### Custom Fields
143
+ | Tool | Description |
144
+ |------|-------------|
145
+ | `conduyt_list_custom_fields` | List custom field definitions (contact/deal) |
146
+ | `conduyt_create_custom_field` | Create a custom field (text, number, date, select, etc.) |
147
+ | `conduyt_update_custom_field` | Update label, options, or required status |
148
+ | `conduyt_delete_custom_field` | Delete a custom field |
149
+
150
+ ### Smart Lists
151
+ | Tool | Description |
152
+ |------|-------------|
153
+ | `conduyt_list_smart_lists` | List all segments with contact counts |
154
+ | `conduyt_get_smart_list` | Get smart list with filters |
155
+ | `conduyt_create_smart_list` | Create static or dynamic smart list |
156
+ | `conduyt_update_smart_list` | Update name, filters, or type |
157
+ | `conduyt_add_contacts_to_smart_list` | Add contacts to a static list (max 500) |
158
+ | `conduyt_get_smart_list_contacts` | Get contacts in a smart list |
159
+
160
+ ### Users & Team
161
+ | Tool | Description |
162
+ |------|-------------|
163
+ | `conduyt_list_users` | List team members with optional stats |
164
+ | `conduyt_get_user` | Get user profile and permissions |
165
+ | `conduyt_create_user` | Create user directly (no invite email) |
166
+ | `conduyt_update_user` | Update profile, role, or permissions |
167
+ | `conduyt_get_user_stats` | Get performance stats (deals, tasks, activity) |
168
+ | `conduyt_invite_user` | Invite team member via email |
169
+
170
+ ### Bulk Operations
171
+ | Tool | Description |
172
+ |------|-------------|
173
+ | `conduyt_ai_import_contacts` | AI-powered bulk import (up to 1000, auto-tag, smart list, automation) |
174
+ | `conduyt_export_contacts` | Export contacts as JSON with filters |
175
+ | `conduyt_export_deals` | Export deals as JSON with filters |
176
+
177
+ ### Drip Campaigns
178
+ | Tool | Description |
179
+ |------|-------------|
180
+ | `conduyt_list_drip_campaigns` | List SMS/email drip campaigns |
181
+ | `conduyt_get_drip_campaign` | Get campaign with steps and provider config |
182
+ | `conduyt_create_drip_campaign` | Create a drip campaign with schedule |
183
+ | `conduyt_update_drip_campaign` | Update campaign settings |
184
+ | `conduyt_list_drip_enrollments` | List enrollments by campaign, contact, status |
185
+ | `conduyt_batch_pause_enrollments` | Pause all active enrollments |
186
+ | `conduyt_batch_resume_enrollments` | Resume paused enrollments |
187
+ | `conduyt_batch_stop_enrollments` | Permanently stop enrollments |
188
+
189
+ ### Lead Scoring
190
+ | Tool | Description |
191
+ |------|-------------|
192
+ | `conduyt_list_scoring_rules` | List scoring rules |
193
+ | `conduyt_create_scoring_rule` | Create a scoring rule |
194
+ | `conduyt_update_scoring_rule` | Update rule name, points, or condition |
195
+ | `conduyt_delete_scoring_rule` | Delete a scoring rule |
196
+ | `conduyt_recalculate_scores` | Recalculate all contact scores |
197
+
198
+ ### Products
199
+ | Tool | Description |
200
+ |------|-------------|
201
+ | `conduyt_list_products` | List product catalog |
202
+ | `conduyt_get_product` | Get product details |
203
+ | `conduyt_create_product` | Create a product |
204
+ | `conduyt_update_product` | Update product pricing or details |
205
+
206
+ ### Templates
207
+ | Tool | Description |
208
+ |------|-------------|
209
+ | `conduyt_list_templates` | List email/SMS templates |
210
+ | `conduyt_get_template` | Get template content |
211
+ | `conduyt_create_template` | Create email or SMS template |
212
+ | `conduyt_update_template` | Update template content |
213
+
214
+ ### Dashboard
215
+ | Tool | Description |
216
+ |------|-------------|
217
+ | `conduyt_dashboard` | Full CRM dashboard (pipeline, activities, metrics, follow-ups) |
218
+
219
+ ### AI Extended
220
+ | Tool | Description |
221
+ |------|-------------|
222
+ | `conduyt_ai_compose_email` | AI-generated email with context-aware tone |
223
+ | `conduyt_ai_enrich_contact` | AI-powered contact data enrichment |
224
+ | `conduyt_ai_summarize_contact` | AI summary with sentiment and next steps |
225
+
226
+ ## Setup
227
+
228
+ ```bash
229
+ npm install
230
+ ```
231
+
232
+ ## Claude Desktop
233
+
234
+ Add to `claude_desktop_config.json`:
235
+
236
+ ```json
237
+ {
238
+ "mcpServers": {
239
+ "conduyt": {
240
+ "command": "npx",
241
+ "args": ["tsx", "src/index.ts"],
242
+ "cwd": "/path/to/conduyt-mcp",
243
+ "env": {
244
+ "CONDUYT_API_URL": "https://conduyt.app",
245
+ "CONDUYT_API_KEY": "cdy_your_key_here"
246
+ }
247
+ }
248
+ }
249
+ }
250
+ ```
251
+
252
+ ## Claude Code
253
+
254
+ Add to `.mcp.json` or settings:
255
+
256
+ ```json
257
+ {
258
+ "mcpServers": {
259
+ "conduyt": {
260
+ "command": "npx",
261
+ "args": ["tsx", "/path/to/conduyt-mcp/src/index.ts"],
262
+ "env": {
263
+ "CONDUYT_API_URL": "https://conduyt.app",
264
+ "CONDUYT_API_KEY": "cdy_your_key_here"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ ```
270
+
271
+ ## Authentication
272
+
273
+ Generate an API key in Conduyt at **Settings > API Keys**. Keys use the `cdy_` prefix and support three tiers:
274
+
275
+ - **read** — GET requests only
276
+ - **write** — GET + POST + PATCH
277
+ - **admin** — Full access including DELETE
278
+
279
+ Scopes can be restricted to specific modules (contacts, deals, tasks, etc.).
280
+
281
+ ## Environment Variables
282
+
283
+ | Variable | Required | Description |
284
+ |----------|----------|-------------|
285
+ | `CONDUYT_API_URL` | Yes | Base URL (e.g. `https://conduyt.app`) |
286
+ | `CONDUYT_API_KEY` | Yes | API key starting with `cdy_` |
@@ -0,0 +1,17 @@
1
+ import type { ConduytConfig } from "./types.js";
2
+ export declare class ConduytClient {
3
+ private baseUrl;
4
+ private apiKey;
5
+ constructor(config: ConduytConfig);
6
+ request(method: string, path: string, body?: unknown): Promise<unknown>;
7
+ get(path: string): Promise<unknown>;
8
+ post(path: string, body: unknown): Promise<unknown>;
9
+ patch(path: string, body: unknown): Promise<unknown>;
10
+ del(path: string): Promise<unknown>;
11
+ }
12
+ export declare function formatResult(data: unknown): {
13
+ content: Array<{
14
+ type: "text";
15
+ text: string;
16
+ }>;
17
+ };
package/dist/client.js ADDED
@@ -0,0 +1,43 @@
1
+ export class ConduytClient {
2
+ baseUrl;
3
+ apiKey;
4
+ constructor(config) {
5
+ this.baseUrl = config.apiUrl.replace(/\/+$/, "");
6
+ this.apiKey = config.apiKey;
7
+ }
8
+ async request(method, path, body) {
9
+ const url = `${this.baseUrl}${path}`;
10
+ const headers = {
11
+ Authorization: `Bearer ${this.apiKey}`,
12
+ "Content-Type": "application/json",
13
+ };
14
+ const res = await fetch(url, {
15
+ method,
16
+ headers,
17
+ body: body ? JSON.stringify(body) : undefined,
18
+ });
19
+ const json = await res.json().catch(() => null);
20
+ if (!res.ok) {
21
+ const msg = json?.error || res.statusText;
22
+ throw new Error(`Conduyt API ${res.status}: ${msg}`);
23
+ }
24
+ return json;
25
+ }
26
+ get(path) {
27
+ return this.request("GET", path);
28
+ }
29
+ post(path, body) {
30
+ return this.request("POST", path, body);
31
+ }
32
+ patch(path, body) {
33
+ return this.request("PATCH", path, body);
34
+ }
35
+ del(path) {
36
+ return this.request("DELETE", path);
37
+ }
38
+ }
39
+ export function formatResult(data) {
40
+ return {
41
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
42
+ };
43
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { ConduytClient } from "./client.js";
5
+ import { registerDiscoveryTools } from "./tools/discovery.js";
6
+ import { registerContactTools } from "./tools/contacts.js";
7
+ import { registerDealTools } from "./tools/deals.js";
8
+ import { registerTaskTools } from "./tools/tasks.js";
9
+ import { registerPipelineTools } from "./tools/pipelines.js";
10
+ import { registerActivityTools } from "./tools/activities.js";
11
+ import { registerAiTools } from "./tools/ai.js";
12
+ import { registerAutomationTools } from "./tools/automations.js";
13
+ import { registerSequenceTools } from "./tools/sequences.js";
14
+ import { registerMessagingTools } from "./tools/messaging.js";
15
+ import { registerCompanyTools } from "./tools/companies.js";
16
+ import { registerTagTools } from "./tools/tags.js";
17
+ import { registerCalendarTools } from "./tools/calendar.js";
18
+ import { registerFormTools } from "./tools/forms.js";
19
+ import { registerInvoiceTools } from "./tools/invoices.js";
20
+ import { registerWebhookTools } from "./tools/webhooks.js";
21
+ import { registerNotificationTools } from "./tools/notifications.js";
22
+ import { registerCustomFieldTools } from "./tools/custom-fields.js";
23
+ import { registerSmartListTools } from "./tools/smart-lists.js";
24
+ import { registerUserTools } from "./tools/users.js";
25
+ import { registerBulkTools } from "./tools/bulk.js";
26
+ import { registerDripCampaignTools } from "./tools/drip-campaigns.js";
27
+ import { registerScoringTools } from "./tools/scoring.js";
28
+ import { registerProductTools } from "./tools/products.js";
29
+ import { registerTemplateTools } from "./tools/templates.js";
30
+ import { registerDashboardTools } from "./tools/dashboard.js";
31
+ import { registerAiExtendedTools } from "./tools/ai-extended.js";
32
+ import { registerWorkflowSandboxTools } from "./tools/workflow-sandbox.js";
33
+ const apiUrl = process.env.CONDUYT_API_URL;
34
+ const apiKey = process.env.CONDUYT_API_KEY;
35
+ if (!apiUrl || !apiKey) {
36
+ console.error("Missing required environment variables:\n" +
37
+ " CONDUYT_API_URL — Base URL (e.g. https://conduyt.app)\n" +
38
+ " CONDUYT_API_KEY — API key with cdy_ prefix\n");
39
+ process.exit(1);
40
+ }
41
+ if (!apiKey.startsWith("cdy_")) {
42
+ console.error("CONDUYT_API_KEY must start with 'cdy_' — generate one at Settings > API Keys in Conduyt.");
43
+ process.exit(1);
44
+ }
45
+ const client = new ConduytClient({ apiUrl, apiKey });
46
+ const server = new McpServer({
47
+ name: "conduyt",
48
+ version: "4.1.0",
49
+ });
50
+ registerDiscoveryTools(server, client);
51
+ registerContactTools(server, client);
52
+ registerDealTools(server, client);
53
+ registerTaskTools(server, client);
54
+ registerPipelineTools(server, client);
55
+ registerActivityTools(server, client);
56
+ registerAiTools(server, client);
57
+ registerAutomationTools(server, client);
58
+ registerSequenceTools(server, client);
59
+ registerMessagingTools(server, client);
60
+ registerCompanyTools(server, client);
61
+ registerTagTools(server, client);
62
+ registerCalendarTools(server, client);
63
+ registerFormTools(server, client);
64
+ registerInvoiceTools(server, client);
65
+ registerWebhookTools(server, client);
66
+ registerNotificationTools(server, client);
67
+ registerCustomFieldTools(server, client);
68
+ registerSmartListTools(server, client);
69
+ registerUserTools(server, client);
70
+ registerBulkTools(server, client);
71
+ registerDripCampaignTools(server, client);
72
+ registerScoringTools(server, client);
73
+ registerProductTools(server, client);
74
+ registerTemplateTools(server, client);
75
+ registerDashboardTools(server, client);
76
+ registerAiExtendedTools(server, client);
77
+ registerWorkflowSandboxTools(server, client);
78
+ const transport = new StdioServerTransport();
79
+ await server.connect(transport);
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ export declare function registerActivityTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ export function registerActivityTools(server, client) {
4
+ server.tool("conduyt_list_activities", "List recent activities across the CRM — calls, emails, notes, meetings, deal changes, and system events.", {
5
+ userId: z.string().optional().describe("Filter by user UUID who performed the activity"),
6
+ type: z.string().optional().describe("Filter by activity type (e.g. 'call', 'email', 'note', 'meeting', 'deal_stage_changed')"),
7
+ contactId: z.string().optional().describe("Filter activities for a specific contact"),
8
+ page: z.number().optional().describe("Page number (default 1)"),
9
+ per_page: z.number().optional().describe("Results per page (default 25, max 100)"),
10
+ }, async ({ userId, type, contactId, page, per_page }) => {
11
+ const params = new URLSearchParams();
12
+ if (userId)
13
+ params.set("userId", userId);
14
+ if (type)
15
+ params.set("type", type);
16
+ if (contactId)
17
+ params.set("contactId", contactId);
18
+ if (page)
19
+ params.set("page", String(page));
20
+ if (per_page)
21
+ params.set("per_page", String(per_page));
22
+ const result = await client.get(`/api/v1/activities?${params}`);
23
+ return formatResult(result);
24
+ });
25
+ server.tool("conduyt_create_activity", "Log a new activity — a call, meeting, note, or custom event. Can be linked to a contact.", {
26
+ type: z.string().describe("Activity type: 'call', 'email', 'note', 'meeting', or custom"),
27
+ title: z.string().describe("Activity title/summary"),
28
+ description: z.string().optional().describe("Detailed notes about the activity"),
29
+ contactId: z.string().optional().describe("Link to a contact UUID"),
30
+ dealId: z.string().optional().describe("Link to a deal UUID"),
31
+ }, async (params) => {
32
+ const result = await client.post("/api/v1/activities", params);
33
+ return formatResult(result);
34
+ });
35
+ }
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ export declare function registerAiExtendedTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ export function registerAiExtendedTools(server, client) {
4
+ server.tool("conduyt_ai_compose_email", "AI-powered email composition. Generates subject, body, and HTML based on contact context, deal stage, and desired tone.", {
5
+ contactName: z.string().describe("Recipient's name"),
6
+ purpose: z.string().describe("Email purpose (e.g. 'follow up on demo', 'send proposal', 'check in after purchase')"),
7
+ senderName: z.string().describe("Your name as the sender"),
8
+ companyName: z.string().describe("Your company name"),
9
+ contactEmail: z.string().optional().describe("Recipient's email"),
10
+ contactCompany: z.string().optional().describe("Recipient's company"),
11
+ contactTitle: z.string().optional().describe("Recipient's job title"),
12
+ dealStage: z.string().optional().describe("Current deal stage for context"),
13
+ dealValue: z.number().optional().describe("Deal value for context"),
14
+ previousMessages: z.string().optional().describe("Summary of previous conversation for context"),
15
+ tone: z.string().optional().describe("Desired tone (e.g. 'professional', 'friendly', 'urgent')"),
16
+ senderTitle: z.string().optional().describe("Your job title"),
17
+ }, async (params) => {
18
+ const result = await client.post("/api/v1/ai/compose-email", params);
19
+ return formatResult(result);
20
+ });
21
+ server.tool("conduyt_ai_enrich_contact", "AI-powered contact enrichment. Finds additional information about a person based on available details. Returns enriched fields like LinkedIn, Twitter, company, and job title.", {
22
+ email: z.string().optional().describe("Contact email to research"),
23
+ firstName: z.string().optional().describe("First name"),
24
+ lastName: z.string().optional().describe("Last name"),
25
+ company: z.string().optional().describe("Company name"),
26
+ jobTitle: z.string().optional().describe("Job title"),
27
+ phone: z.string().optional().describe("Phone number"),
28
+ }, async (params) => {
29
+ const result = await client.post("/api/v1/ai/enrich-contact", params);
30
+ return formatResult(result);
31
+ });
32
+ server.tool("conduyt_ai_summarize_contact", "AI-powered contact summary. Analyzes all interactions, deals, and activities to generate a summary with sentiment, key topics, and recommended next steps.", {
33
+ contactId: z.string().describe("Contact UUID to summarize"),
34
+ }, async (params) => {
35
+ const result = await client.post("/api/v1/ai/summarize-contact", params);
36
+ return formatResult(result);
37
+ });
38
+ }
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ export declare function registerAiTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ export function registerAiTools(server, client) {
4
+ server.tool("conduyt_ai_insights", "Query AI-powered CRM insights. 8 query types available: pipeline_health (deals per stage, stale deals), sms_drip_status (SMS drip overview by provider/step), sms_responses_untouched (replied contacts with no follow-up), agent_followups (per-agent task performance), email_performance (open/click/reply rates), smart_view_summary (contact counts per saved view), team_activity (per-user activity counts), contact_import_history (recent import batches).", {
5
+ type: z.enum([
6
+ "pipeline_health",
7
+ "sms_drip_status",
8
+ "sms_responses_untouched",
9
+ "agent_followups",
10
+ "email_performance",
11
+ "smart_view_summary",
12
+ "team_activity",
13
+ "contact_import_history",
14
+ ]).describe("Insight query type"),
15
+ days: z.number().optional().describe("Lookback period in days (default varies by type)"),
16
+ pipelineId: z.string().optional().describe("Pipeline UUID (for pipeline_health)"),
17
+ userId: z.string().optional().describe("User UUID (for agent_followups)"),
18
+ }, async (params) => {
19
+ const result = await client.post("/api/v1/ai/insights", params);
20
+ return formatResult(result);
21
+ });
22
+ }
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ export declare function registerAutomationTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,66 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ export function registerAutomationTools(server, client) {
4
+ server.tool("conduyt_list_automations", "List all automations (workflows) in the account. Returns name, trigger event, status, and execution counts.", {
5
+ page: z.number().optional().describe("Page number (default 1)"),
6
+ per_page: z.number().optional().describe("Results per page (default 25, max 100)"),
7
+ }, async ({ page, per_page }) => {
8
+ const params = new URLSearchParams();
9
+ if (page)
10
+ params.set("page", String(page));
11
+ if (per_page)
12
+ params.set("per_page", String(per_page));
13
+ const result = await client.get(`/api/v1/automations?${params}`);
14
+ return formatResult(result);
15
+ });
16
+ server.tool("conduyt_get_automation", "Get a single automation with full details — trigger, actions graph, schedule, and execution stats.", {
17
+ id: z.string().describe("Automation UUID"),
18
+ }, async ({ id }) => {
19
+ const result = await client.get(`/api/v1/automations/${id}`);
20
+ return formatResult(result);
21
+ });
22
+ server.tool("conduyt_create_automation", "Create a new automation. Requires a name and trigger event. Use conduyt_resolve_names to convert human-readable names to UUIDs before building actions.", {
23
+ name: z.string().describe("Automation name"),
24
+ description: z.string().optional().describe("Description of what this automation does"),
25
+ triggerEvent: z.string().describe("Trigger event (e.g. 'contact.created', 'deal.stage_changed', 'tag.added', 'scheduled')"),
26
+ kind: z.enum(["native", "n8n"]).optional().describe("Automation type — 'native' for built-in graph engine, 'n8n' for n8n webhook (default: 'n8n')"),
27
+ actions: z.any().optional().describe("Actions graph — v1: [{type, config}], v2: {nodes:[], startNodeId}"),
28
+ graphVersion: z.number().optional().describe("Graph version — 1 (legacy array) or 2 (node graph). Default 1"),
29
+ schedule: z.string().optional().describe("5-field cron expression (required if triggerEvent='scheduled')"),
30
+ scheduleTimezone: z.string().optional().describe("IANA timezone for scheduled triggers (e.g. 'America/Los_Angeles')"),
31
+ triggerConditions: z.any().optional().describe("Conditions that must match for the trigger to fire"),
32
+ }, async (params) => {
33
+ const result = await client.post("/api/v1/automations", params);
34
+ return formatResult(result);
35
+ });
36
+ server.tool("conduyt_update_automation", "Update an existing automation — change trigger, actions, schedule, or activation status.", {
37
+ id: z.string().describe("Automation UUID"),
38
+ name: z.string().optional().describe("Updated name"),
39
+ description: z.string().optional().describe("Updated description"),
40
+ triggerEvent: z.string().optional().describe("Updated trigger event"),
41
+ isActive: z.boolean().optional().describe("Enable or disable the automation"),
42
+ actions: z.any().optional().describe("Updated actions graph"),
43
+ schedule: z.string().optional().describe("Updated cron schedule"),
44
+ scheduleTimezone: z.string().optional().describe("Updated timezone"),
45
+ stopOnResponse: z.boolean().optional().describe("Stop drip if contact responds"),
46
+ }, async ({ id, ...updates }) => {
47
+ const result = await client.patch(`/api/v1/automations/${id}`, updates);
48
+ return formatResult(result);
49
+ });
50
+ server.tool("conduyt_publish_automation", "Publish an automation — copies the draft actions to the live published version. The automation must have actions defined.", {
51
+ id: z.string().describe("Automation UUID"),
52
+ }, async ({ id }) => {
53
+ const result = await client.post(`/api/v1/automations/${id}/publish`, {});
54
+ return formatResult(result);
55
+ });
56
+ server.tool("conduyt_resolve_names", "Resolve human-readable names to UUIDs. Use this before creating automations — converts tag names, pipeline names, user names, and custom field labels to their UUIDs.", {
57
+ tags: z.array(z.string()).optional().describe("Tag names to resolve (e.g. ['new-lead', 'hot'])"),
58
+ pipelines: z.array(z.string()).optional().describe("Pipeline names to resolve (e.g. ['Sales Pipeline'])"),
59
+ stages: z.array(z.string()).optional().describe("Stage names to resolve (e.g. ['New Lead', 'Qualified'])"),
60
+ users: z.array(z.string()).optional().describe("User full names or emails to resolve"),
61
+ customFields: z.array(z.string()).optional().describe("Custom field keys or labels to resolve"),
62
+ }, async (params) => {
63
+ const result = await client.post("/api/v1/automations/resolve", params);
64
+ return formatResult(result);
65
+ });
66
+ }
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ export declare function registerBulkTools(server: McpServer, client: ConduytClient): void;