@seldonframe/mcp 1.0.2 → 1.0.4

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 (2) hide show
  1. package/package.json +2 -2
  2. package/src/tools.js +72 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seldonframe/mcp",
3
- "version": "1.0.2",
4
- "description": "MCP server for SeldonFrame — AI-native Business OS platform. One command creates a real hosted workspace with CRM, booking, intake, and Brain v2.",
3
+ "version": "1.0.4",
4
+ "description": "MCP server for SeldonFrame — AI-native Business OS platform. One command creates a real hosted workspace with CRM, booking, intake, and Brain v2. v1.0.4: hardens the admin URL surface so operators always see the bearer-token /admin/<id>?token=... URL, not the legacy /switch-workspace login-required path.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "seldonframe-mcp": "src/index.js"
package/src/tools.js CHANGED
@@ -63,6 +63,20 @@ export const TOOLS = [
63
63
  } else {
64
64
  setDefaultWorkspace(id);
65
65
  }
66
+ // C6: surface the bearer-token admin URL as the most prominent line
67
+ // in the response. Operators paste it into their browser and land
68
+ // directly on the dashboard — no signup, no login, no OAuth.
69
+ const adminUrl = result.admin_url ?? null;
70
+ // v1.0.4: strip the misleading `admin_*` keys out of the legacy
71
+ // flat `urls` object so old clients don't surface the
72
+ // /switch-workspace login-required URLs as if they were the
73
+ // intended path. Public-facing keys (home/book/intake) stay.
74
+ const rawUrls = result.urls ?? ws.urls ?? null;
75
+ const publicUrls = rawUrls
76
+ ? Object.fromEntries(
77
+ Object.entries(rawUrls).filter(([key]) => !key.startsWith("admin_")),
78
+ )
79
+ : null;
66
80
  const payload = {
67
81
  ok: true,
68
82
  workspace: {
@@ -72,13 +86,23 @@ export const TOOLS = [
72
86
  tier: ws.tier ?? "free",
73
87
  created_at: ws.created_at,
74
88
  },
75
- urls: result.urls ?? ws.urls ?? null,
89
+ // ⚡ Admin Dashboard (bookmark this!): the one URL operators need.
90
+ admin_url: adminUrl,
91
+ admin_url_expires_at: result.bearer_token_expires_at ?? null,
92
+ admin_url_message: adminUrl
93
+ ? `⚡ Admin Dashboard (bookmark this!): ${adminUrl}\nClick to open the dashboard — no signup needed. Token expires in 7 days; re-mint with list_workspaces({}) when it does.`
94
+ : null,
95
+ urls: publicUrls,
96
+ public_urls: result.public_urls ?? publicUrls,
76
97
  installed: result.installed ?? ["crm", "caldiy-booking", "formbricks-intake", "brain-v2"],
77
98
  next: [
99
+ adminUrl
100
+ ? `⚡ Admin Dashboard (bookmark this!): ${adminUrl} (paste into your browser; no signup needed; token expires in 7 days)`
101
+ : null,
78
102
  "install_vertical_pack({ pack: 'real-estate' }) // or 'dental', 'legal'",
79
103
  "fetch_source_for_soul({ url: 'https://yoursite.com' }) → submit_soul({ soul })",
80
104
  "get_workspace_snapshot({}) — read workspace state to reason about next steps",
81
- ],
105
+ ].filter(Boolean),
82
106
  };
83
107
  return firstEver ? withFirstCallBanner(payload) : payload;
84
108
  },
@@ -250,7 +274,7 @@ export const TOOLS = [
250
274
  {
251
275
  name: "update_landing_content",
252
276
  description:
253
- "Rewrite the workspace's public landing page at / — headline, subhead, and primary CTA label. YOU decide the copy based on the user's request + the workspace Soul; this tool persists it.",
277
+ "Rewrite the workspace's public landing page hero — headline, subhead, and primary CTA label. C3.4 made this blueprint-aware: the operator's edit lands without losing any of the renderer's visual polish (typography, layered-shadow buttons, animations, etc.). Use this for the most common copy edits; for granular per-section / per-item edits use update_landing_section.",
254
278
  inputSchema: obj(
255
279
  {
256
280
  headline: str("Main hero heading. Keep short; 1 line."),
@@ -258,7 +282,6 @@ export const TOOLS = [
258
282
  cta_label: str("Primary call-to-action button text, e.g. 'Book a call'."),
259
283
  workspace_id: str("Optional workspace override."),
260
284
  },
261
- ["headline", "subhead", "cta_label"],
262
285
  ),
263
286
  handler: async (a) => {
264
287
  const ws = wsOrDefault(a.workspace_id);
@@ -273,6 +296,51 @@ export const TOOLS = [
273
296
  });
274
297
  },
275
298
  },
299
+ {
300
+ name: "update_landing_section",
301
+ description:
302
+ "Granular per-field landing edit — change any single slot in any section of the blueprint-rendered landing page. Use when update_landing_content's three fields aren't enough. Section types: emergency-strip, hero, trust-strip, services-grid, about, mid-cta, testimonials, service-area, faq, footer. Field is a dot-segmented path on that section (e.g. 'headline', 'subhead', 'items.0.title', 'items.2.answer', 'showHours'). Value is the new value (string for copy, boolean for flags, etc.).",
303
+ inputSchema: obj(
304
+ {
305
+ section: {
306
+ type: "string",
307
+ enum: [
308
+ "emergency-strip",
309
+ "hero",
310
+ "trust-strip",
311
+ "services-grid",
312
+ "about",
313
+ "mid-cta",
314
+ "testimonials",
315
+ "service-area",
316
+ "faq",
317
+ "footer",
318
+ ],
319
+ },
320
+ field: str(
321
+ "Dot-segmented field path on the section. Examples: 'headline', 'subhead', 'items.0.title', 'items.2.answer', 'showHours'."
322
+ ),
323
+ value: {
324
+ description:
325
+ "New value for the field. String for copy, number for ratings, boolean for flags, object/array for richer slots.",
326
+ },
327
+ workspace_id: str("Optional workspace override."),
328
+ },
329
+ ["section", "field", "value"],
330
+ ),
331
+ handler: async (a) => {
332
+ const ws = wsOrDefault(a.workspace_id);
333
+ return api("POST", "/landing/section/update", {
334
+ body: {
335
+ section: a.section,
336
+ field: a.field,
337
+ value: a.value,
338
+ workspace_id: ws,
339
+ },
340
+ workspace_id: ws,
341
+ });
342
+ },
343
+ },
276
344
  // Note: `customize_intake_form` used to live here pointing at POST
277
345
  // /api/v1/intake/customize. Phase 2.d unified it under update_form; the
278
346
  // alias that preserves the old name now lives in the Phase 2.d block at