@velaro/mcp-server 2.0.130 → 2.0.132

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
@@ -23,7 +23,7 @@ Most chat platforms require webhooks, custom API wrappers, or point-to-point int
23
23
  - **Hosted HTTP endpoint** — no Node.js required; point Claude Desktop at `https://velaro-admin-staging.azurewebsites.net/mcp` with a Bearer token
24
24
  - **Auto-updates** — the package is republished on every production deploy; `npx` always runs the latest
25
25
  - **596 AI skills** — Shopify, BigCommerce, WooCommerce, Magento, HubSpot, Salesforce, NetSuite, ServiceNow, Dynamics 365, SAP, Square, QuickBooks, Jobber, and more — all callable from within Claude
26
- - **25 built-in tools** — conversations, workflows, bots, contacts, agents, teams, routing rules, conversion tracking, and full KB management
26
+ - **Built-in tools** — conversations, workflows, bots, contacts, agents, teams, routing rules, conversion tracking, and full KB management
27
27
 
28
28
  ---
29
29
 
@@ -82,7 +82,9 @@ If you prefer not to run a local Node process, point directly at Velaro's hosted
82
82
  }
83
83
  ```
84
84
 
85
- This works with any MCP client that supports HTTP/SSE transport — including Claude Desktop 0.8+.
85
+ This works with any MCP client that supports the Streamable HTTP transport.
86
+
87
+ The hosted endpoint serves a smaller toolset than the npm package: knowledge base (`kb_list_topics`, `kb_search_articles`, `kb_get_article`, `kb_create_article`, `kb_update_article`, `kb_delete_article`) contacts (`contact_search`, `contact_get`), and, for keys created with the `admin` scope (Settings > MCP keys > Access, or `velaro mcp-key create --scopes admin`), conversations (`conversation_list`, `conversation_get`, `conversation_search`), workflows (`workflow_list`, `workflow_get`, `workflow_toggle`), bots (`bot_list`, `bot_get`, `bot_update_prompt`), `agent_list`, `team_list` and routing (`routing_list`, `routing_get`). The full toolset listed below is available through `npx @velaro/mcp-server`. Every hosted call is scoped to the site that owns your key.
86
88
 
87
89
  ---
88
90
 
@@ -0,0 +1,12 @@
1
+ // Customer MCP keys (vel_live_*) are default-denied by the admin REST API's DefaultPolicy (ApiKeyAuthPolicies.cs),
2
+ // so the REST routes behind the KB tools answer 403 for them. The hosted gateway (POST /mcp, policy mcp:tools)
3
+ // serves the same tools in-process and scopes them to the key's site, so key-authenticated calls go there.
4
+ // A signed-in JWT keeps the direct REST path.
5
+ export const GATEWAY_KB_TOOLS = new Set([
6
+ 'kb_list_topics', 'kb_search_articles', 'kb_get_article',
7
+ 'kb_create_article', 'kb_update_article', 'kb_delete_article',
8
+ ]);
9
+
10
+ export function shouldUseGateway(toolName, hasMcpKey) {
11
+ return Boolean(hasMcpKey) && GATEWAY_KB_TOOLS.has(toolName);
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/mcp-server",
3
- "version": "2.0.130",
3
+ "version": "2.0.132",
4
4
  "description": "Velaro MCP server — connect Claude and other AI agents directly to your Velaro account: KB, workflows, bots, conversations, contacts, routing, and more.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,6 +47,7 @@
47
47
  "tool-annotations.js",
48
48
  "fetch-retry.js",
49
49
  "messaging-base.js",
50
+ "gateway-routing.js",
50
51
  "survey-email.js",
51
52
  "escalation-settings.js",
52
53
  "parity/loader.js",
@@ -63,6 +63,7 @@ export const tools = [
63
63
 
64
64
  export const handlers = {
65
65
  crm_calculated_values: async (a, ctx) => data(await ctx.messagingPost('/CrmCustomFields/calculated/values', { entity: a.entity, recordIds: a.recordIds })),
66
+ crm_calculated_filter: async (a, ctx) => data(await ctx.messagingPost('/CrmCustomFields/calculated/filter', { entity: a.entity, filters: a.filters, limit: a.limit })),
66
67
  crm_calculated_deps: async (a, ctx) => data(await ctx.messagingGet(`/CrmCustomFields/calculated/deps?entity=${encodeURIComponent(a.entity)}`)),
67
68
  crm_calculated_sources: async (a, ctx) => data(await ctx.messagingGet(`/CrmCustomFields/calculated/sources?entity=${encodeURIComponent(a.entity)}`)),
68
69
  };
package/parity/loader.js CHANGED
@@ -14,9 +14,20 @@ export async function loadParity(kind /* 'customer' | 'staff' */) {
14
14
  const dir = dirname(fileURLToPath(import.meta.url));
15
15
  const out = { tools: [], handlers: {} };
16
16
  for (const f of readdirSync(dir).filter((x) => x.endsWith(`.${kind}.js`)).sort()) {
17
- const mod = await import(pathToFileURL(join(dir, f)).href);
17
+ // One broken module must never take down the whole server: log it, skip that module, keep serving the rest.
18
+ let mod;
19
+ try {
20
+ mod = await import(pathToFileURL(join(dir, f)).href);
21
+ } catch (e) {
22
+ console.error(`[velaro-mcp] skipping parity module ${f}: failed to load: ${e?.message || e}`);
23
+ continue;
24
+ }
25
+ const bad = (mod.tools || []).filter((t) => !t?.name || typeof mod.handlers?.[t.name] !== 'function' || out.handlers[t.name]);
26
+ if (bad.length) {
27
+ console.error(`[velaro-mcp] skipping parity module ${f}: tool(s) with no handler or duplicate name: ${bad.map((t) => t?.name).join(', ')}`);
28
+ continue;
29
+ }
18
30
  for (const t of mod.tools || []) {
19
- if (out.handlers[t.name] || !mod.handlers?.[t.name]) throw new Error(`parity module ${f}: tool ${t.name} duplicate or missing handler`);
20
31
  out.tools.push(t);
21
32
  out.handlers[t.name] = mod.handlers[t.name];
22
33
  }
package/server.js CHANGED
@@ -57,6 +57,7 @@ import { resolveMessagingApi } from './messaging-base.js';
57
57
  import { normalizeMultiTabMode, buildMultiTabUpdateFields, normalizeEmailTranscript, buildEmailTranscriptUpdateFields } from './chat-window-style.js';
58
58
  import { buildResolvePath, buildTimelinePath, buildOverrideBody, buildValidateBody, buildBannerPath, buildOverrideListPath, tolerant, VALIDATE_PATH, OVERRIDE_PATH } from './workflow-schedule.js';
59
59
  import { applyEmailSubmissionsTo } from './survey-email.js';
60
+ import { shouldUseGateway } from './gateway-routing.js';
60
61
 
61
62
  // Production admin API by default; set VELARO_ADMIN_API to target staging.
62
63
  const API_BASE = process.env.VELARO_ADMIN_API || 'https://api-admin-us-east.velaro.com';
@@ -5183,8 +5184,12 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
5183
5184
  type: 'object',
5184
5185
  properties: {
5185
5186
  name: { type: 'string', description: 'Resource name. Required.' },
5186
- resourceType: { type: 'string', enum: ['Staff', 'Room', 'Equipment', 'Virtual'], description: 'Resource type. Defaults to Staff.' },
5187
+ resourceType: { type: 'string', enum: ['Staff', 'Room', 'Equipment', 'Virtual', 'Table'], description: 'Resource type. Defaults to Staff. Table is a dining table for TableCapacity booking mode.' },
5187
5188
  isActive: { type: 'boolean', description: 'Whether the resource is active. Defaults to true.' },
5189
+ minParty: { type: 'number', description: 'Table: smallest party this table seats.' },
5190
+ maxParty: { type: 'number', description: 'Table: largest party this table seats.' },
5191
+ turnMinutes: { type: 'number', description: 'Table: minutes a party occupies this table (overrides the service default).' },
5192
+ combineGroup: { type: 'string', description: 'Table: group name; tables in one group can be combined for larger parties when the service allows it.' },
5188
5193
  },
5189
5194
  required: ['name'],
5190
5195
  },
@@ -5197,8 +5202,12 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
5197
5202
  properties: {
5198
5203
  resourceId: { type: 'number', description: 'Resource ID. Required.' },
5199
5204
  name: { type: 'string', description: 'New name' },
5200
- resourceType: { type: 'string', enum: ['Staff', 'Room', 'Equipment', 'Virtual'], description: 'New resource type' },
5205
+ resourceType: { type: 'string', enum: ['Staff', 'Room', 'Equipment', 'Virtual', 'Table'], description: 'New resource type' },
5201
5206
  isActive: { type: 'boolean', description: 'New active state' },
5207
+ minParty: { type: 'number', description: 'Table: new smallest party' },
5208
+ maxParty: { type: 'number', description: 'Table: new largest party' },
5209
+ turnMinutes: { type: 'number', description: 'Table: new turn minutes' },
5210
+ combineGroup: { type: 'string', description: 'Table: new combine group name' },
5202
5211
  },
5203
5212
  required: ['resourceId'],
5204
5213
  },
@@ -5238,6 +5247,14 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
5238
5247
  requiresResource: { type: 'boolean', description: 'Whether a slot for this service must be tied to a specific bookable resource. Defaults to true.' },
5239
5248
  category: { type: 'string', description: 'Free-text grouping for admin UI/reporting, e.g. "Hair" or "Fitness Classes".' },
5240
5249
  isActive: { type: 'boolean', description: 'Whether the service is active. Defaults to true.' },
5250
+ bookingMode: { type: 'string', enum: ['StaffSchedule', 'TableCapacity', 'SeatCapacity'], description: 'How this service is booked: one person schedule, tables by party size, or seats per class. Omit for current behavior.' },
5251
+ turnMinutes: { type: 'number', description: 'Default minutes a party occupies a table.' },
5252
+ turnMinutesBySize: { type: 'object', description: 'Turn minutes by party size range, e.g. {"1-2":60,"3-5":90,"6+":120}.' },
5253
+ bufferBeforeMinutes: { type: 'number', description: 'Minutes held free before each booking.' },
5254
+ bufferAfterMinutes: { type: 'number', description: 'Minutes held free after each booking.' },
5255
+ allowTableCombining: { type: 'boolean', description: 'Allow combining tables within a combine group.' },
5256
+ minParty: { type: 'number', description: 'Smallest party accepted.' },
5257
+ maxParty: { type: 'number', description: 'Largest party accepted.' },
5241
5258
  },
5242
5259
  required: ['name'],
5243
5260
  },
@@ -5255,6 +5272,14 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
5255
5272
  requiresResource: { type: 'boolean', description: 'New requires-resource flag' },
5256
5273
  category: { type: 'string', description: 'New category (empty string clears it)' },
5257
5274
  isActive: { type: 'boolean', description: 'New active state' },
5275
+ bookingMode: { type: 'string', enum: ['StaffSchedule', 'TableCapacity', 'SeatCapacity'], description: 'New booking mode' },
5276
+ turnMinutes: { type: 'number', description: 'New default turn minutes' },
5277
+ turnMinutesBySize: { type: 'object', description: 'New turn minutes by party size range, e.g. {"1-2":60,"3-5":90,"6+":120}' },
5278
+ bufferBeforeMinutes: { type: 'number', description: 'New buffer before, minutes' },
5279
+ bufferAfterMinutes: { type: 'number', description: 'New buffer after, minutes' },
5280
+ allowTableCombining: { type: 'boolean', description: 'New table-combining flag' },
5281
+ minParty: { type: 'number', description: 'New smallest party' },
5282
+ maxParty: { type: 'number', description: 'New largest party' },
5258
5283
  },
5259
5284
  required: ['serviceId'],
5260
5285
  },
@@ -5747,6 +5772,7 @@ const CHAIN_FIELDS = [
5747
5772
  ];
5748
5773
 
5749
5774
  async function handleTool(name, args) {
5775
+ if (shouldUseGateway(name, Boolean(MCP_KEY))) return rpc(name, args);
5750
5776
  switch (name) {
5751
5777
  case 'case_list_types': {
5752
5778
  return JSON.stringify(await messagingGet('/CaseTypes'), null, 2);
@@ -5897,7 +5923,7 @@ async function handleTool(name, args) {
5897
5923
  const articles = data?.articles ?? [];
5898
5924
  if (!articles.length) return 'No articles found.';
5899
5925
  return articles.map(a =>
5900
- `[${a.id}] ${a.isPublished ? 'published' : 'draft'} | "${a.title}" | ${a.hitCount ?? 0} views | ${a.url ?? 'not public'}`
5926
+ `[${a.id}] ${a.isPublished ? 'published' : 'draft'} ${a.title}\n slug: ${a.slug ?? ''}\n ${a.hitCount ?? 0} views | ${a.url ?? 'not public'}`
5901
5927
  ).join('\n');
5902
5928
  }
5903
5929
 
@@ -10149,6 +10175,10 @@ ${JSON.stringify(result, null, 2)}`;
10149
10175
  name: args.name,
10150
10176
  resourceType: args.resourceType,
10151
10177
  isActive: args.isActive,
10178
+ minParty: args.minParty,
10179
+ maxParty: args.maxParty,
10180
+ turnMinutes: args.turnMinutes,
10181
+ combineGroup: args.combineGroup,
10152
10182
  });
10153
10183
  return JSON.stringify(result, null, 2);
10154
10184
  }
@@ -10159,6 +10189,10 @@ ${JSON.stringify(result, null, 2)}`;
10159
10189
  name: args.name,
10160
10190
  resourceType: args.resourceType,
10161
10191
  isActive: args.isActive,
10192
+ minParty: args.minParty,
10193
+ maxParty: args.maxParty,
10194
+ turnMinutes: args.turnMinutes,
10195
+ combineGroup: args.combineGroup,
10162
10196
  });
10163
10197
  return JSON.stringify(result, null, 2);
10164
10198
  }
@@ -10189,6 +10223,14 @@ ${JSON.stringify(result, null, 2)}`;
10189
10223
  requiresResource: args.requiresResource,
10190
10224
  category: args.category,
10191
10225
  isActive: args.isActive,
10226
+ bookingMode: args.bookingMode,
10227
+ turnMinutes: args.turnMinutes,
10228
+ turnMinutesBySize: args.turnMinutesBySize,
10229
+ bufferBeforeMinutes: args.bufferBeforeMinutes,
10230
+ bufferAfterMinutes: args.bufferAfterMinutes,
10231
+ allowTableCombining: args.allowTableCombining,
10232
+ minParty: args.minParty,
10233
+ maxParty: args.maxParty,
10192
10234
  });
10193
10235
  return JSON.stringify(result, null, 2);
10194
10236
  }
@@ -10202,6 +10244,14 @@ ${JSON.stringify(result, null, 2)}`;
10202
10244
  requiresResource: args.requiresResource,
10203
10245
  category: args.category,
10204
10246
  isActive: args.isActive,
10247
+ bookingMode: args.bookingMode,
10248
+ turnMinutes: args.turnMinutes,
10249
+ turnMinutesBySize: args.turnMinutesBySize,
10250
+ bufferBeforeMinutes: args.bufferBeforeMinutes,
10251
+ bufferAfterMinutes: args.bufferAfterMinutes,
10252
+ allowTableCombining: args.allowTableCombining,
10253
+ minParty: args.minParty,
10254
+ maxParty: args.maxParty,
10205
10255
  });
10206
10256
  return JSON.stringify(result, null, 2);
10207
10257
  }