@neopress/mcp 1.6.0 → 1.7.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/dist/bin.cjs CHANGED
@@ -19750,6 +19750,12 @@ var FormsEndpoint = class {
19750
19750
  async deleteResponse(formId, responseId) {
19751
19751
  await this.client.delete(`${this.basePath}/${formId}/responses/${responseId}`);
19752
19752
  }
19753
+ async getResponse(formId, responseId) {
19754
+ return (await this.client.get(`${this.basePath}/${formId}/responses/${responseId}`)).data;
19755
+ }
19756
+ async markResponseRead(formId, responseId) {
19757
+ return (await this.client.patch(`${this.basePath}/${formId}/responses/${responseId}`, { read: true })).data;
19758
+ }
19753
19759
  };
19754
19760
  //#endregion
19755
19761
  //#region ../sdk/src/endpoints/assets.ts
@@ -19897,8 +19903,14 @@ var PublishEndpoint = class {
19897
19903
  async preview() {
19898
19904
  return (await this.client.get(`${this.client.siteBasePath}/publish`)).data;
19899
19905
  }
19900
- async site() {
19901
- return (await this.client.post(`${this.client.siteBasePath}/publish`)).data;
19906
+ async site(selection) {
19907
+ return (await this.client.post(`${this.client.siteBasePath}/publish`, selection ? { selection } : void 0)).data;
19908
+ }
19909
+ async unpublishPages(pageIds) {
19910
+ return (await this.client.patch(`${this.client.siteBasePath}/publish`, { pageIds })).data;
19911
+ }
19912
+ async undeploy() {
19913
+ return (await this.client.delete(`${this.client.siteBasePath}/publish`)).data;
19902
19914
  }
19903
19915
  };
19904
19916
  //#endregion
@@ -20066,6 +20078,14 @@ var AnalyticsFunnelsEndpoint = class {
20066
20078
  async delete(funnelId) {
20067
20079
  await this.client.delete(`${this.basePath}/${funnelId}`);
20068
20080
  }
20081
+ async results(funnelId, params) {
20082
+ const query = new URLSearchParams();
20083
+ if (params?.dateFrom) query.set("dateFrom", params.dateFrom);
20084
+ if (params?.dateTo) query.set("dateTo", params.dateTo);
20085
+ if (params?.timezone) query.set("timezone", params.timezone);
20086
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
20087
+ return (await this.client.get(`${this.basePath}/${funnelId}/results${suffix}`)).data;
20088
+ }
20069
20089
  };
20070
20090
  //#endregion
20071
20091
  //#region ../sdk/src/endpoints/templates.ts
@@ -20194,6 +20214,122 @@ var LogosEndpoint = class {
20194
20214
  }
20195
20215
  };
20196
20216
  //#endregion
20217
+ //#region ../sdk/src/endpoints/domains.ts
20218
+ var DomainsEndpoint = class {
20219
+ client;
20220
+ constructor(client) {
20221
+ this.client = client;
20222
+ }
20223
+ get basePath() {
20224
+ return `${this.client.siteBasePath}/domains`;
20225
+ }
20226
+ async status() {
20227
+ return (await this.client.get(this.basePath)).data;
20228
+ }
20229
+ async connect(domain) {
20230
+ return (await this.client.post(this.basePath, { domain })).data;
20231
+ }
20232
+ async refresh() {
20233
+ return (await this.client.patch(this.basePath, {})).data;
20234
+ }
20235
+ async remove(domain) {
20236
+ return (await this.client.delete(this.basePath, { domain })).data;
20237
+ }
20238
+ };
20239
+ //#endregion
20240
+ //#region ../sdk/src/endpoints/search-console.ts
20241
+ var SearchConsoleConnectionEndpoint = class {
20242
+ client;
20243
+ constructor(client) {
20244
+ this.client = client;
20245
+ }
20246
+ get basePath() {
20247
+ return `${this.client.siteBasePath}/search-console`;
20248
+ }
20249
+ async status() {
20250
+ return (await this.client.get(this.basePath)).data;
20251
+ }
20252
+ async authorize(locale) {
20253
+ return (await this.client.post(this.basePath, locale ? { locale } : {})).data;
20254
+ }
20255
+ async disconnect() {
20256
+ return (await this.client.delete(this.basePath)).data;
20257
+ }
20258
+ };
20259
+ //#endregion
20260
+ //#region ../sdk/src/endpoints/billing.ts
20261
+ var BillingEndpoint = class {
20262
+ client;
20263
+ constructor(client) {
20264
+ this.client = client;
20265
+ }
20266
+ get basePath() {
20267
+ return `${this.client.siteBasePath}/billing`;
20268
+ }
20269
+ async status() {
20270
+ return (await this.client.get(this.basePath)).data;
20271
+ }
20272
+ async checkout(plan) {
20273
+ return (await this.client.post(`${this.basePath}/checkout`, { plan })).data;
20274
+ }
20275
+ async portal() {
20276
+ return (await this.client.post(`${this.basePath}/portal`)).data;
20277
+ }
20278
+ async cancel() {
20279
+ return (await this.client.post(`${this.basePath}/subscription/cancel`)).data;
20280
+ }
20281
+ async resume() {
20282
+ return (await this.client.post(`${this.basePath}/subscription/resume`)).data;
20283
+ }
20284
+ };
20285
+ //#endregion
20286
+ //#region ../sdk/src/endpoints/team.ts
20287
+ var TeamEndpoint = class {
20288
+ client;
20289
+ constructor(client) {
20290
+ this.client = client;
20291
+ }
20292
+ get basePath() {
20293
+ return `${this.client.siteBasePath}/team`;
20294
+ }
20295
+ async list() {
20296
+ return (await this.client.get(this.basePath)).data;
20297
+ }
20298
+ async invite(input) {
20299
+ return (await this.client.post(this.basePath, input)).data;
20300
+ }
20301
+ async updateRole(profileId, role) {
20302
+ return (await this.client.patch(`${this.basePath}/${profileId}`, { role })).data;
20303
+ }
20304
+ async remove(profileId) {
20305
+ return (await this.client.delete(`${this.basePath}/${profileId}`)).data;
20306
+ }
20307
+ async transferOwnership(profileId) {
20308
+ return (await this.client.post(`${this.basePath}/ownership`, { profileId })).data;
20309
+ }
20310
+ };
20311
+ //#endregion
20312
+ //#region ../sdk/src/endpoints/history.ts
20313
+ var HistoryEndpoint = class {
20314
+ client;
20315
+ constructor(client) {
20316
+ this.client = client;
20317
+ }
20318
+ get basePath() {
20319
+ return `${this.client.siteBasePath}/history/snapshots`;
20320
+ }
20321
+ async list(limit) {
20322
+ const query = limit === void 0 ? "" : `?limit=${encodeURIComponent(String(limit))}`;
20323
+ return (await this.client.get(`${this.basePath}${query}`)).data;
20324
+ }
20325
+ async get(snapshotId) {
20326
+ return (await this.client.get(`${this.basePath}/${snapshotId}`)).data;
20327
+ }
20328
+ async restore(snapshotId) {
20329
+ return (await this.client.post(`${this.basePath}/${snapshotId}/restore`)).data;
20330
+ }
20331
+ };
20332
+ //#endregion
20197
20333
  //#region ../sdk/src/client.ts
20198
20334
  /**
20199
20335
  * @neopress/sdk — API Client
@@ -20218,6 +20354,11 @@ var NeopressClient = class {
20218
20354
  templates;
20219
20355
  headshots;
20220
20356
  logos;
20357
+ domains;
20358
+ searchConsole;
20359
+ billing;
20360
+ team;
20361
+ history;
20221
20362
  constructor(options) {
20222
20363
  this.baseUrl = (options.baseUrl || "https://app.neopress.ai").replace(/\/$/, "");
20223
20364
  this.accessToken = options.accessToken || "";
@@ -20236,6 +20377,11 @@ var NeopressClient = class {
20236
20377
  this.templates = new TemplatesEndpoint(this);
20237
20378
  this.headshots = new HeadshotsEndpoint(this);
20238
20379
  this.logos = new LogosEndpoint(this);
20380
+ this.domains = new DomainsEndpoint(this);
20381
+ this.searchConsole = new SearchConsoleConnectionEndpoint(this);
20382
+ this.billing = new BillingEndpoint(this);
20383
+ this.team = new TeamEndpoint(this);
20384
+ this.history = new HistoryEndpoint(this);
20239
20385
  }
20240
20386
  get siteBasePath() {
20241
20387
  return `/api/v1/sites/${this.siteId}`;
@@ -20285,8 +20431,8 @@ var NeopressClient = class {
20285
20431
  async patch(path, body) {
20286
20432
  return this.request("PATCH", path, body);
20287
20433
  }
20288
- async delete(path) {
20289
- return this.request("DELETE", path);
20434
+ async delete(path, body) {
20435
+ return this.request("DELETE", path, body);
20290
20436
  }
20291
20437
  };
20292
20438
  //#endregion
@@ -20421,9 +20567,8 @@ Use these rules before generating pages, collection schemas, entries, forms, or
20421
20567
 
20422
20568
  ## Operating boundary
20423
20569
 
20424
- - Authentication is OAuth bearer token based. Use \`NEOPRESS_ACCESS_TOKEN\` or the OAuth session created by \`neopress login\`.
20425
- - API keys and API-key based public integrations are not part of this surface.
20426
- - MCP is available as local stdio and remote Streamable HTTP over the first-party SDK/API.
20570
+ - Connect the remote MCP server and sign in with your Neopress account through OAuth.
20571
+ - MCP is available on Launch and above. Your site role controls which actions you can perform.
20427
20572
  - MCP is a Neopress contract adapter, not a reference crawler or managed page generator.
20428
20573
  - The host coding agent should perform \`r.jina.ai\` markdown fetches, browser screenshots, DOM/CSS/SVG/background-image extraction, reference analysis, and TSX authoring with its own tools and tokens.
20429
20574
  - Use MCP to read/write Neopress resources, upload or register assets, compile, publish, and verify. Do not expect MCP to spend Neopress server-side LLM tokens for reference analysis or page generation.
@@ -20437,13 +20582,15 @@ Use these rules before generating pages, collection schemas, entries, forms, or
20437
20582
 
20438
20583
  ## Cache
20439
20584
 
20440
- - Site publish invalidates site/layout/collection reader cache tags in the API environment that handled the request.
20585
+ - Site publish invalidates site/layout/collection reader cache tags in the environment connected to MCP.
20441
20586
  - Entry publish/unpublish invalidates entry reader cache when production visibility changes.
20442
- - A localhost publish does not invalidate production reader cache. For production validation, publish through the production API and verify the live URL.
20587
+ - A localhost publish does not invalidate production reader cache. For production validation, publish through the production MCP server and verify the live URL.
20443
20588
 
20444
20589
  ## Analytics and autopilot
20445
20590
 
20446
- - Analytics tools are read-only OAuth-authenticated queries for traffic, forms, AI crawler reach, and Search Console.
20591
+ - Analytics result tools are OAuth-authenticated read queries for traffic, forms, AI crawler reach, Search Console, and tenant-owned saved funnels. Event/funnel definitions and the Search Console connection have separate mutation tools.
20592
+ - The API re-checks site role, work access, and plan entitlements on every MCP call. MCP starts at Launch; deep analytics such as saved funnel results requires Growth. Billing is Owner-only and team/domain management is Owner/Admin.
20593
+ - Consequential public, account, billing, team, deletion, and history-restore tools carry destructive/open-world annotations for host approval. OAuth consent, DNS-provider credentials, checkout, and billing-portal steps still require user interaction.
20447
20594
  - Generated page TSX must not call analytics APIs, Tinybird, Search Console, Supabase, or server resources directly.
20448
20595
  - Search Console can return connected=false. Do not claim query-level SEO evidence unless connected data is returned.
20449
20596
  - Analytics may justify the next draft change, but mutations still follow the compile, publish, entry publish, form publish, and production verification contracts.
@@ -20452,7 +20599,7 @@ Use these rules before generating pages, collection schemas, entries, forms, or
20452
20599
 
20453
20600
  - Layout owns header, footer, global CSS, and 404. Page TSX starts at page content.
20454
20601
  - Generated page TSX is sandboxed. Do not import Supabase, create API clients, read env vars, use filesystem/process APIs, or assume arbitrary npm packages.
20455
- - Use allowed runtime packages only: React/Next basics, react-dom (createPortal), shadcn UI imports, lucide-react, @base-ui/react/drawer, @base-ui/react/dialog, @base-ui/react/accordion, @base-ui/react/switch, @base-ui/react/tabs, @base-ui/react/select, @neopress/youtube, @neopress/map, clsx, class-variance-authority, tailwind-merge, motion/react (never \`framer-motion\` — old package name, not on the allowlist), motion-plus/react (Motion+ premium components: Ticker, Carousel, Cursor, AnimateNumber, AnimateText, Typewriter, ScrambleText, Curtains), @paper-design/shaders-react, gsap (including \`gsap/ScrollTrigger\`, driven via \`@gsap/react\`'s \`useGSAP\`), react-hook-form, zod, @hookform/resolvers, @hookform/resolvers/zod, @neopress/content, @neopress/routing, @neopress/i18n, and @neopress/forms.
20602
+ - Use allowed runtime packages only: React/Next basics, react-dom (createPortal), shadcn UI imports, lucide-react, @base-ui/react/drawer, @base-ui/react/dialog, @base-ui/react/accordion, @base-ui/react/switch, @base-ui/react/tabs, @base-ui/react/select, @neopress/youtube, @neopress/map, clsx, class-variance-authority, tailwind-merge, motion/react (never \`framer-motion\` — old package name, not on the allowlist), motion-plus/react (Motion+ premium components: Ticker, Carousel, Cursor, AnimateNumber, AnimateText, Typewriter, ScrambleText, Curtains), @paper-design/shaders-react, gsap (including \`gsap/ScrollTrigger\`, driven via \`@gsap/react\`'s \`useGSAP\`), react-hook-form, zod, @hookform/resolvers, @hookform/resolvers/zod, @neopress/content, @neopress/routing, @neopress/i18n, @neopress/responsive (MobileOnly with deferred desktop/mobile callbacks), and @neopress/forms.
20456
20603
  - For dates, render an existing \`displayDate\` field directly when available. For raw timestamps, use \`Intl.DateTimeFormat\` or \`Date#toLocaleDateString\` with an explicit locale and \`timeZone\` so server rendering and hydration agree; use the site's required zone, or \`UTC\` when none is specified.
20457
20604
  - @base-ui/react/select is an accessible listbox/dropdown (replaces a native \`<select>\`, whose popup is unstyled OS chrome). Compose its parts directly in page TSX; a \`<Select.Item value>\` is a string or the documented \`null\` sentinel (unlike Radix, an empty string is not banned); the \`Select.Popup\` portals to \`document.body\`, so give it an explicit z-index and an opaque background; match the trigger width with \`min-w-[var(--anchor-width)]\` (from \`Select.Positioner\`), cap the list with \`max-h-[var(--available-height)]\`, and set \`alignItemWithTrigger={false}\` for standard below-trigger placement. @base-ui/react/drawer is the gesture mobile sheet; @base-ui/react/dialog the non-gesture modal — both portal to \`document.body\`, need an opaque Popup background + z-index, and take \`modal\` for focus-trap.
20458
20605
  - react-dom is for \`createPortal\` — portal full-viewport overlays (mobile drawer, modal) to \`document.body\` so a \`backdrop-filter\`/\`transform\` ancestor can't trap their \`position: fixed\` inside its box. ALWAYS render the portal behind an open-state guard (\`{open && createPortal(…, document.body)}\`): an unguarded \`document\` reference throws during SSR.
@@ -20474,7 +20621,9 @@ Use these rules before generating pages, collection schemas, entries, forms, or
20474
20621
  - \`queryConfig\` is stored in page \`draftMeta.queryConfig\`.
20475
20622
  - Query labels become React props. Entry query results are flattened, so use \`post.body\` instead of \`post.data.body\`.
20476
20623
  - A query may include \`collectionWindow\` on an \`entries\` query for a dynamic detail route. Its label receives \`{ before, after, items }\`; each is a flattened-entry array around the current entry, and \`items\` combines both directions. Windows use \`published_at DESC, id DESC\`, allow 0–20 entries per direction, and may only declare that exact order. Use the exact configured label, never a guessed prop name. Optional \`matchFields\` compare raw anchor-snapshot fields only when the source field has a value.
20477
- - Initial CMS data arrives through those injected query props. \`entryClient\`, when injected in reader/preview for a site handle, is only a client-side auxiliary for load-more/filter/get/create interactions after the initial render; do not use it for initial render or server data loading.
20624
+ - Initial CMS data arrives through those injected query props. \`entryClient\`, when injected in reader/preview for a site handle, is only a client-side auxiliary for load-more/filter/get/create interactions after the initial render; do not use it for initial render or server data loading. Its entries come back flattened like injected props, ordered \`published_at DESC, id DESC\`.
20625
+ - Server-side binding is the default because injected props are server-rendered and crawlable; \`entryClient\` is for after-hydration needs only (large-collection load-more, a read that depends on visitor input such as search text or a chosen filter, or an explicit client-side request).
20626
+ - Load-more pagination: give the list query a \`limit\` (first page injected server-side), then append \`entryClient.more(propLabel, { offset: shown.length, filters? })\` — the server re-runs that page's stored binding query from the offset, so the page restates nothing; \`filters\` is equality on scalar schema fields (\`{ category: "TECH" }\`), applied to the same published data. \`entryClient.list({ collectionId, offset, limit, filters? })\` is only for reads whose query depends on visitor input or that are too large to inject; a light, fixed set revealed on click is a bound query instead. Judge "light" by what the query injects into the page, not by how much the UI shows: a query without a \`limit\` ships every entry with every field. Without a \`limit\` a list query injects every entry, so paginate by slicing the prop instead.
20478
20627
  - Use numeric \`collection_id\` filters. Runtime controls site, status, locale, deleted state, and published snapshots.
20479
20628
 
20480
20629
  ## Collections and entries
@@ -20488,7 +20637,7 @@ Use these rules before generating pages, collection schemas, entries, forms, or
20488
20637
 
20489
20638
  - Reference fields require a schema field with \`type: "references"\` and target \`collection_id\`.
20490
20639
  - Links live in \`entry_references\`, not only in raw entry \`data\`.
20491
- - \`includeReferences\` fetches arrays keyed by the includeReferences alias or field key, and parent entry \`id\` must be selected. With an alias, the alias prop remains an array of referenced entries. Without an alias, if the field key matches a raw numeric reference field in \`entry.data\`, flattening unwraps that array to one flattened object or null.
20640
+ - \`includeReferences\` fetches arrays keyed by the includeReferences alias or field key, and parent entry \`id\` must be selected. With an alias, the alias prop remains an array of referenced entries. Without an alias, if the field key matches a raw numeric reference field in \`entry.data\`, flattening unwraps that array to one object or null; references linked only through \`entry_references\` stay arrays. Every referenced entry is flattened like the parent (\`ref.<fieldId>\`; \`ref.data\` kept for backward compatibility), one level deep.
20492
20641
  - After changing references, publish the source entry again.
20493
20642
 
20494
20643
  ## Forms
@@ -20501,7 +20650,7 @@ Use these rules before generating pages, collection schemas, entries, forms, or
20501
20650
  ## Unsupported visitor features
20502
20651
 
20503
20652
  Generated Neopress pages do not support visitor login/accounts, member areas, carts, checkout, payments, subscriptions, or order management.`;
20504
- const SERVER_INSTRUCTIONS = `Use Neopress MCP tools to manage a selected Neopress site through the first-party OAuth API.
20653
+ const SERVER_INSTRUCTIONS = `Use Neopress MCP tools to manage a selected Neopress site through an authenticated MCP connection.
20505
20654
 
20506
20655
  Before generating TSX or schema-backed pages, call neopress_get_runtime_contract or read neopress://runtime-contract.
20507
20656
  Use numeric IDs returned by tools. Publish entries separately from site publish. Use read-only analytics tools before autopilot recommendations. Verify production URLs after production publish.
@@ -20784,6 +20933,7 @@ const READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
20784
20933
  "neopress_forms_list",
20785
20934
  "neopress_form_get",
20786
20935
  "neopress_form_responses_list",
20936
+ "neopress_form_response_get",
20787
20937
  "neopress_analytics_query",
20788
20938
  "neopress_analytics_pageviews",
20789
20939
  "neopress_analytics_summary",
@@ -20800,6 +20950,13 @@ const READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
20800
20950
  "neopress_assets_list",
20801
20951
  "neopress_asset_get",
20802
20952
  "neopress_publish_preview",
20953
+ "neopress_domain_status",
20954
+ "neopress_search_console_connection_status",
20955
+ "neopress_billing_status",
20956
+ "neopress_team_list",
20957
+ "neopress_history_snapshots_list",
20958
+ "neopress_history_snapshot_get",
20959
+ "neopress_analytics_funnel_results",
20803
20960
  "neopress_template_get"
20804
20961
  ]);
20805
20962
  const DESTRUCTIVE_TOOLS = /* @__PURE__ */ new Set([
@@ -20825,15 +20982,48 @@ const DESTRUCTIVE_TOOLS = /* @__PURE__ */ new Set([
20825
20982
  "neopress_analytics_event_delete",
20826
20983
  "neopress_analytics_funnel_create",
20827
20984
  "neopress_analytics_funnel_update",
20828
- "neopress_analytics_funnel_delete"
20985
+ "neopress_analytics_funnel_delete",
20986
+ "neopress_domain_connect",
20987
+ "neopress_domain_remove",
20988
+ "neopress_search_console_disconnect",
20989
+ "neopress_billing_cancel",
20990
+ "neopress_team_member_update_role",
20991
+ "neopress_team_member_remove",
20992
+ "neopress_team_transfer_ownership",
20993
+ "neopress_form_response_delete",
20994
+ "neopress_history_snapshot_restore",
20995
+ "neopress_unpublish_pages",
20996
+ "neopress_undeploy_site"
20829
20997
  ]);
20830
- const PUBLICATION_TOOLS = /* @__PURE__ */ new Set([
20998
+ const OPEN_WORLD_TOOLS = /* @__PURE__ */ new Set([
20831
20999
  "neopress_entry_publish",
20832
21000
  "neopress_entry_unpublish",
20833
21001
  "neopress_form_publish",
20834
- "neopress_publish_site"
21002
+ "neopress_publish_site",
21003
+ "neopress_unpublish_pages",
21004
+ "neopress_undeploy_site",
21005
+ "neopress_domain_connect",
21006
+ "neopress_domain_refresh",
21007
+ "neopress_domain_remove",
21008
+ "neopress_search_console_authorize",
21009
+ "neopress_search_console_disconnect",
21010
+ "neopress_billing_checkout",
21011
+ "neopress_billing_portal",
21012
+ "neopress_billing_cancel",
21013
+ "neopress_billing_resume",
21014
+ "neopress_team_invite",
21015
+ "neopress_team_member_update_role",
21016
+ "neopress_team_member_remove",
21017
+ "neopress_team_transfer_ownership",
21018
+ "neopress_history_snapshot_restore"
21019
+ ]);
21020
+ const IDEMPOTENT_TOOLS = /* @__PURE__ */ new Set([
21021
+ "neopress_site_select",
21022
+ "neopress_page_compile",
21023
+ "neopress_domain_refresh",
21024
+ "neopress_form_response_mark_read",
21025
+ "neopress_billing_resume"
20835
21026
  ]);
20836
- const IDEMPOTENT_TOOLS = /* @__PURE__ */ new Set(["neopress_site_select", "neopress_page_compile"]);
20837
21027
  function getToolAnnotations(tool) {
20838
21028
  const readOnly = READ_ONLY_TOOLS.has(tool.name);
20839
21029
  return {
@@ -20841,7 +21031,7 @@ function getToolAnnotations(tool) {
20841
21031
  readOnlyHint: readOnly,
20842
21032
  destructiveHint: readOnly ? false : DESTRUCTIVE_TOOLS.has(tool.name),
20843
21033
  idempotentHint: readOnly || IDEMPOTENT_TOOLS.has(tool.name),
20844
- openWorldHint: PUBLICATION_TOOLS.has(tool.name)
21034
+ openWorldHint: OPEN_WORLD_TOOLS.has(tool.name)
20845
21035
  };
20846
21036
  }
20847
21037
  function getToolMeta(tool) {
@@ -20924,7 +21114,7 @@ const toolDefinitions = [
20924
21114
  {
20925
21115
  name: "neopress_site_select",
20926
21116
  title: "Select Active Site",
20927
- description: "Verify access to a site and store it as the active site for future MCP/CLI operations.",
21117
+ description: "Verify access to a site and store it as the active site for future MCP operations.",
20928
21118
  inputSchema: { siteId: number().int().positive() },
20929
21119
  handler: async (input, context, extra) => {
20930
21120
  const selectedSiteId = asNumber(input, "siteId");
@@ -21588,7 +21778,7 @@ const toolDefinitions = [
21588
21778
  {
21589
21779
  name: "neopress_analytics_event_create",
21590
21780
  title: "Create Analytics Event",
21591
- description: "Create a saved analytics event definition. Discover pages/forms with neopress_analytics_targets_list. Click/visibility require an existing stable [data-np-track=\"...\"] selector; page views reuse PAGE_VIEW. Optional id is a client UUID: reuse the same id and payload after an uncertain response.",
21781
+ description: "Create a saved analytics event definition over raw analytics signals. Discover page and form IDs with neopress_analytics_targets_list. Click targets use an observed href:<absolute-url> or selector:<fingerprint> key; outbound counts external-link clicks site-wide. Built-in events start collecting without editing or republishing page TSX. Optional id is a client UUID: reuse the same id and payload after an uncertain response.",
21592
21782
  inputSchema: {
21593
21783
  ...siteIdShape,
21594
21784
  id: string().uuid().optional(),
@@ -21599,8 +21789,8 @@ const toolDefinitions = [
21599
21789
  "click",
21600
21790
  "form",
21601
21791
  "scroll",
21602
- "visibility",
21603
- "dwell"
21792
+ "dwell",
21793
+ "outbound"
21604
21794
  ]),
21605
21795
  eventName: string().optional(),
21606
21796
  path: string().optional(),
@@ -21637,8 +21827,8 @@ const toolDefinitions = [
21637
21827
  "click",
21638
21828
  "form",
21639
21829
  "scroll",
21640
- "visibility",
21641
- "dwell"
21830
+ "dwell",
21831
+ "outbound"
21642
21832
  ]).optional(),
21643
21833
  eventName: string().optional(),
21644
21834
  path: string().optional(),
@@ -22135,6 +22325,247 @@ const toolDefinitions = [
22135
22325
  return { ok: true };
22136
22326
  }
22137
22327
  },
22328
+ {
22329
+ name: "neopress_domain_status",
22330
+ title: "Get Custom Domain Status",
22331
+ description: "Get the active site's connected custom domain and verification status.",
22332
+ inputSchema: siteIdShape,
22333
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).domains.status()
22334
+ },
22335
+ {
22336
+ name: "neopress_domain_connect",
22337
+ title: "Connect Custom Domain",
22338
+ description: "Connect a custom domain. Changes public routing and may require DNS updates.",
22339
+ inputSchema: {
22340
+ ...siteIdShape,
22341
+ domain: string().min(1)
22342
+ },
22343
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).domains.connect(asString(input, "domain"))
22344
+ },
22345
+ {
22346
+ name: "neopress_domain_refresh",
22347
+ title: "Refresh Custom Domain",
22348
+ description: "Refresh DNS and verification status for the currently connected domain.",
22349
+ inputSchema: siteIdShape,
22350
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).domains.refresh()
22351
+ },
22352
+ {
22353
+ name: "neopress_domain_remove",
22354
+ title: "Remove Custom Domain",
22355
+ description: "Remove the exact currently connected domain. Call the status tool first and pass that exact domain.",
22356
+ inputSchema: {
22357
+ ...siteIdShape,
22358
+ domain: string().min(1)
22359
+ },
22360
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).domains.remove(asString(input, "domain"))
22361
+ },
22362
+ {
22363
+ name: "neopress_search_console_connection_status",
22364
+ title: "Get Search Console Connection",
22365
+ description: "Get Google Search Console authorization and property connection status.",
22366
+ inputSchema: siteIdShape,
22367
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).searchConsole.status()
22368
+ },
22369
+ {
22370
+ name: "neopress_search_console_authorize",
22371
+ title: "Authorize Search Console",
22372
+ description: "Create a Google OAuth URL that the user must open and complete.",
22373
+ inputSchema: {
22374
+ ...siteIdShape,
22375
+ locale: string().optional()
22376
+ },
22377
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).searchConsole.authorize(asOptionalString(input, "locale"))
22378
+ },
22379
+ {
22380
+ name: "neopress_search_console_disconnect",
22381
+ title: "Disconnect Search Console",
22382
+ description: "Disconnect the site's Google Search Console integration.",
22383
+ inputSchema: siteIdShape,
22384
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).searchConsole.disconnect()
22385
+ },
22386
+ {
22387
+ name: "neopress_billing_status",
22388
+ title: "Get Billing Status",
22389
+ description: "Get owner-only plan and subscription status for the active site.",
22390
+ inputSchema: siteIdShape,
22391
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).billing.status()
22392
+ },
22393
+ {
22394
+ name: "neopress_billing_checkout",
22395
+ title: "Create Billing Checkout",
22396
+ description: "Create a checkout URL for the user to open. Does not itself complete payment.",
22397
+ inputSchema: {
22398
+ ...siteIdShape,
22399
+ plan: _enum(["launch", "growth"])
22400
+ },
22401
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).billing.checkout(input.plan)
22402
+ },
22403
+ {
22404
+ name: "neopress_billing_portal",
22405
+ title: "Create Billing Portal",
22406
+ description: "Create a customer-portal URL for the owner to open.",
22407
+ inputSchema: siteIdShape,
22408
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).billing.portal()
22409
+ },
22410
+ {
22411
+ name: "neopress_billing_cancel",
22412
+ title: "Cancel Subscription",
22413
+ description: "Schedule the site's subscription to cancel at the end of the billing period.",
22414
+ inputSchema: siteIdShape,
22415
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).billing.cancel()
22416
+ },
22417
+ {
22418
+ name: "neopress_billing_resume",
22419
+ title: "Resume Subscription",
22420
+ description: "Remove a scheduled end-of-period subscription cancellation.",
22421
+ inputSchema: siteIdShape,
22422
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).billing.resume()
22423
+ },
22424
+ {
22425
+ name: "neopress_team_list",
22426
+ title: "List Project Team",
22427
+ description: "List active members and pending invitations. Requires owner or admin.",
22428
+ inputSchema: siteIdShape,
22429
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).team.list()
22430
+ },
22431
+ {
22432
+ name: "neopress_team_invite",
22433
+ title: "Invite Project Member",
22434
+ description: "Invite a member. Seat limits and owner-only admin invitation rules apply.",
22435
+ inputSchema: {
22436
+ ...siteIdShape,
22437
+ email: string().email(),
22438
+ role: _enum([
22439
+ "admin",
22440
+ "editor",
22441
+ "viewer"
22442
+ ]),
22443
+ locale: string().optional()
22444
+ },
22445
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).team.invite({
22446
+ email: asString(input, "email"),
22447
+ role: input.role,
22448
+ locale: asOptionalString(input, "locale")
22449
+ })
22450
+ },
22451
+ {
22452
+ name: "neopress_team_member_update_role",
22453
+ title: "Update Project Member Role",
22454
+ description: "Change an active member's role preset. Owner and seat rules apply.",
22455
+ inputSchema: {
22456
+ ...siteIdShape,
22457
+ profileId: string().uuid(),
22458
+ role: _enum([
22459
+ "admin",
22460
+ "editor",
22461
+ "viewer"
22462
+ ])
22463
+ },
22464
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).team.updateRole(asString(input, "profileId"), input.role)
22465
+ },
22466
+ {
22467
+ name: "neopress_team_member_remove",
22468
+ title: "Remove Project Member",
22469
+ description: "Remove an active member. The owner cannot be removed.",
22470
+ inputSchema: {
22471
+ ...siteIdShape,
22472
+ profileId: string().uuid()
22473
+ },
22474
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).team.remove(asString(input, "profileId"))
22475
+ },
22476
+ {
22477
+ name: "neopress_team_transfer_ownership",
22478
+ title: "Transfer Project Ownership",
22479
+ description: "Transfer ownership atomically to an active member. Owner-only.",
22480
+ inputSchema: {
22481
+ ...siteIdShape,
22482
+ profileId: string().uuid()
22483
+ },
22484
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).team.transferOwnership(asString(input, "profileId"))
22485
+ },
22486
+ {
22487
+ name: "neopress_form_response_get",
22488
+ title: "Get Form Response",
22489
+ description: "Get one form response by form and response ID.",
22490
+ inputSchema: {
22491
+ ...siteIdShape,
22492
+ formId: number().int().positive(),
22493
+ responseId: number().int().positive()
22494
+ },
22495
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).forms.getResponse(asNumber(input, "formId"), asNumber(input, "responseId"))
22496
+ },
22497
+ {
22498
+ name: "neopress_form_response_mark_read",
22499
+ title: "Mark Form Response Read",
22500
+ description: "Mark one form response as read.",
22501
+ inputSchema: {
22502
+ ...siteIdShape,
22503
+ formId: number().int().positive(),
22504
+ responseId: number().int().positive()
22505
+ },
22506
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).forms.markResponseRead(asNumber(input, "formId"), asNumber(input, "responseId"))
22507
+ },
22508
+ {
22509
+ name: "neopress_form_response_delete",
22510
+ title: "Delete Form Response",
22511
+ description: "Soft-delete one form response.",
22512
+ inputSchema: {
22513
+ ...siteIdShape,
22514
+ formId: number().int().positive(),
22515
+ responseId: number().int().positive()
22516
+ },
22517
+ handler: async (input, context, extra) => {
22518
+ await (await context.createClient({ siteId: siteId(input) }, extra)).forms.deleteResponse(asNumber(input, "formId"), asNumber(input, "responseId"));
22519
+ return { ok: true };
22520
+ }
22521
+ },
22522
+ {
22523
+ name: "neopress_history_snapshots_list",
22524
+ title: "List Site Snapshots",
22525
+ description: "List restorable page, layout, collection, and form snapshots.",
22526
+ inputSchema: {
22527
+ ...siteIdShape,
22528
+ limit: number().int().positive().max(100).optional()
22529
+ },
22530
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).history.list(asOptionalNumber(input, "limit"))
22531
+ },
22532
+ {
22533
+ name: "neopress_history_snapshot_get",
22534
+ title: "Get Site Snapshot",
22535
+ description: "Get one exact restorable snapshot and its stored data.",
22536
+ inputSchema: {
22537
+ ...siteIdShape,
22538
+ snapshotId: number().int().positive()
22539
+ },
22540
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).history.get(asNumber(input, "snapshotId"))
22541
+ },
22542
+ {
22543
+ name: "neopress_history_snapshot_restore",
22544
+ title: "Restore Site Snapshot",
22545
+ description: "Restore one exact page, layout, collection, or form snapshot. Draft state changes; page visibility and form settings may affect live behavior immediately.",
22546
+ inputSchema: {
22547
+ ...siteIdShape,
22548
+ snapshotId: number().int().positive()
22549
+ },
22550
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).history.restore(asNumber(input, "snapshotId"))
22551
+ },
22552
+ {
22553
+ name: "neopress_analytics_funnel_results",
22554
+ title: "Get Saved Funnel Results",
22555
+ description: "Get aggregate results for a saved funnel. Steps and filters are resolved from the tenant-owned definition.",
22556
+ inputSchema: {
22557
+ ...siteIdShape,
22558
+ funnelId: string().uuid(),
22559
+ dateFrom: string().optional(),
22560
+ dateTo: string().optional(),
22561
+ timezone: string().optional()
22562
+ },
22563
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).analytics.funnels.results(asString(input, "funnelId"), {
22564
+ dateFrom: asOptionalString(input, "dateFrom"),
22565
+ dateTo: asOptionalString(input, "dateTo"),
22566
+ timezone: asOptionalString(input, "timezone")
22567
+ })
22568
+ },
22138
22569
  {
22139
22570
  name: "neopress_publish_preview",
22140
22571
  title: "Preview Site Publish",
@@ -22148,10 +22579,35 @@ const toolDefinitions = [
22148
22579
  name: "neopress_publish_site",
22149
22580
  title: "Publish Site",
22150
22581
  description: "Publish layout, pages, collections, and forms from draft to production. Does not publish draft entry rows.",
22151
- inputSchema: siteIdShape,
22582
+ inputSchema: {
22583
+ ...siteIdShape,
22584
+ selection: object$1({
22585
+ pageIds: array(number().int().positive()).optional(),
22586
+ collectionIds: array(number().int().positive()).optional(),
22587
+ formIds: array(number().int().positive()).optional(),
22588
+ includeLayout: boolean().optional()
22589
+ }).optional()
22590
+ },
22152
22591
  handler: async (input, context, extra) => {
22153
- return (await context.createClient({ siteId: siteId(input) }, extra)).publish.site();
22592
+ return (await context.createClient({ siteId: siteId(input) }, extra)).publish.site(input.selection);
22154
22593
  }
22594
+ },
22595
+ {
22596
+ name: "neopress_unpublish_pages",
22597
+ title: "Unpublish Site Pages",
22598
+ description: "Remove exact page IDs from production without deleting their draft state.",
22599
+ inputSchema: {
22600
+ ...siteIdShape,
22601
+ pageIds: array(number().int().positive()).min(1)
22602
+ },
22603
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).publish.unpublishPages(input.pageIds)
22604
+ },
22605
+ {
22606
+ name: "neopress_undeploy_site",
22607
+ title: "Undeploy Site",
22608
+ description: "Take the whole site offline while preserving draft state.",
22609
+ inputSchema: siteIdShape,
22610
+ handler: async (input, context, extra) => (await context.createClient({ siteId: siteId(input) }, extra)).publish.undeploy()
22155
22611
  }
22156
22612
  ];
22157
22613
  function registerNeopressTools(server, context = createDefaultToolContext(), options = {}) {