@ajsmonty/adobe-mcp 1.3.0 → 1.5.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.
@@ -0,0 +1,196 @@
1
+ // Shared helpers for the production tool set (ported from the Barrows/Derrin Byrne line of adobe-mcp,
2
+ // adapted to core/platform.mjs). CSV rows, safe names, ExtendScript literals, encoder presets,
3
+ // open-app detection and the Animate (JSFL) runner.
4
+ import fs from "node:fs";
5
+ import os from "node:os";
6
+ import path from "node:path";
7
+ import { IS_WIN, IS_MAC, adobeRoots, findAdobeInstallDirs, macAppName, runningProcesses, isAppRunning, run } from "./platform.mjs";
8
+
9
+ /** Embed a JS value in ExtendScript/JSFL source as a literal (JSON is a valid ES3 literal). */
10
+ export function lit(value) {
11
+ return JSON.stringify(value ?? null).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
12
+ }
13
+
14
+ /** Forward-slash path for ExtendScript File() on every OS. */
15
+ export const esPath = (p) => String(p).replace(/\\/g, "/");
16
+
17
+ /** Minimal RFC-4180 CSV/TSV parser. Returns array of row objects keyed by header. */
18
+ export function parseCsv(textIn) {
19
+ let textData = textIn.replace(/^\uFEFF/, "");
20
+ const firstLine = textData.split(/\r?\n/, 1)[0] || "";
21
+ const delim = (firstLine.match(/\t/g) || []).length > (firstLine.match(/,/g) || []).length ? "\t" : ",";
22
+ const rows = [];
23
+ let row = [], field = "", q = false;
24
+ for (let i = 0; i < textData.length; i++) {
25
+ const c = textData[i];
26
+ if (q) {
27
+ if (c === '"' && textData[i + 1] === '"') { field += '"'; i++; }
28
+ else if (c === '"') q = false;
29
+ else field += c;
30
+ } else if (c === '"') q = true;
31
+ else if (c === delim) { row.push(field); field = ""; }
32
+ else if (c === "\n" || c === "\r") {
33
+ if (c === "\r" && textData[i + 1] === "\n") i++;
34
+ row.push(field); field = "";
35
+ if (row.some((f) => f !== "")) rows.push(row);
36
+ row = [];
37
+ } else field += c;
38
+ }
39
+ row.push(field);
40
+ if (row.some((f) => f !== "")) rows.push(row);
41
+ if (!rows.length) return [];
42
+ const header = rows[0].map((h) => h.trim());
43
+ return rows.slice(1).map((r) => Object.fromEntries(header.map((h, i) => [h, (r[i] ?? "").trim()])));
44
+ }
45
+
46
+ /** Rows from either an inline array or a CSV/TSV file path. */
47
+ export function loadRows({ rows, csv_path }) {
48
+ if (Array.isArray(rows) && rows.length) return rows;
49
+ if (csv_path) return parseCsv(fs.readFileSync(csv_path, "utf8"));
50
+ throw new Error("Provide rows (array of objects) or csv_path.");
51
+ }
52
+
53
+ export function safeName(s, fallback = "item") {
54
+ const out = String(s ?? "").replace(/[\\/:*?"<>|\u0000-\u001f]+/g, "_").replace(/\s+/g, " ").trim().slice(0, 120);
55
+ return out || fallback;
56
+ }
57
+
58
+ /** Walk a folder (depth-limited), return file paths. */
59
+ export function walk(dir, { maxDepth = 8, maxFiles = 50000, filter } = {}) {
60
+ const out = [];
61
+ const go = (d, depth) => {
62
+ if (depth > maxDepth || out.length >= maxFiles) return;
63
+ let entries = [];
64
+ try { entries = fs.readdirSync(d, { withFileTypes: true }); } catch { return; }
65
+ for (const e of entries) {
66
+ if (e.name.startsWith(".")) continue;
67
+ const full = path.join(d, e.name);
68
+ if (e.isDirectory()) go(full, depth + 1);
69
+ else if (!filter || filter(full)) out.push(full);
70
+ if (out.length >= maxFiles) return;
71
+ }
72
+ };
73
+ go(dir, 0);
74
+ return out;
75
+ }
76
+
77
+ /** Find Adobe encoder presets (.epr) by name or path. Searches app folders + user preset folders. */
78
+ export function findEprPresets(query) {
79
+ if (query && /\.epr$/i.test(query) && fs.existsSync(query)) return [query];
80
+ const roots = [];
81
+ for (const root of adobeRoots()) {
82
+ try {
83
+ for (const d of fs.readdirSync(root)) if (/Premiere Pro|Media Encoder/i.test(d)) roots.push(path.join(root, d));
84
+ } catch { /* ignore */ }
85
+ }
86
+ const docs = path.join(os.homedir(), "Documents", "Adobe");
87
+ for (const sub of ["Adobe Media Encoder", "Premiere Pro"]) roots.push(path.join(docs, sub));
88
+ const all = [];
89
+ for (const r of roots) all.push(...walk(r, { maxDepth: 9, maxFiles: 20000, filter: (f) => /\.epr$/i.test(f) }));
90
+ if (!query) return all;
91
+ const q = query.toLowerCase().replace(/\.epr$/, "");
92
+ const exact = all.filter((f) => path.basename(f, ".epr").toLowerCase() === q);
93
+ return exact.length ? exact : all.filter((f) => path.basename(f).toLowerCase().includes(q));
94
+ }
95
+
96
+ export function resolvePreset(query, fallbackTest) {
97
+ const found = findEprPresets(query);
98
+ if (query && found.length) return found[0];
99
+ if (query) {
100
+ const names = [...new Set(findEprPresets().map((f) => path.basename(f, ".epr")))].slice(0, 60);
101
+ throw new Error(`No encoder preset matching "${query}". Some available: ${names.join(", ") || "(none found — pass a full .epr path)"}`);
102
+ }
103
+ const fb = findEprPresets().find(fallbackTest || ((f) => /Match Source.*High bitrate/i.test(f)));
104
+ if (!fb) throw new Error("No encoder preset found — pass preset (a name or full .epr path).");
105
+ return fb;
106
+ }
107
+
108
+ /** Which Adobe apps are open right now ({ae: true, ps: false, ...}); all false if the process list can't be read. */
109
+ export async function runningApps() {
110
+ const procs = await runningProcesses();
111
+ const res = {};
112
+ for (const k of ["ae", "ps", "ai", "id", "ppro", "an", "ame"]) res[k] = !!(await isAppRunning(k, procs));
113
+ return res;
114
+ }
115
+
116
+ // ---------------------------------------------------------------------------
117
+ // Animate (JSFL). Animate has no AppleScript/COM entry point; it runs a .jsfl
118
+ // file handed to it on the command line, so results come back via a file.
119
+ // ---------------------------------------------------------------------------
120
+ const JSFL_HARNESS = `(function () {
121
+ function __q(s) { s = String(s); var o = '"'; for (var i = 0; i < s.length; i++) { var c = s.charAt(i), n = s.charCodeAt(i);
122
+ if (c == '"') o += '\\\\"'; else if (c == '\\\\') o += '\\\\\\\\'; else if (c == '\\n') o += '\\\\n'; else if (c == '\\r') o += '\\\\r';
123
+ else if (c == '\\t') o += '\\\\t'; else if (n < 32) o += ' '; else o += c; } return o + '"'; }
124
+ function __json(v, d) { d = d || 0; if (d > 8) return '"[max depth]"'; if (v === null || v === undefined) return 'null';
125
+ var t = typeof v; if (t == 'number') return isFinite(v) ? String(v) : 'null'; if (t == 'boolean') return String(v);
126
+ if (t == 'string') return __q(v); if (t == 'function') return '"[function]"';
127
+ if (v instanceof Array) { var a = []; for (var i = 0; i < v.length; i++) a.push(__json(v[i], d + 1)); return '[' + a.join(',') + ']'; }
128
+ var p = []; for (var k in v) { try { p.push(__q(k) + ':' + __json(v[k], d + 1)); } catch (e) {} } return '{' + p.join(',') + '}'; }
129
+ var __out;
130
+ try { var __r = (function () {
131
+ __USER_CODE__
132
+ })(); __out = '{"ok":true,"result":' + __json(__r) + '}'; }
133
+ catch (e) { __out = '{"ok":false,"error":' + __q(e) + ',"line":' + (Number(e.lineNumber) || 0) + '}'; }
134
+ FLfile.write(FLfile.platformPathToURI(__RESULT_PATH__), __out);
135
+ })();
136
+ `;
137
+
138
+ /** Animate's launcher: Animate.exe on Windows, the .app bundle on macOS (null if not installed). */
139
+ export function animateLocation() {
140
+ if (IS_WIN) {
141
+ if (process.env.AN_EXE) return process.env.AN_EXE;
142
+ for (const d of findAdobeInstallDirs(/^Adobe Animate/i).reverse()) {
143
+ const exe = path.join(d, "Animate.exe");
144
+ if (fs.existsSync(exe)) return exe;
145
+ }
146
+ return null;
147
+ }
148
+ if (!IS_MAC) return null;
149
+ if (process.env.AN_APP_PATH) return process.env.AN_APP_PATH;
150
+ const name = macAppName(/^Adobe Animate/i, null, "AN_APP_NAME");
151
+ if (!name) return null;
152
+ for (const p of [`/Applications/${name}/${name}.app`, `/Applications/${name}.app`]) if (fs.existsSync(p)) return p;
153
+ return null;
154
+ }
155
+
156
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
157
+
158
+ export async function runJSFL(userCode, timeoutMs = 120000) {
159
+ const stamp = `${Date.now()}_${Math.floor(Math.random() * 1e6)}`;
160
+ const resultPath = path.join(os.tmpdir(), `adobe_mcp_result_an_${stamp}.json`);
161
+ const scriptPath = path.join(os.tmpdir(), `adobe_mcp_script_an_${stamp}.jsfl`);
162
+ const loc = animateLocation();
163
+ if (!loc)
164
+ throw new Error(
165
+ IS_WIN
166
+ ? "Could not find Animate.exe under Program Files\\Adobe. Set AN_EXE to its full path."
167
+ : IS_MAC
168
+ ? "Could not find Adobe Animate in /Applications. Set AN_APP_PATH to the .app path."
169
+ : "Adobe Animate needs macOS or Windows."
170
+ );
171
+ // UTF-8 BOM so Animate reads non-ASCII paths and text correctly; the result path is ASCII-escaped too.
172
+ fs.writeFileSync(
173
+ scriptPath,
174
+ "\uFEFF" + JSFL_HARNESS.replace("__RESULT_PATH__", () => lit(resultPath).replace(/[\u007f-\uffff]/g, (c) => "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0"))).replace("__USER_CODE__", () => userCode),
175
+ "utf8"
176
+ );
177
+ const r = IS_WIN
178
+ ? await run(loc, [scriptPath], { timeout: Math.min(timeoutMs, 60000) })
179
+ : await run("open", ["-a", loc, scriptPath], { timeout: 30000 });
180
+ if (!r.ok && !r.err?.killed) throw new Error(`Could not hand the script to Animate: ${(r.stderr || r.err?.message || "").trim()}`);
181
+ const deadline = Date.now() + timeoutMs;
182
+ while (Date.now() < deadline) {
183
+ if (fs.existsSync(resultPath)) {
184
+ const raw = fs.readFileSync(resultPath, "utf8");
185
+ if (raw.length) {
186
+ fs.rmSync(resultPath, { force: true });
187
+ fs.rmSync(scriptPath, { force: true });
188
+ const parsed = JSON.parse(raw);
189
+ if (!parsed.ok) throw new Error(`JSFL error${parsed.line ? ` (line ${parsed.line})` : ""}: ${parsed.error}`);
190
+ return parsed.result;
191
+ }
192
+ }
193
+ await sleep(150);
194
+ }
195
+ throw new Error(`Animate did not return a result within ${timeoutMs / 1000}s. Is Animate open, with no dialog showing? Script kept: ${scriptPath}`);
196
+ }
package/core/platform.mjs CHANGED
@@ -75,6 +75,7 @@ export function aeExecutable() {
75
75
  export const COM_PROGIDS = {
76
76
  ps: () => process.env.PS_COM_PROGID || "Photoshop.Application",
77
77
  ai: () => process.env.AI_COM_PROGID || "Illustrator.Application",
78
+ id: () => process.env.ID_COM_PROGID || "InDesign.Application",
78
79
  };
79
80
 
80
81
  /** Per-user CEP extensions folder (no admin rights needed). */
@@ -127,6 +128,9 @@ export const PROCESS_NAMES = {
127
128
  ch: IS_WIN ? ["character animator.exe"] : ["character animator"],
128
129
  blender: IS_WIN ? ["blender.exe"] : ["blender"],
129
130
  substance: IS_WIN ? ["adobe substance 3d painter.exe"] : ["adobe substance 3d painter"],
131
+ id: IS_WIN ? ["indesign.exe"] : ["adobe indesign"],
132
+ an: IS_WIN ? ["animate.exe"] : ["adobe animate"],
133
+ ame: IS_WIN ? ["adobe media encoder.exe"] : ["adobe media encoder"],
130
134
  };
131
135
 
132
136
  /** true / false, or null when the process list is unavailable (callers must not block on null). */
@@ -1,6 +1,7 @@
1
- // Windows Script Host (JScript) runner: hands a .jsx file to Photoshop or Illustrator
2
- // through their COM automation servers. Run with: cscript //nologo run_com.js <ProgID> <file.jsx>
3
- // DoJavaScriptFile is synchronous, so this returns once the script has finished.
1
+ // Windows Script Host (JScript) runner: hands a .jsx file to Photoshop, Illustrator or InDesign
2
+ // through their COM automation servers.
3
+ // Usage: cscript //nologo run_com.js <ProgID> <file.jsx> [doscript] ("doscript" for InDesign).
4
+ // DoJavaScriptFile / DoScript are synchronous, so this returns once the script has finished.
4
5
  var args = WScript.Arguments;
5
6
  if (args.length < 2) {
6
7
  WScript.StdErr.WriteLine("usage: run_com.js <ProgID> <script.jsx>");
@@ -8,6 +9,7 @@ if (args.length < 2) {
8
9
  }
9
10
  var progId = args(0);
10
11
  var file = args(1);
12
+ var mode = args.length > 2 ? args(2) : "";
11
13
  var app;
12
14
  try {
13
15
  app = new ActiveXObject(progId);
@@ -18,7 +20,13 @@ try {
18
20
  try {
19
21
  // Arguments/ExecutionMode are left at their defaults: a JScript array is not a COM
20
22
  // SAFEARRAY, and the harness wraps user code in try/catch so the debugger never opens.
21
- app.DoJavaScriptFile(file);
23
+ if (mode === "doscript") {
24
+ // InDesign: DoScript treats a string as script source, so hand it a one-line evalFile.
25
+ // 1246973031 = ScriptLanguage.idJavascript.
26
+ var p = file.replace(/\\/g, "/").replace(/"/g, '\\"');
27
+ app.DoScript('$.evalFile(new File("' + p + '"))', 1246973031);
28
+ }
29
+ else app.DoJavaScriptFile(file);
22
30
  } catch (e) {
23
31
  WScript.StdErr.WriteLine("COM_CALL_FAILED 0x" + (e.number >>> 0).toString(16) + " " + e.message);
24
32
  WScript.Quit(4);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ajsmonty/adobe-mcp",
3
- "version": "1.3.0",
4
- "description": "MCP server for After Effects, Photoshop, Illustrator, Premiere Pro, Character Animator, Blender and Substance 3D Painter: 41 tools for AI automation from Claude, Cursor or any MCP client (macOS + Windows)",
3
+ "version": "1.5.0",
4
+ "description": "MCP server for After Effects, Photoshop, Illustrator, InDesign, Premiere Pro, Media Encoder, Animate, Character Animator, Blender and Substance 3D Painter: 72 tools for AI automation from Claude, Cursor or any MCP client (macOS + Windows)",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "adobe-mcp": "server.mjs"
@@ -44,6 +44,16 @@
44
44
  "premiere",
45
45
  "adobe-premiere-pro",
46
46
  "premiere-pro-mcp",
47
+ "indesign",
48
+ "adobe-indesign",
49
+ "indesign-mcp",
50
+ "media-encoder",
51
+ "adobe-media-encoder",
52
+ "animate",
53
+ "adobe-animate",
54
+ "data-merge",
55
+ "templates",
56
+ "batch-export",
47
57
  "character-animator",
48
58
  "adobe-character-animator",
49
59
  "blender",
@@ -75,6 +85,7 @@
75
85
  "bridges/",
76
86
  "scripts/",
77
87
  "cep/",
88
+ "CHANGELOG.md",
78
89
  "README.md",
79
90
  "LICENSE",
80
91
  "SECURITY.md"
package/server.mjs CHANGED
@@ -6,6 +6,9 @@
6
6
  * Bridges MCP tool calls into each app's scripting engine:
7
7
  * AE → macOS: osascript DoScript · Windows: AfterFX.exe -r → ExtendScript
8
8
  * Photoshop / Illus. → macOS: osascript do javascript · Windows: COM DoJavaScriptFile → ExtendScript
9
+ * InDesign → macOS: osascript do script · Windows: COM DoScript → ExtendScript
10
+ * Animate → .jsfl handed to Animate on the command line (result via file)
11
+ * Media Encoder → through Premiere's app.encoder (ame_* tools)
9
12
  * Premiere Pro → mcp-bridge CEP panel (command-file handoff, both OSes)
10
13
  * Character Animator → integrated around (PSD puppet authoring via Photoshop)
11
14
  * Blender → Python (bpy) via live add-on socket or headless background process
@@ -32,21 +35,28 @@ const { McpServer } = await import("@modelcontextprotocol/sdk/server/mcp.js");
32
35
  const { StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js");
33
36
  const { register: registerWorkflow, makeRegisterAsset } = await import("./workflow/workflow.mjs");
34
37
  const { register: registerKnowledge, instructionsDigest } = await import("./knowledge/knowledge.mjs");
38
+ const { register: registerSetup } = await import("./workflow/setup.mjs");
35
39
  const { instrument } = await import("./core/telemetry.mjs");
36
40
 
37
- /** Tool sets that can be switched with ADOBE_MCP_APPS. Workflow + knowledge are always on. */
41
+ /** Tool sets that can be switched with ADOBE_MCP_APPS: each is a list of [module, export]. Workflow + knowledge are always on. */
38
42
  export const MODULES = {
39
- ae: "./adapters/ae.mjs",
40
- ps: "./adapters/ps.mjs",
41
- ai: "./adapters/ai.mjs",
42
- ppro: "./adapters/ppro.mjs",
43
- ch: "./adapters/ch.mjs",
44
- blender: "./adapters/blender.mjs",
45
- substance: "./adapters/substance.mjs",
46
- textures: "./adapters/texlib.mjs",
47
- vfx: "./workflow/vfx.mjs",
43
+ ae: [["./adapters/ae.mjs", "register"], ["./adapters/ae_more.mjs", "register"]],
44
+ ps: [["./adapters/ps.mjs", "register"], ["./adapters/ps_ai_more.mjs", "registerPS"]],
45
+ ai: [["./adapters/ai.mjs", "register"], ["./adapters/ps_ai_more.mjs", "registerAI"]],
46
+ id: [["./adapters/id.mjs", "register"]],
47
+ ppro: [["./adapters/ppro.mjs", "register"], ["./adapters/ppro_more.mjs", "register"]],
48
+ an: [["./adapters/an.mjs", "register"]],
49
+ ch: [["./adapters/ch.mjs", "register"]],
50
+ blender: [["./adapters/blender.mjs", "register"]],
51
+ substance: [["./adapters/substance.mjs", "register"]],
52
+ textures: [["./adapters/texlib.mjs", "register"]],
53
+ vfx: [["./workflow/vfx.mjs", "register"]],
54
+ files: [["./adapters/assets.mjs", "register"]],
55
+ };
56
+ const ALIASES = {
57
+ aftereffects: "ae", photoshop: "ps", illustrator: "ai", indesign: "id", premiere: "ppro", premierepro: "ppro",
58
+ mediaencoder: "ppro", ame: "ppro", animate: "an", characteranimator: "ch", texlib: "textures", assets: "files",
48
59
  };
49
- const ALIASES = { aftereffects: "ae", photoshop: "ps", illustrator: "ai", premiere: "ppro", characteranimator: "ch", texlib: "textures" };
50
60
 
51
61
  function enabledModules(spec = process.env.ADOBE_MCP_APPS) {
52
62
  if (!spec || !spec.trim() || spec.trim() === "all") return Object.keys(MODULES);
@@ -66,6 +76,18 @@ const enabled = enabledModules();
66
76
  const server = new McpServer({ name: "adobe-mcp", version: PKG.version }, { instructions: instructionsDigest() });
67
77
  const flush = instrument(server, { version: PKG.version, apps: enabled });
68
78
 
79
+ // When the Barrows AE Bridge extension is installed, hide our basic After Effects tools that it
80
+ // covers, so Claude doesn't get two overlapping sets. Our other AE tools stay.
81
+ const { barrowsInstalled, SUPERSEDED_BY_BARROWS } = await import("./core/barrows.mjs");
82
+ if (barrowsInstalled()) {
83
+ const reg = server.registerTool.bind(server);
84
+ server.registerTool = (name, def, handler) => {
85
+ const tool = reg(name, def, handler);
86
+ if (SUPERSEDED_BY_BARROWS.has(name)) tool.disable();
87
+ return tool;
88
+ };
89
+ }
90
+
69
91
  const ctx = {
70
92
  text: (obj) => ({
71
93
  content: [{ type: "text", text: typeof obj === "string" ? obj : JSON.stringify(obj, null, 2) }],
@@ -77,9 +99,10 @@ const ctx = {
77
99
  registerAsset: makeRegisterAsset(),
78
100
  };
79
101
 
80
- for (const k of enabled) (await import(MODULES[k])).register(server, ctx);
102
+ for (const k of enabled) for (const [file, fn] of MODULES[k]) (await import(file))[fn](server, ctx);
81
103
  registerWorkflow(server, ctx);
82
104
  registerKnowledge(server, ctx);
105
+ registerSetup(server, ctx);
83
106
 
84
107
  const shutdown = async () => {
85
108
  await flush();
@@ -90,4 +113,4 @@ process.once("SIGTERM", shutdown);
90
113
  process.stdin.once("end", shutdown);
91
114
 
92
115
  await server.connect(new StdioServerTransport());
93
- console.error(`adobe-mcp ${PKG.version} ready on ${process.platform} (${enabled.join(", ")} + workflow + knowledge)`);
116
+ console.error(`adobe-mcp ${PKG.version} ready on ${process.platform} (${enabled.join(", ")} + workflow + knowledge + setup)`);
@@ -0,0 +1,106 @@
1
+ // Setup from inside the chat, for people who never open a terminal: the same checks and installer
2
+ // as `npx @ajsmonty/adobe-mcp doctor` / `install`, as tools, plus a guided prompt and release notes.
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import { z } from "zod";
7
+
8
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
9
+
10
+ /** The newest `count` sections of CHANGELOG.md (each starts with "## "). */
11
+ export function latestNotes(markdown, count = 1) {
12
+ const parts = markdown.split(/\n(?=## )/).filter((p) => p.startsWith("## "));
13
+ return parts.slice(0, Math.max(1, count)).join("\n").trim();
14
+ }
15
+
16
+ export function register(server, { text, errText }) {
17
+ server.registerTool(
18
+ "adobe_setup_check",
19
+ {
20
+ title: "Check Adobe setup",
21
+ description:
22
+ "Check this computer for everything the Adobe tools need: which Adobe apps (and Blender, Substance) are installed " +
23
+ "and running, the MCP Bridge panel for Premiere Pro and After Effects, PlayerDebugMode, After Effects' scripting " +
24
+ "preference, Windows COM, and the Barrows AE Bridge. Each problem comes with its fix. live: true also runs a " +
25
+ "one-line script in each open app. Start here when an Adobe tool fails or when someone asks to set things up.",
26
+ inputSchema: { live: z.boolean().optional().describe("Also run a real one-line script in each open app (default false).") },
27
+ },
28
+ async ({ live }) => {
29
+ try {
30
+ const { collectChecks } = await import("../cli/doctor.mjs");
31
+ const checks = await collectChecks({ live: !!live });
32
+ const problems = checks.filter((c) => c.status === "fail");
33
+ return text({ ready: problems.length === 0, problems: problems.length, checks });
34
+ } catch (e) {
35
+ return errText(e);
36
+ }
37
+ }
38
+ );
39
+
40
+ server.registerTool(
41
+ "adobe_install_panel",
42
+ {
43
+ title: "Install the MCP Bridge panel",
44
+ description:
45
+ "Install the MCP Bridge panel for Premiere Pro and After Effects and turn on PlayerDebugMode (needed for unsigned " +
46
+ "panels). Writes only to the user's own Adobe extensions folder and preferences. Premiere needs the panel; After " +
47
+ "Effects uses it when present (faster, and no scripting preference or Automation prompt). Ask the user before " +
48
+ "running it, and tell them to restart Premiere / After Effects afterwards.",
49
+ inputSchema: {
50
+ dry_run: z.boolean().optional().describe("Only report what would change (default false)."),
51
+ force: z.boolean().optional().describe("Install even if neither Premiere Pro nor After Effects is found."),
52
+ },
53
+ },
54
+ async ({ dry_run, force }) => {
55
+ try {
56
+ const { install } = await import("../cli/install.mjs");
57
+ const lines = [];
58
+ const sink = { log: (m) => lines.push(String(m).trim()), error: (m) => lines.push("ERROR: " + String(m).trim()) };
59
+ const code = await install({ "dry-run": !!dry_run, panel: !!force }, sink);
60
+ return text({ ok: code === 0, steps: lines.filter(Boolean) });
61
+ } catch (e) {
62
+ return errText(e);
63
+ }
64
+ }
65
+ );
66
+
67
+ server.registerTool(
68
+ "adobe_whats_new",
69
+ {
70
+ title: "What's new in adobe-mcp",
71
+ description: "Release notes for this version of the Adobe tools; versions > 1 also shows earlier releases.",
72
+ inputSchema: { versions: z.number().int().min(1).max(20).optional().describe("How many releases to show (default 1).") },
73
+ },
74
+ async ({ versions }) => {
75
+ try {
76
+ return text(latestNotes(fs.readFileSync(path.join(ROOT, "CHANGELOG.md"), "utf8"), versions ?? 1));
77
+ } catch (e) {
78
+ return errText(e);
79
+ }
80
+ }
81
+ );
82
+
83
+ server.registerPrompt(
84
+ "setup_adobe",
85
+ {
86
+ title: "Set up Adobe for Claude",
87
+ description: "Guided walkthrough: check this computer, then help finish the one-time setup.",
88
+ },
89
+ () => ({
90
+ messages: [
91
+ {
92
+ role: "user",
93
+ content: {
94
+ type: "text",
95
+ text:
96
+ "Help me set up the Adobe tools. Call adobe_setup_check, then explain what's ready and what isn't in plain " +
97
+ "words, one line per app I have installed. For each problem, give the fix. If the MCP Bridge panel is " +
98
+ "missing or out of date, offer to run adobe_install_panel, and only run it if I say yes. Things I must do " +
99
+ "inside an Adobe app (a preference, restarting it), give me the exact menu path. Finish by suggesting one " +
100
+ "small thing to try in an app that's ready.",
101
+ },
102
+ },
103
+ ],
104
+ })
105
+ );
106
+ }