@launchpath-ai/mcp-server 1.0.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 +94 -0
- package/build/client.d.ts +38 -0
- package/build/client.js +210 -0
- package/build/client.js.map +1 -0
- package/build/index.d.ts +12 -0
- package/build/index.js +374 -0
- package/build/index.js.map +1 -0
- package/build/tools/agents.d.ts +6 -0
- package/build/tools/agents.js +249 -0
- package/build/tools/agents.js.map +1 -0
- package/build/tools/analytics.d.ts +7 -0
- package/build/tools/analytics.js +282 -0
- package/build/tools/analytics.js.map +1 -0
- package/build/tools/campaigns.d.ts +6 -0
- package/build/tools/campaigns.js +158 -0
- package/build/tools/campaigns.js.map +1 -0
- package/build/tools/channels.d.ts +7 -0
- package/build/tools/channels.js +319 -0
- package/build/tools/channels.js.map +1 -0
- package/build/tools/clients.d.ts +6 -0
- package/build/tools/clients.js +138 -0
- package/build/tools/clients.js.map +1 -0
- package/build/tools/composio.d.ts +6 -0
- package/build/tools/composio.js +188 -0
- package/build/tools/composio.js.map +1 -0
- package/build/tools/core.d.ts +6 -0
- package/build/tools/core.js +130 -0
- package/build/tools/core.js.map +1 -0
- package/build/tools/integrations.d.ts +6 -0
- package/build/tools/integrations.js +188 -0
- package/build/tools/integrations.js.map +1 -0
- package/build/tools/knowledge.d.ts +7 -0
- package/build/tools/knowledge.js +274 -0
- package/build/tools/knowledge.js.map +1 -0
- package/build/tools/portal.d.ts +6 -0
- package/build/tools/portal.js +86 -0
- package/build/tools/portal.js.map +1 -0
- package/build/tools/tools-config.d.ts +6 -0
- package/build/tools/tools-config.js +213 -0
- package/build/tools/tools-config.js.map +1 -0
- package/build/tools/whatsapp.d.ts +7 -0
- package/build/tools/whatsapp.js +399 -0
- package/build/tools/whatsapp.js.map +1 -0
- package/build/types.d.ts +87 -0
- package/build/types.js +3 -0
- package/build/types.js.map +1 -0
- package/package.json +44 -0
- package/plugin.json +28 -0
- package/skills/agent-report/SKILL.md +44 -0
- package/skills/deploy-agent/SKILL.md +74 -0
- package/skills/launchpath-guide/SKILL.md +60 -0
- package/skills/setup-client/SKILL.md +44 -0
- package/skills/whatsapp-campaign/SKILL.md +72 -0
package/build/index.js
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* LaunchPath MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Manage AI agents, knowledge bases, deployments, clients, and campaigns
|
|
6
|
+
* from Claude Code, Claude Desktop, or any MCP-compatible client.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* LAUNCHPATH_API_KEY=lp_key_xxx npx @launchpath/mcp-server
|
|
10
|
+
* LAUNCHPATH_API_KEY=lp_key_xxx LAUNCHPATH_BASE_URL=http://localhost:3000 npx @launchpath/mcp-server
|
|
11
|
+
*/
|
|
12
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
13
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import { LaunchPathClient } from "./client.js";
|
|
16
|
+
// --- Tool registration imports ---
|
|
17
|
+
import { registerCoreTools } from "./tools/core.js";
|
|
18
|
+
import { registerAgentManagementTools } from "./tools/agents.js";
|
|
19
|
+
import { registerKnowledgeTools } from "./tools/knowledge.js";
|
|
20
|
+
import { registerDeploymentTools } from "./tools/channels.js";
|
|
21
|
+
import { registerClientTools } from "./tools/clients.js";
|
|
22
|
+
import { registerCampaignTools } from "./tools/campaigns.js";
|
|
23
|
+
import { registerWhatsAppTools } from "./tools/whatsapp.js";
|
|
24
|
+
import { registerAnalyticsTools } from "./tools/analytics.js";
|
|
25
|
+
import { registerToolsConfigTools } from "./tools/tools-config.js";
|
|
26
|
+
import { registerPortalTools } from "./tools/portal.js";
|
|
27
|
+
import { registerIntegrationTools } from "./tools/integrations.js";
|
|
28
|
+
// ─── Configuration ───────────────────────────────────────────────────────────
|
|
29
|
+
const API_KEY = process.env.LAUNCHPATH_API_KEY;
|
|
30
|
+
const BASE_URL = process.env.LAUNCHPATH_BASE_URL || "https://app.launchpath.ai";
|
|
31
|
+
if (!API_KEY) {
|
|
32
|
+
console.error("Error: LAUNCHPATH_API_KEY environment variable is required.\n" +
|
|
33
|
+
"Get your API key from LaunchPath → Settings → API Keys.\n" +
|
|
34
|
+
"Set it: export LAUNCHPATH_API_KEY=lp_key_xxx");
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
const client = new LaunchPathClient({ apiKey: API_KEY, baseUrl: BASE_URL });
|
|
38
|
+
// ─── Server Instructions ─────────────────────────────────────────────────────
|
|
39
|
+
// Injected into the model's system prompt. Guides cross-tool behavior.
|
|
40
|
+
const SERVER_INSTRUCTIONS = `LaunchPath is an AI agent deployment platform. You can create, train, deploy, and manage AI agents for businesses — entirely from the terminal.
|
|
41
|
+
|
|
42
|
+
## Core Workflow
|
|
43
|
+
1. **Create** an agent: use create_agent (blank) or create_agent_from_prompt (AI-generated from a description)
|
|
44
|
+
2. **Train** it: use discover_pages to find all pages on a site, scrape_website to add content, generate_faqs to auto-create Q&A pairs, and add_faq for manual Q&A pairs
|
|
45
|
+
3. **Add integrations**: use enable_toolset("integrations") to browse 900+ apps, then enable_toolset("tools-config") to add tools to the agent
|
|
46
|
+
4. **Test** it: use chat_with_agent to send test messages — this works without deploying
|
|
47
|
+
5. **Deploy** (only when the user asks): deploy to a website widget, WhatsApp, or API channel
|
|
48
|
+
6. **Manage clients**: use create_client + create_campaign to assign agents to client businesses
|
|
49
|
+
|
|
50
|
+
## Key Rules
|
|
51
|
+
- Always call list_agents first if you need an agent_id
|
|
52
|
+
- Always call list_clients first if you need a client_id
|
|
53
|
+
- Use get_agent to read current config before calling update_agent
|
|
54
|
+
- After making changes, use chat_with_agent to verify the agent works correctly
|
|
55
|
+
- Use discover_pages before scrape_website for full-site coverage
|
|
56
|
+
- After scraping, use generate_faqs to auto-create Q&A pairs, then edit_faq to refine them or add_faq for manual additions
|
|
57
|
+
- Do NOT deploy unless the user explicitly asks. Testing with chat_with_agent does not require deployment.
|
|
58
|
+
|
|
59
|
+
## Deploying Channels
|
|
60
|
+
Only deploy when the user requests it. First call enable_toolset("deployment") to load channel tools.
|
|
61
|
+
|
|
62
|
+
### Website Widget
|
|
63
|
+
1. deploy_channel(agent_id, channel_type: "widget") — creates the widget
|
|
64
|
+
2. configure_widget — customize colors, theme, position, avatar, welcome message, conversation starters, pre-chat form
|
|
65
|
+
3. get_embed_code — get the HTML snippet to paste on a website
|
|
66
|
+
|
|
67
|
+
### WhatsApp
|
|
68
|
+
WhatsApp requires Meta Business credentials that must be entered in the LaunchPath dashboard (not via terminal).
|
|
69
|
+
1. enable_toolset("campaigns") + enable_toolset("whatsapp")
|
|
70
|
+
2. create_campaign(agent_id, client_id, channel_type: "whatsapp") — creates a campaign with a placeholder WhatsApp channel
|
|
71
|
+
3. Tell the user: "Enter your Meta credentials (Phone Number ID, Access Token, Business Account ID, App Secret) at ${BASE_URL}/dashboard/campaigns/<campaign_id>"
|
|
72
|
+
4. Once credentials are saved, use the whatsapp toolset: create templates → import contacts → send broadcasts or create drip sequences
|
|
73
|
+
|
|
74
|
+
### API Channel
|
|
75
|
+
1. deploy_channel(agent_id, channel_type: "api") — creates an API endpoint with a bearer token
|
|
76
|
+
2. The response includes the public chat endpoint URL and authentication details
|
|
77
|
+
3. Use this to build custom chat UIs, integrate with other apps, or connect to any platform
|
|
78
|
+
|
|
79
|
+
## Adding Integrations
|
|
80
|
+
When the user wants their agent to use external services (Google Calendar, Gmail, Slack, Sheets, etc.):
|
|
81
|
+
|
|
82
|
+
1. Load the integrations toolset: enable_toolset("integrations")
|
|
83
|
+
2. Search for the app: browse_integrations(search: "calendar")
|
|
84
|
+
3. See available actions: list_app_actions(toolkit: "googlecalendar")
|
|
85
|
+
4. Check if connected: check_connections()
|
|
86
|
+
5. If NOT connected: tell the user to open ${BASE_URL}/dashboard/settings/integrations in their browser to connect the app. OAuth requires a browser — it cannot be done from the terminal.
|
|
87
|
+
6. Once connected: load tools-config toolset, then add_agent_tool with the correct toolkit slug and action names
|
|
88
|
+
7. Update the agent's tool_guidelines with usage instructions for the new tools
|
|
89
|
+
|
|
90
|
+
IMPORTANT: Integrations that require OAuth (Google, Slack, GitHub, etc.) MUST be connected via the LaunchPath dashboard first. Always check connections before adding tools. If a tool is added without a connection, it will fail at runtime. Direct the user to: ${BASE_URL}/dashboard/settings/integrations
|
|
91
|
+
|
|
92
|
+
## Toolset System
|
|
93
|
+
By default you have access to: agent management and knowledge tools.
|
|
94
|
+
All other toolsets are loaded on demand — call enable_toolset when you need them:
|
|
95
|
+
- **deployment**: Deploy to widget, WhatsApp, or API channels — manage channels, appearance, embed code
|
|
96
|
+
- **clients**: Manage client businesses — create clients, assign agents
|
|
97
|
+
- **campaigns**: Manage client campaigns (list, create, update)
|
|
98
|
+
- **whatsapp**: WhatsApp templates, broadcasts, contacts, drip sequences
|
|
99
|
+
- **analytics**: Agent metrics, conversations, broadcast results, sequence performance, channel health
|
|
100
|
+
- **tools-config**: Manage agent tool integrations — add, edit, enable/disable, remove (webhooks, APIs, app integrations)
|
|
101
|
+
- **portal**: Client portal invites and branding
|
|
102
|
+
- **integrations**: Browse 900+ app integrations, list actions, check user connections
|
|
103
|
+
|
|
104
|
+
Load a toolset when the user mentions its domain (e.g., "deploy my agent" → enable_toolset("deployment"), "set up a WhatsApp campaign" → enable_toolset("campaigns") + enable_toolset("whatsapp"), "add Google Calendar" → enable_toolset("integrations"), "manage clients" → enable_toolset("clients")).
|
|
105
|
+
|
|
106
|
+
When you're done with a toolset and moving to a different domain, use disable_toolset to unload it. This keeps your active tool count low, which improves response quality and reduces token overhead. For example, after finishing WhatsApp setup, call disable_toolset("whatsapp") + disable_toolset("campaigns") before starting widget deployment.
|
|
107
|
+
|
|
108
|
+
## Rate Limits
|
|
109
|
+
- 60 requests per minute across all tools
|
|
110
|
+
- Long-running operations (scrape_website, create_agent_from_prompt) may take 10-30 seconds
|
|
111
|
+
|
|
112
|
+
## Models
|
|
113
|
+
- Slash-prefixed IDs use OpenRouter (e.g., "openai/gpt-4o-mini")
|
|
114
|
+
- Bare IDs use direct Anthropic (e.g., "claude-sonnet-4-5-20250929")
|
|
115
|
+
- Default model for new agents: "openai/gpt-4o-mini" (most cost-effective)`;
|
|
116
|
+
// ─── Server Setup ────────────────────────────────────────────────────────────
|
|
117
|
+
const server = new McpServer({
|
|
118
|
+
name: "launchpath",
|
|
119
|
+
version: "1.0.0",
|
|
120
|
+
}, {
|
|
121
|
+
instructions: SERVER_INSTRUCTIONS,
|
|
122
|
+
capabilities: {
|
|
123
|
+
tools: {},
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
// ─── Track loaded toolsets ───────────────────────────────────────────────────
|
|
127
|
+
const loadedToolsets = new Set(["core", "agent-management", "knowledge"]);
|
|
128
|
+
const toolsetRefs = new Map();
|
|
129
|
+
/**
|
|
130
|
+
* Call a register function and capture all RegisteredTool references it creates.
|
|
131
|
+
* Uses a temporary wrapper around server.registerTool to intercept return values.
|
|
132
|
+
*/
|
|
133
|
+
function registerAndCapture(name, registerFn) {
|
|
134
|
+
const refs = [];
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
136
|
+
const original = server.registerTool.bind(server);
|
|
137
|
+
// Temporarily wrap to capture each returned RegisteredTool
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
|
+
server.registerTool = (...args) => {
|
|
140
|
+
const registered = original(...args);
|
|
141
|
+
refs.push(registered);
|
|
142
|
+
return registered;
|
|
143
|
+
};
|
|
144
|
+
registerFn();
|
|
145
|
+
// Restore original
|
|
146
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
147
|
+
server.registerTool = original;
|
|
148
|
+
toolsetRefs.set(name, refs);
|
|
149
|
+
}
|
|
150
|
+
const availableToolsets = {
|
|
151
|
+
deployment: {
|
|
152
|
+
description: "Deploy agents to website widget, WhatsApp, or API channels — manage channels, widget appearance, and embed code",
|
|
153
|
+
isDefault: false,
|
|
154
|
+
register: () => registerDeploymentTools(server, client),
|
|
155
|
+
},
|
|
156
|
+
clients: {
|
|
157
|
+
description: "Manage client businesses — create clients, assign agents via campaigns",
|
|
158
|
+
isDefault: false,
|
|
159
|
+
register: () => registerClientTools(server, client),
|
|
160
|
+
},
|
|
161
|
+
campaigns: {
|
|
162
|
+
description: "Manage client campaigns — list, get, create, update campaigns that link agents to clients",
|
|
163
|
+
isDefault: false,
|
|
164
|
+
register: () => registerCampaignTools(server, client),
|
|
165
|
+
},
|
|
166
|
+
whatsapp: {
|
|
167
|
+
description: "WhatsApp Business tools — message templates, broadcasts, contact management, drip sequences",
|
|
168
|
+
isDefault: false,
|
|
169
|
+
register: () => registerWhatsAppTools(server, client),
|
|
170
|
+
},
|
|
171
|
+
analytics: {
|
|
172
|
+
description: "Analytics and monitoring — agent metrics, conversations, broadcast results, sequence performance, channel activity and health",
|
|
173
|
+
isDefault: false,
|
|
174
|
+
register: () => registerAnalyticsTools(server, client),
|
|
175
|
+
},
|
|
176
|
+
"tools-config": {
|
|
177
|
+
description: "Manage agent tool integrations — add, edit, enable/disable, remove webhooks, HTTP APIs, app integrations, subagents",
|
|
178
|
+
isDefault: false,
|
|
179
|
+
register: () => registerToolsConfigTools(server, client),
|
|
180
|
+
},
|
|
181
|
+
portal: {
|
|
182
|
+
description: "Client portal management — invite members, customize branding/white-label",
|
|
183
|
+
isDefault: false,
|
|
184
|
+
register: () => registerPortalTools(server, client),
|
|
185
|
+
},
|
|
186
|
+
integrations: {
|
|
187
|
+
description: "Browse 900+ app integrations (Google Calendar, Gmail, Slack, etc.), list available actions, and check which apps the user has connected",
|
|
188
|
+
isDefault: false,
|
|
189
|
+
register: () => registerIntegrationTools(server, client),
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
// ─── Register default tools ──────────────────────────────────────────────────
|
|
193
|
+
registerAndCapture("core", () => registerCoreTools(server, client));
|
|
194
|
+
registerAndCapture("agent-management", () => registerAgentManagementTools(server, client));
|
|
195
|
+
registerAndCapture("knowledge", () => registerKnowledgeTools(server, client));
|
|
196
|
+
// ─── enable_toolset meta tool ────────────────────────────────────────────────
|
|
197
|
+
server.registerTool("enable_toolset", {
|
|
198
|
+
title: "Enable Toolset",
|
|
199
|
+
description: "Load additional tools on demand, or re-enable a previously disabled toolset. Available: deployment, clients, campaigns, whatsapp, analytics, tools-config, portal, integrations.",
|
|
200
|
+
inputSchema: {
|
|
201
|
+
toolset: z
|
|
202
|
+
.enum(["deployment", "clients", "campaigns", "whatsapp", "analytics", "tools-config", "portal", "integrations"])
|
|
203
|
+
.describe("Name of the toolset to enable"),
|
|
204
|
+
},
|
|
205
|
+
}, async ({ toolset }) => {
|
|
206
|
+
// Re-enable a previously disabled toolset
|
|
207
|
+
if (loadedToolsets.has(toolset)) {
|
|
208
|
+
const refs = toolsetRefs.get(toolset);
|
|
209
|
+
const allEnabled = !refs || refs.every((r) => r.enabled);
|
|
210
|
+
if (allEnabled) {
|
|
211
|
+
return {
|
|
212
|
+
content: [
|
|
213
|
+
{
|
|
214
|
+
type: "text",
|
|
215
|
+
text: `Toolset "${toolset}" is already loaded and active. You can use its tools now.`,
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
// Re-enable disabled tools
|
|
221
|
+
for (const ref of refs ?? [])
|
|
222
|
+
ref.enable();
|
|
223
|
+
// Fall through to show the tool list
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
const info = availableToolsets[toolset];
|
|
227
|
+
if (!info) {
|
|
228
|
+
const available = Object.keys(availableToolsets).join(", ");
|
|
229
|
+
return {
|
|
230
|
+
isError: true,
|
|
231
|
+
content: [
|
|
232
|
+
{
|
|
233
|
+
type: "text",
|
|
234
|
+
text: `Unknown toolset "${toolset}". Available: ${available}`,
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
registerAndCapture(toolset, () => info.register());
|
|
240
|
+
loadedToolsets.add(toolset);
|
|
241
|
+
}
|
|
242
|
+
// List the newly available tools based on toolset
|
|
243
|
+
const toolNames = {
|
|
244
|
+
deployment: [
|
|
245
|
+
"list_channels",
|
|
246
|
+
"deploy_channel",
|
|
247
|
+
"delete_channel",
|
|
248
|
+
"update_channel",
|
|
249
|
+
"configure_widget",
|
|
250
|
+
"get_embed_code",
|
|
251
|
+
],
|
|
252
|
+
clients: ["list_clients", "get_client", "create_client", "update_client"],
|
|
253
|
+
campaigns: ["list_campaigns", "get_campaign", "create_campaign", "update_campaign"],
|
|
254
|
+
whatsapp: [
|
|
255
|
+
"list_wa_templates",
|
|
256
|
+
"create_wa_template",
|
|
257
|
+
"send_wa_broadcast",
|
|
258
|
+
"list_wa_contacts",
|
|
259
|
+
"import_wa_contacts",
|
|
260
|
+
"create_wa_sequence",
|
|
261
|
+
"activate_wa_sequence",
|
|
262
|
+
"enroll_wa_contacts",
|
|
263
|
+
],
|
|
264
|
+
analytics: [
|
|
265
|
+
"get_agent_analytics",
|
|
266
|
+
"list_conversations",
|
|
267
|
+
"get_conversation",
|
|
268
|
+
"list_send_jobs",
|
|
269
|
+
"get_sequence_stats",
|
|
270
|
+
"get_sequence_detail",
|
|
271
|
+
"get_channel_activity",
|
|
272
|
+
"get_channel_health",
|
|
273
|
+
],
|
|
274
|
+
"tools-config": [
|
|
275
|
+
"list_agent_tools",
|
|
276
|
+
"add_agent_tool",
|
|
277
|
+
"update_agent_tool",
|
|
278
|
+
"remove_agent_tool",
|
|
279
|
+
"test_agent_tool",
|
|
280
|
+
],
|
|
281
|
+
portal: ["invite_client_member", "update_portal_branding"],
|
|
282
|
+
integrations: ["browse_integrations", "list_app_actions", "check_connections"],
|
|
283
|
+
};
|
|
284
|
+
const tools = toolNames[toolset] ?? [];
|
|
285
|
+
let text = `Toolset "${toolset}" enabled. New tools available:\n${tools.map((t) => ` - ${t}`).join("\n")}`;
|
|
286
|
+
// Add contextual guidance per toolset
|
|
287
|
+
const toolsetHints = {
|
|
288
|
+
deployment: `\n\nUse deploy_channel to create a widget, WhatsApp, or API channel.\nFor widgets: configure_widget to customize appearance + content, then get_embed_code.\nFor WhatsApp: use enable_toolset("campaigns") + enable_toolset("whatsapp") instead.`,
|
|
289
|
+
clients: `\n\nUse list_clients to see existing clients, create_client to add new ones.\nAfter creating a client, use enable_toolset("campaigns") to create campaigns linking agents to clients.`,
|
|
290
|
+
integrations: `\n\nStart by searching for an app: browse_integrations(search: "calendar")\nThen check user connections: check_connections()`,
|
|
291
|
+
"tools-config": `\n\nUse list_agent_tools(agent_id) to see current tools on an agent.\nUse add_agent_tool to add new integrations, update_agent_tool to edit config or enable/disable.`,
|
|
292
|
+
whatsapp: `\n\nIMPORTANT: WhatsApp templates require Meta approval (1-24 hours). Create templates first, then check status before broadcasting.\nFlow: create templates → import contacts → check template status (list_wa_templates) → send broadcasts OR create sequence → activate_wa_sequence → enroll_wa_contacts.\nVariable mapping: use { "1": "name", "2": "custom_fields.company" } to personalize messages per contact.`,
|
|
293
|
+
campaigns: `\n\nA campaign links an agent to a client. Create a client first, then create a campaign.`,
|
|
294
|
+
analytics: `\n\nUse get_agent_analytics for high-level metrics, list_conversations for history (filterable by campaign_id, channel_type, status, or search).\nFor WhatsApp: list_send_jobs for broadcast delivery results, get_sequence_stats + get_sequence_detail for drip campaign performance.\nFor debugging: get_channel_activity for event logs, get_channel_health to check if a channel is working.`,
|
|
295
|
+
portal: `\n\nUse invite_client_member to give clients access to their portal. Use update_portal_branding to white-label it.`,
|
|
296
|
+
};
|
|
297
|
+
if (toolsetHints[toolset]) {
|
|
298
|
+
text += toolsetHints[toolset];
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
content: [
|
|
302
|
+
{
|
|
303
|
+
type: "text",
|
|
304
|
+
text,
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
};
|
|
308
|
+
});
|
|
309
|
+
// ─── disable_toolset meta tool ───────────────────────────────────────────────
|
|
310
|
+
server.registerTool("disable_toolset", {
|
|
311
|
+
title: "Disable Toolset",
|
|
312
|
+
description: "Unload a previously enabled toolset to reduce clutter and improve performance. The tools become invisible until re-enabled with enable_toolset. Cannot disable default toolsets (core, agent-management, knowledge).",
|
|
313
|
+
inputSchema: {
|
|
314
|
+
toolset: z
|
|
315
|
+
.enum(["deployment", "clients", "campaigns", "whatsapp", "analytics", "tools-config", "portal", "integrations"])
|
|
316
|
+
.describe("Name of the toolset to disable"),
|
|
317
|
+
},
|
|
318
|
+
}, async ({ toolset }) => {
|
|
319
|
+
const refs = toolsetRefs.get(toolset);
|
|
320
|
+
if (!refs || !loadedToolsets.has(toolset)) {
|
|
321
|
+
return {
|
|
322
|
+
isError: true,
|
|
323
|
+
content: [
|
|
324
|
+
{
|
|
325
|
+
type: "text",
|
|
326
|
+
text: `Toolset "${toolset}" is not currently loaded. Nothing to disable.`,
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
const alreadyDisabled = refs.every((r) => !r.enabled);
|
|
332
|
+
if (alreadyDisabled) {
|
|
333
|
+
return {
|
|
334
|
+
content: [
|
|
335
|
+
{
|
|
336
|
+
type: "text",
|
|
337
|
+
text: `Toolset "${toolset}" is already disabled.`,
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
for (const ref of refs)
|
|
343
|
+
ref.disable();
|
|
344
|
+
const toolNames = {
|
|
345
|
+
deployment: ["list_channels", "deploy_channel", "delete_channel", "update_channel", "configure_widget", "get_embed_code"],
|
|
346
|
+
clients: ["list_clients", "get_client", "create_client", "update_client"],
|
|
347
|
+
campaigns: ["list_campaigns", "get_campaign", "create_campaign", "update_campaign"],
|
|
348
|
+
whatsapp: ["list_wa_templates", "create_wa_template", "send_wa_broadcast", "list_wa_contacts", "import_wa_contacts", "create_wa_sequence", "activate_wa_sequence", "enroll_wa_contacts"],
|
|
349
|
+
analytics: ["get_agent_analytics", "list_conversations", "get_conversation", "list_send_jobs", "get_sequence_stats", "get_sequence_detail", "get_channel_activity", "get_channel_health"],
|
|
350
|
+
"tools-config": ["list_agent_tools", "add_agent_tool", "update_agent_tool", "remove_agent_tool", "test_agent_tool"],
|
|
351
|
+
portal: ["invite_client_member", "update_portal_branding"],
|
|
352
|
+
integrations: ["browse_integrations", "list_app_actions", "check_connections"],
|
|
353
|
+
};
|
|
354
|
+
const tools = toolNames[toolset] ?? [];
|
|
355
|
+
return {
|
|
356
|
+
content: [
|
|
357
|
+
{
|
|
358
|
+
type: "text",
|
|
359
|
+
text: `Toolset "${toolset}" disabled. ${tools.length} tools hidden:\n${tools.map((t) => ` - ${t}`).join("\n")}\n\nUse enable_toolset("${toolset}") to re-enable them.`,
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
};
|
|
363
|
+
});
|
|
364
|
+
// ─── Start server ────────────────────────────────────────────────────────────
|
|
365
|
+
async function main() {
|
|
366
|
+
const transport = new StdioServerTransport();
|
|
367
|
+
await server.connect(transport);
|
|
368
|
+
console.error("LaunchPath MCP Server running on stdio");
|
|
369
|
+
}
|
|
370
|
+
main().catch((err) => {
|
|
371
|
+
console.error("Failed to start LaunchPath MCP Server:", err);
|
|
372
|
+
process.exit(1);
|
|
373
|
+
});
|
|
374
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,oCAAoC;AACpC,OAAO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EAAE,CAAC;IAEvC,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,YAAY,OAAO,eAAe,KAAK,CAAC,MAAM,mBAAmB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,2BAA2B,OAAO,uBAAuB;aACxK;SACF;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gFAAgF;AAEhF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC1D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,GAAG,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Management toolset (default) — create, create_from_prompt, update, delete
|
|
3
|
+
*/
|
|
4
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
import type { LaunchPathClient } from "../client.js";
|
|
6
|
+
export declare function registerAgentManagementTools(server: McpServer, client: LaunchPathClient): void;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Management toolset (default) — create, create_from_prompt, update, delete
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { formatError } from "../client.js";
|
|
6
|
+
export function registerAgentManagementTools(server, client) {
|
|
7
|
+
// --- create_agent ---
|
|
8
|
+
server.registerTool("create_agent", {
|
|
9
|
+
title: "Create Agent",
|
|
10
|
+
description: "Create a new blank agent. Use this for manual configuration. For AI-generated agents, use create_agent_from_prompt instead.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
name: z.string().describe("Agent name"),
|
|
13
|
+
description: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Short description of what the agent does"),
|
|
17
|
+
},
|
|
18
|
+
annotations: {
|
|
19
|
+
destructiveHint: false,
|
|
20
|
+
idempotentHint: false,
|
|
21
|
+
},
|
|
22
|
+
}, async ({ name, description }) => {
|
|
23
|
+
const res = await client.post("/api/agents/create-blank", {
|
|
24
|
+
name,
|
|
25
|
+
description,
|
|
26
|
+
});
|
|
27
|
+
if (res.error) {
|
|
28
|
+
return {
|
|
29
|
+
isError: true,
|
|
30
|
+
content: [{ type: "text", text: formatError(res.error, res.status) }],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const agentData = res.data;
|
|
34
|
+
let text = `Agent created successfully.\n\n${JSON.stringify(res.data, null, 2)}`;
|
|
35
|
+
text += `\n\n## Next Steps`;
|
|
36
|
+
text += `\n1. **Add knowledge** — use scrape_website to add website content, or add_faq for Q&A pairs`;
|
|
37
|
+
text += `\n2. **Add integrations** — use enable_toolset("composio") to browse and add tools like Google Calendar, Gmail, etc.`;
|
|
38
|
+
text += `\n3. **Configure** — use update_agent to set the system prompt, personality, and greeting`;
|
|
39
|
+
text += `\n4. **Deploy** — use deploy_channel to create a website widget or API endpoint`;
|
|
40
|
+
text += `\n5. **Test** — use chat_with_agent to verify it works correctly`;
|
|
41
|
+
if (agentData?.agentId) {
|
|
42
|
+
text += `\n\nDashboard: ${client.dashboardUrl}/dashboard/agents/${agentData.agentId}`;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
content: [{ type: "text", text }],
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
// --- create_agent_from_prompt ---
|
|
49
|
+
server.registerTool("create_agent_from_prompt", {
|
|
50
|
+
title: "Create Agent from Prompt",
|
|
51
|
+
description: "AI-generate an agent from a natural language description. Creates the agent with an optimized system prompt, personality, greeting, and suggested tools. Takes 10-30 seconds.",
|
|
52
|
+
inputSchema: {
|
|
53
|
+
prompt: z
|
|
54
|
+
.string()
|
|
55
|
+
.describe("Natural language description of the agent. Be specific about the business, role, and behavior. Example: 'A customer support bot for a dental practice that answers questions about services, pricing, and scheduling.'"),
|
|
56
|
+
name: z
|
|
57
|
+
.string()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe("Override the AI-generated agent name"),
|
|
60
|
+
website_url: z
|
|
61
|
+
.string()
|
|
62
|
+
.optional()
|
|
63
|
+
.describe("URL to scrape for context. The AI will use this to understand the business."),
|
|
64
|
+
},
|
|
65
|
+
annotations: {
|
|
66
|
+
destructiveHint: false,
|
|
67
|
+
idempotentHint: false,
|
|
68
|
+
},
|
|
69
|
+
}, async ({ prompt, name, website_url }) => {
|
|
70
|
+
const body = { prompt };
|
|
71
|
+
if (name)
|
|
72
|
+
body.name = name;
|
|
73
|
+
if (website_url)
|
|
74
|
+
body.websiteUrl = website_url;
|
|
75
|
+
const res = await client.consumeSSE("POST", "/api/agents/generate", body);
|
|
76
|
+
if (res.error) {
|
|
77
|
+
return {
|
|
78
|
+
isError: true,
|
|
79
|
+
content: [
|
|
80
|
+
{
|
|
81
|
+
type: "text",
|
|
82
|
+
text: formatError(res.error, res.status, "Agent generation may have timed out. Try a shorter prompt or retry."),
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
let text = `Agent generated successfully.\n\n${res.data?.text ?? ""}`;
|
|
88
|
+
text += `\n\n## Next Steps`;
|
|
89
|
+
text += `\n1. **Add knowledge** — use discover_pages to find pages on the business website, then scrape_website for each important page`;
|
|
90
|
+
text += `\n2. **Generate FAQs** — after scraping, use generate_faqs to auto-create Q&A pairs from the content`;
|
|
91
|
+
text += `\n3. **Add integrations** — if the agent needs tools (calendar booking, email, etc.), use enable_toolset("composio") to browse and add them`;
|
|
92
|
+
text += `\n4. **Deploy** — use deploy_channel(channel_type: "widget") to create a website chat widget`;
|
|
93
|
+
text += `\n5. **Test** — use chat_with_agent to send test messages and verify quality`;
|
|
94
|
+
return {
|
|
95
|
+
content: [{ type: "text", text }],
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
// --- update_agent ---
|
|
99
|
+
server.registerTool("update_agent", {
|
|
100
|
+
title: "Update Agent",
|
|
101
|
+
description: "Update any agent configuration field: name, system prompt, personality, model, greeting, tool guidelines, or status. Use get_agent first to see current values.",
|
|
102
|
+
inputSchema: {
|
|
103
|
+
agent_id: z.string().describe("The agent's UUID"),
|
|
104
|
+
name: z.string().optional().describe("New agent name"),
|
|
105
|
+
description: z.string().optional().describe("New description"),
|
|
106
|
+
system_prompt: z
|
|
107
|
+
.string()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe("New system prompt — the core instructions for the agent"),
|
|
110
|
+
personality: z
|
|
111
|
+
.string()
|
|
112
|
+
.optional()
|
|
113
|
+
.describe("Personality traits (e.g., friendly, professional, concise)"),
|
|
114
|
+
model: z
|
|
115
|
+
.string()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe('Model ID. Use slash-prefix for OpenRouter (e.g., "openai/gpt-4o-mini") or bare for Anthropic (e.g., "claude-sonnet-4-5-20250929")'),
|
|
118
|
+
greeting: z
|
|
119
|
+
.string()
|
|
120
|
+
.optional()
|
|
121
|
+
.describe("Initial greeting message shown to users"),
|
|
122
|
+
tool_guidelines: z
|
|
123
|
+
.string()
|
|
124
|
+
.optional()
|
|
125
|
+
.describe("Instructions for how the agent should use its tools"),
|
|
126
|
+
status: z
|
|
127
|
+
.enum(["active", "draft", "archived"])
|
|
128
|
+
.optional()
|
|
129
|
+
.describe("Agent status"),
|
|
130
|
+
},
|
|
131
|
+
annotations: {
|
|
132
|
+
destructiveHint: false,
|
|
133
|
+
idempotentHint: true,
|
|
134
|
+
},
|
|
135
|
+
}, async ({ agent_id, name, description, system_prompt, personality, model, greeting, tool_guidelines, status, }) => {
|
|
136
|
+
const body = {};
|
|
137
|
+
if (name !== undefined)
|
|
138
|
+
body.name = name;
|
|
139
|
+
if (description !== undefined)
|
|
140
|
+
body.description = description;
|
|
141
|
+
if (system_prompt !== undefined)
|
|
142
|
+
body.system_prompt = system_prompt;
|
|
143
|
+
if (personality !== undefined)
|
|
144
|
+
body.personality = personality;
|
|
145
|
+
if (model !== undefined)
|
|
146
|
+
body.model = model;
|
|
147
|
+
if (greeting !== undefined)
|
|
148
|
+
body.greeting = greeting;
|
|
149
|
+
if (tool_guidelines !== undefined)
|
|
150
|
+
body.tool_guidelines = tool_guidelines;
|
|
151
|
+
if (status !== undefined)
|
|
152
|
+
body.status = status;
|
|
153
|
+
if (Object.keys(body).length === 0) {
|
|
154
|
+
return {
|
|
155
|
+
isError: true,
|
|
156
|
+
content: [
|
|
157
|
+
{
|
|
158
|
+
type: "text",
|
|
159
|
+
text: "No fields to update. Provide at least one field to change.",
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const res = await client.patch(`/api/agents/${agent_id}`, body);
|
|
165
|
+
if (res.error) {
|
|
166
|
+
return {
|
|
167
|
+
isError: true,
|
|
168
|
+
content: [
|
|
169
|
+
{
|
|
170
|
+
type: "text",
|
|
171
|
+
text: formatError(res.error, res.status, "Use list_agents to verify the agent_id."),
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
content: [
|
|
178
|
+
{
|
|
179
|
+
type: "text",
|
|
180
|
+
text: `Agent updated successfully.\n\n${JSON.stringify(res.data, null, 2)}`,
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
// --- clone_agent ---
|
|
186
|
+
server.registerTool("clone_agent", {
|
|
187
|
+
title: "Clone Agent",
|
|
188
|
+
description: "Create a full copy of an agent including its configuration, tools, knowledge base, and embeddings. The clone is independent — changes to one don't affect the other.",
|
|
189
|
+
inputSchema: {
|
|
190
|
+
agent_id: z.string().describe("The agent's UUID to clone"),
|
|
191
|
+
},
|
|
192
|
+
annotations: {
|
|
193
|
+
destructiveHint: false,
|
|
194
|
+
idempotentHint: false,
|
|
195
|
+
},
|
|
196
|
+
}, async ({ agent_id }) => {
|
|
197
|
+
const res = await client.post(`/api/agents/${agent_id}/clone`);
|
|
198
|
+
if (res.error) {
|
|
199
|
+
return {
|
|
200
|
+
isError: true,
|
|
201
|
+
content: [
|
|
202
|
+
{
|
|
203
|
+
type: "text",
|
|
204
|
+
text: formatError(res.error, res.status, "Use list_agents to verify the agent_id."),
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
const cloneData = res.data;
|
|
210
|
+
let text = `Agent cloned successfully.\n\n${JSON.stringify(res.data, null, 2)}`;
|
|
211
|
+
if (cloneData?.id) {
|
|
212
|
+
text += `\n\nDashboard: ${client.dashboardUrl}/dashboard/agents/${cloneData.id}`;
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
content: [{ type: "text", text }],
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
// --- delete_agent ---
|
|
219
|
+
server.registerTool("delete_agent", {
|
|
220
|
+
title: "Delete Agent",
|
|
221
|
+
description: "Permanently delete an agent and all associated data (knowledge base, tools, channels, conversations). This cannot be undone.",
|
|
222
|
+
inputSchema: {
|
|
223
|
+
agent_id: z.string().describe("The agent's UUID"),
|
|
224
|
+
},
|
|
225
|
+
annotations: {
|
|
226
|
+
destructiveHint: true,
|
|
227
|
+
idempotentHint: true,
|
|
228
|
+
},
|
|
229
|
+
}, async ({ agent_id }) => {
|
|
230
|
+
const res = await client.del(`/api/agents/${agent_id}`);
|
|
231
|
+
if (res.error) {
|
|
232
|
+
return {
|
|
233
|
+
isError: true,
|
|
234
|
+
content: [
|
|
235
|
+
{
|
|
236
|
+
type: "text",
|
|
237
|
+
text: formatError(res.error, res.status, "Use list_agents to verify the agent_id."),
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
content: [
|
|
244
|
+
{ type: "text", text: `Agent ${agent_id} deleted successfully.` },
|
|
245
|
+
],
|
|
246
|
+
};
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=agents.js.map
|