@prontosite/mcp 0.3.0 → 0.3.1

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 (3) hide show
  1. package/api.mjs +2 -1
  2. package/index.mjs +8 -4
  3. package/package.json +1 -1
package/api.mjs CHANGED
@@ -117,7 +117,7 @@ export async function apiExport(cfg, { site, which = "published", outDir = "." }
117
117
  }
118
118
 
119
119
  /** POST /api/deploy/<site> – ZIP übergeben (+ optional publish/resetOverlay/legal). site="new" = anlegen. */
120
- export async function apiDeploy(cfg, { site, customer = null, zipPath, publish = false, resetOverlay = false, legal = null } = {}, fetchImpl = fetch) {
120
+ export async function apiDeploy(cfg, { site, customer = null, slug: wishSlug = null, zipPath, publish = false, resetOverlay = false, legal = null } = {}, fetchImpl = fetch) {
121
121
  if (!zipPath || !fs.existsSync(zipPath)) throw new Error(`ZIP nicht gefunden: ${zipPath}`);
122
122
  const { token, slug } = resolveTarget(cfg, site);
123
123
  const q = new URLSearchParams();
@@ -126,6 +126,7 @@ export async function apiDeploy(cfg, { site, customer = null, zipPath, publish =
126
126
  if (legal === true) q.set("legal", "1");
127
127
  if (legal === false) q.set("legal", "0");
128
128
  if (customer) q.set("customer", customer); // Betreuer-Token + site="new": Ziel-Konto für den Erst-Import
129
+ if (wishSlug) q.set("slug", String(wishSlug)); // Erst-Import: Wunsch-Adresse (sonst wird sie abgeleitet)
129
130
  const qs = q.toString() ? `?${q}` : "";
130
131
  const res = await fetchImpl(`${baseUrl(cfg)}/deploy/${encodeURIComponent(slug)}${qs}`, {
131
132
  method: "POST", headers: { ...authHeaders(token), "content-type": "application/zip" }, body: fs.readFileSync(zipPath) });
package/index.mjs CHANGED
@@ -14,7 +14,7 @@ import { z } from "zod";
14
14
  import { loadConfig, apiStatus, apiExport, apiDeploy, apiPublish, sitesList } from "./api.mjs";
15
15
 
16
16
  const cfg = loadConfig();
17
- const server = new McpServer({ name: "prontosite", version: "0.2.1" });
17
+ const server = new McpServer({ name: "prontosite", version: "0.3.1" });
18
18
  const asText = obj => ({ content: [{ type: "text", text: JSON.stringify(obj, null, 2) }] });
19
19
  const asError = e => ({ isError: true, content: [{ type: "text", text: "Fehler: " + (e?.message || String(e)) }] });
20
20
  const SITE_DESC = "Website-Slug (z. B. 'mas-monti'). Ohne Angabe die Standard-Site der Config. Bei Betreuer-"
@@ -51,15 +51,19 @@ server.tool(
51
51
  "SCHREIBEND: Übergibt eine lokale ZIP-Datei an ProntoSite (Import). Mit publish=true wird die Website "
52
52
  + "DIREKT LIVE geschaltet und der bestehende Live-Stand überschrieben. ERST-IMPORT (neue Website): "
53
53
  + "Einzel-Config site='new'; Multi-Site/Betreuer site='<label>:new' (legt im Konto DES LABELS an). "
54
- + "Bitte VOR dem Aufruf bestätigen lassen – und die richtige Website prüfen.",
54
+ + "WICHTIG beim ERST-IMPORT: Frag den Nutzer VOR dem Deploy nach der gewünschten Adresse "
55
+ + "(„Unter welcher Adresse soll die Website laufen?“, z. B. 'wuerttemberg' → wuerttemberg.prontosite.io) "
56
+ + "und übergib sie als slug – ohne slug wird die Adresse nur aus Konto-/Seitenname ABGELEITET (die Antwort "
57
+ + "nennt dann die abgeleitete Adresse; sie ist später änderbar). Bitte VOR dem Aufruf bestätigen lassen.",
55
58
  { site: z.string().optional().describe(SITE_DESC + " Erst-Import: 'new' (Einzel) bzw. '<label>:new' (Multi-Site)."),
59
+ slug: z.string().optional().describe("Erst-Import: gewünschte Web-Adresse (Subdomain-Label, z. B. 'wuerttemberg' → wuerttemberg.prontosite.io). Beim Erst-Import den Nutzer danach FRAGEN; wird sie weggelassen, leitet ProntoSite eine Adresse ab. Bei Updates ignoriert."),
56
60
  customer: z.string().optional().describe("Nur Betreuer-Token + Erst-Import mit EINEM Manager-Token: Ziel-Konto-ID (k-…). Bei per-Konto-Token in der sites-Map genügt '<label>:new'."),
57
61
  zipPath: z.string().describe("Pfad zur ZIP-Datei der Website (lokal)."),
58
62
  publish: z.boolean().default(false).describe("true = nach dem Import direkt veröffentlichen (LIVE)."),
59
63
  resetOverlay: z.boolean().default(false).describe("true = bisherige Dashboard-Änderungen verwerfen."),
60
64
  legal: z.boolean().optional().describe("Rechts-Automatik (Impressum/Datenschutz): true erzwingt, false schaltet ab.") },
61
- async ({ site, customer, zipPath, publish, resetOverlay, legal }) => {
62
- try { return asText(await apiDeploy(cfg, { site, customer, zipPath, publish, resetOverlay, legal })); } catch (e) { return asError(e); }
65
+ async ({ site, slug, customer, zipPath, publish, resetOverlay, legal }) => {
66
+ try { return asText(await apiDeploy(cfg, { site, slug, customer, zipPath, publish, resetOverlay, legal })); } catch (e) { return asError(e); }
63
67
  }
64
68
  );
65
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prontosite/mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "MCP-Server für ProntoSite – Website-Status, Export, Deploy und Veröffentlichen direkt aus einem KI-Assistenten (Claude Desktop). Dünner Client um die ProntoSite Deploy-API.",
5
5
  "type": "module",
6
6
  "bin": { "prontosite-mcp": "index.mjs" },