@webiny/mcp 6.3.0 → 6.4.0-beta.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.
package/agents/claude.js CHANGED
@@ -1,39 +1,28 @@
1
- /**
2
- * Agent adapter: Claude Code
3
- *
4
- * MCP config : .mcp.json (project-level, checked into git)
5
- * Hint file : CLAUDE.md (Claude Code reads this automatically each session)
6
- *
7
- * Docs: https://docs.anthropic.com/en/docs/claude-code/mcp
8
- */
9
-
10
1
  import { join } from "path";
11
- import { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from "./shared.js";
12
- export const preset = {
13
- slug: "claude",
14
- displayName: "Claude Code",
15
- configFile: ".mcp.json",
16
- hintFile: "CLAUDE.md"
2
+ import { printDone, webinyHintBlock, writeHintFile, writeMcpConfig } from "./shared.js";
3
+ const preset = {
4
+ slug: "claude",
5
+ displayName: "Claude Code",
6
+ configFile: ".mcp.json",
7
+ hintFile: "CLAUDE.md"
17
8
  };
18
- export async function init({
19
- ui,
20
- cwd
21
- }) {
22
- ui.info("Setting up for Claude Code...");
23
- writeMcpConfig({
24
- ui,
25
- configPath: join(cwd, ".mcp.json")
26
- });
27
- writeHintFile({
28
- ui,
29
- hintPath: join(cwd, "CLAUDE.md"),
30
- content: webinyHintBlock({
31
- heading: "## Webiny"
32
- })
33
- });
34
- printDone({
35
- ui
36
- });
9
+ async function init({ ui, cwd }) {
10
+ ui.info("Setting up for Claude Code...");
11
+ writeMcpConfig({
12
+ ui,
13
+ configPath: join(cwd, ".mcp.json")
14
+ });
15
+ writeHintFile({
16
+ ui,
17
+ hintPath: join(cwd, "CLAUDE.md"),
18
+ content: webinyHintBlock({
19
+ heading: "## Webiny"
20
+ })
21
+ });
22
+ printDone({
23
+ ui
24
+ });
37
25
  }
26
+ export { init, preset };
38
27
 
39
28
  //# sourceMappingURL=claude.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["join","writeMcpConfig","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","hintFile","init","ui","cwd","info","configPath","hintPath","content","heading"],"sources":["claude.ts"],"sourcesContent":["/**\n * Agent adapter: Claude Code\n *\n * MCP config : .mcp.json (project-level, checked into git)\n * Hint file : CLAUDE.md (Claude Code reads this automatically each session)\n *\n * Docs: https://docs.anthropic.com/en/docs/claude-code/mcp\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"claude\",\n displayName: \"Claude Code\",\n configFile: \".mcp.json\",\n hintFile: \"CLAUDE.md\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Claude Code...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \"CLAUDE.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,MAAM;AAG3B,SAASC,cAAc,EAAEC,aAAa,EAAEC,eAAe,EAAEC,SAAS;AAElE,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,QAAQ;EACdC,WAAW,EAAE,aAAa;EAC1BC,UAAU,EAAE,WAAW;EACvBC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,+BAA+B,CAAC;EAExCZ,cAAc,CAAC;IACXU,EAAE;IACFG,UAAU,EAAEd,IAAI,CAACY,GAAG,EAAE,WAAW;EACrC,CAAC,CAAC;EAEFV,aAAa,CAAC;IACVS,EAAE;IACFI,QAAQ,EAAEf,IAAI,CAACY,GAAG,EAAE,WAAW,CAAC;IAChCI,OAAO,EAAEb,eAAe,CAAC;MAAEc,OAAO,EAAE;IAAY,CAAC;EACrD,CAAC,CAAC;EAEFb,SAAS,CAAC;IAAEO;EAAG,CAAC,CAAC;AACrB","ignoreList":[]}
1
+ {"version":3,"file":"agents/claude.js","sources":["../../src/agents/claude.ts"],"sourcesContent":["/**\n * Agent adapter: Claude Code\n *\n * MCP config : .mcp.json (project-level, checked into git)\n * Hint file : CLAUDE.md (Claude Code reads this automatically each session)\n *\n * Docs: https://docs.anthropic.com/en/docs/claude-code/mcp\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"claude\",\n displayName: \"Claude Code\",\n configFile: \".mcp.json\",\n hintFile: \"CLAUDE.md\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Claude Code...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \"CLAUDE.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"names":["preset","init","ui","cwd","writeMcpConfig","join","writeHintFile","webinyHintBlock","printDone"],"mappings":";;AAcO,MAAMA,SAAsB;IAC/B,MAAM;IACN,aAAa;IACb,YAAY;IACZ,UAAU;AACd;AAOO,eAAeC,KAAK,EAAEC,EAAE,EAAEC,GAAG,EAAc;IAC9CD,GAAG,IAAI,CAAC;IAERE,eAAe;QACXF;QACA,YAAYG,KAAKF,KAAK;IAC1B;IAEAG,cAAc;QACVJ;QACA,UAAUG,KAAKF,KAAK;QACpB,SAASI,gBAAgB;YAAE,SAAS;QAAY;IACpD;IAEAC,UAAU;QAAEN;IAAG;AACnB"}
package/agents/cline.js CHANGED
@@ -1,35 +1,22 @@
1
- /**
2
- * Agent adapter: Cline
3
- *
4
- * MCP config : .vscode/cline_mcp_settings.json (project-level)
5
- *
6
- * Cline reads instructions from its system prompt in settings,
7
- * so we only write the MCP config file.
8
- *
9
- * Docs: https://docs.cline.bot/mcp-servers/configuring-mcp-servers
10
- */
11
-
12
1
  import { join } from "path";
13
- import { writeMcpConfig, printDone } from "./shared.js";
14
- export const preset = {
15
- slug: "cline",
16
- displayName: "Cline",
17
- configFile: ".vscode/cline_mcp_settings.json",
18
- hintNote: "system prompt in settings"
2
+ import { printDone, writeMcpConfig } from "./shared.js";
3
+ const preset = {
4
+ slug: "cline",
5
+ displayName: "Cline",
6
+ configFile: ".vscode/cline_mcp_settings.json",
7
+ hintNote: "system prompt in settings"
19
8
  };
20
- export async function init({
21
- ui,
22
- cwd
23
- }) {
24
- ui.info("Setting up for Cline...");
25
- writeMcpConfig({
26
- ui,
27
- configPath: join(cwd, ".vscode", "cline_mcp_settings.json")
28
- });
29
- printDone({
30
- ui,
31
- extra: "Add Webiny instructions to Cline's system prompt in settings manually."
32
- });
9
+ async function init({ ui, cwd }) {
10
+ ui.info("Setting up for Cline...");
11
+ writeMcpConfig({
12
+ ui,
13
+ configPath: join(cwd, ".vscode", "cline_mcp_settings.json")
14
+ });
15
+ printDone({
16
+ ui,
17
+ extra: "Add Webiny instructions to Cline's system prompt in settings manually."
18
+ });
33
19
  }
20
+ export { init, preset };
34
21
 
35
22
  //# sourceMappingURL=cline.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["join","writeMcpConfig","printDone","preset","slug","displayName","configFile","hintNote","init","ui","cwd","info","configPath","extra"],"sources":["cline.ts"],"sourcesContent":["/**\n * Agent adapter: Cline\n *\n * MCP config : .vscode/cline_mcp_settings.json (project-level)\n *\n * Cline reads instructions from its system prompt in settings,\n * so we only write the MCP config file.\n *\n * Docs: https://docs.cline.bot/mcp-servers/configuring-mcp-servers\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"cline\",\n displayName: \"Cline\",\n configFile: \".vscode/cline_mcp_settings.json\",\n hintNote: \"system prompt in settings\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Cline...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".vscode\", \"cline_mcp_settings.json\")\n });\n\n printDone({\n ui,\n extra: \"Add Webiny instructions to Cline's system prompt in settings manually.\"\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,MAAM;AAG3B,SAASC,cAAc,EAAEC,SAAS;AAElC,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,OAAO;EACpBC,UAAU,EAAE,iCAAiC;EAC7CC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,yBAAyB,CAAC;EAElCV,cAAc,CAAC;IACXQ,EAAE;IACFG,UAAU,EAAEZ,IAAI,CAACU,GAAG,EAAE,SAAS,EAAE,yBAAyB;EAC9D,CAAC,CAAC;EAEFR,SAAS,CAAC;IACNO,EAAE;IACFI,KAAK,EAAE;EACX,CAAC,CAAC;AACN","ignoreList":[]}
1
+ {"version":3,"file":"agents/cline.js","sources":["../../src/agents/cline.ts"],"sourcesContent":["/**\n * Agent adapter: Cline\n *\n * MCP config : .vscode/cline_mcp_settings.json (project-level)\n *\n * Cline reads instructions from its system prompt in settings,\n * so we only write the MCP config file.\n *\n * Docs: https://docs.cline.bot/mcp-servers/configuring-mcp-servers\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"cline\",\n displayName: \"Cline\",\n configFile: \".vscode/cline_mcp_settings.json\",\n hintNote: \"system prompt in settings\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Cline...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".vscode\", \"cline_mcp_settings.json\")\n });\n\n printDone({\n ui,\n extra: \"Add Webiny instructions to Cline's system prompt in settings manually.\"\n });\n}\n"],"names":["preset","init","ui","cwd","writeMcpConfig","join","printDone"],"mappings":";;AAgBO,MAAMA,SAAsB;IAC/B,MAAM;IACN,aAAa;IACb,YAAY;IACZ,UAAU;AACd;AAOO,eAAeC,KAAK,EAAEC,EAAE,EAAEC,GAAG,EAAc;IAC9CD,GAAG,IAAI,CAAC;IAERE,eAAe;QACXF;QACA,YAAYG,KAAKF,KAAK,WAAW;IACrC;IAEAG,UAAU;QACNJ;QACA,OAAO;IACX;AACJ"}
package/agents/copilot.js CHANGED
@@ -1,71 +1,57 @@
1
- /**
2
- * Agent adapter: GitHub Copilot / VS Code
3
- *
4
- * MCP config : .vscode/mcp.json (project-level)
5
- * Hint file : .github/copilot-instructions.md
6
- *
7
- * Note: VS Code uses "servers" as the top-level key, not "mcpServers".
8
- *
9
- * Docs: https://code.visualstudio.com/docs/copilot/chat/mcp-servers
10
- */
11
-
12
- import { join, dirname } from "path";
13
- import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
14
- import { writeHintFile, webinyHintBlock, printDone } from "./shared.js";
15
- export const preset = {
16
- slug: "copilot",
17
- displayName: "Copilot / VS Code",
18
- configFile: ".vscode/mcp.json",
19
- configNote: "uses 'servers', not 'mcpServers'",
20
- hintFile: ".github/copilot-instructions.md"
1
+ import { dirname, join } from "path";
2
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
3
+ import { printDone, webinyHintBlock, writeHintFile } from "./shared.js";
4
+ const preset = {
5
+ slug: "copilot",
6
+ displayName: "Copilot / VS Code",
7
+ configFile: ".vscode/mcp.json",
8
+ configNote: "uses 'servers', not 'mcpServers'",
9
+ hintFile: ".github/copilot-instructions.md"
21
10
  };
22
11
  function writeCopilotMcpConfig(ui, configPath) {
23
- const dir = dirname(configPath);
24
- if (!existsSync(dir)) {
25
- mkdirSync(dir, {
26
- recursive: true
12
+ const dir = dirname(configPath);
13
+ if (!existsSync(dir)) mkdirSync(dir, {
14
+ recursive: true
27
15
  });
28
- }
29
- const entry = {
30
- command: "npx",
31
- args: ["webiny-mcp", "serve"]
32
- };
33
- let config = {
34
- servers: {}
35
- };
36
- if (existsSync(configPath)) {
37
- try {
38
- config = JSON.parse(readFileSync(configPath, "utf8"));
39
- config.servers ??= {};
40
- } catch {
41
- ui.warning(`Could not parse %s — will overwrite.`, configPath);
16
+ const entry = {
17
+ command: "npx",
18
+ args: [
19
+ "webiny-mcp",
20
+ "serve"
21
+ ]
22
+ };
23
+ let config = {
24
+ servers: {}
25
+ };
26
+ if (existsSync(configPath)) try {
27
+ config = JSON.parse(readFileSync(configPath, "utf8"));
28
+ config.servers ??= {};
29
+ } catch {
30
+ ui.warning("Could not parse %s — will overwrite.", configPath);
31
+ }
32
+ if (config.servers.webiny) {
33
+ ui.info(`${configPath} already has a %s entry — skipping.`, "webiny");
34
+ return false;
42
35
  }
43
- }
44
- if (config.servers.webiny) {
45
- ui.info(`${configPath} already has a %s entry — skipping.`, "webiny");
46
- return false;
47
- }
48
- config.servers.webiny = entry;
49
- writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
50
- ui.success(`Registered Webiny MCP server in %s`, configPath);
51
- return true;
36
+ config.servers.webiny = entry;
37
+ writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
38
+ ui.success("Registered Webiny MCP server in %s", configPath);
39
+ return true;
52
40
  }
53
- export async function init({
54
- ui,
55
- cwd
56
- }) {
57
- ui.info("Setting up for GitHub Copilot (VS Code)...");
58
- writeCopilotMcpConfig(ui, join(cwd, ".vscode", "mcp.json"));
59
- writeHintFile({
60
- ui,
61
- hintPath: join(cwd, ".github", "copilot-instructions.md"),
62
- content: webinyHintBlock({
63
- heading: "## Webiny"
64
- })
65
- });
66
- printDone({
67
- ui
68
- });
41
+ async function init({ ui, cwd }) {
42
+ ui.info("Setting up for GitHub Copilot (VS Code)...");
43
+ writeCopilotMcpConfig(ui, join(cwd, ".vscode", "mcp.json"));
44
+ writeHintFile({
45
+ ui,
46
+ hintPath: join(cwd, ".github", "copilot-instructions.md"),
47
+ content: webinyHintBlock({
48
+ heading: "## Webiny"
49
+ })
50
+ });
51
+ printDone({
52
+ ui
53
+ });
69
54
  }
55
+ export { init, preset };
70
56
 
71
57
  //# sourceMappingURL=copilot.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["join","dirname","readFileSync","writeFileSync","existsSync","mkdirSync","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","configNote","hintFile","writeCopilotMcpConfig","ui","configPath","dir","recursive","entry","command","args","config","servers","JSON","parse","warning","webiny","info","stringify","success","init","cwd","hintPath","content","heading"],"sources":["copilot.ts"],"sourcesContent":["/**\n * Agent adapter: GitHub Copilot / VS Code\n *\n * MCP config : .vscode/mcp.json (project-level)\n * Hint file : .github/copilot-instructions.md\n *\n * Note: VS Code uses \"servers\" as the top-level key, not \"mcpServers\".\n *\n * Docs: https://code.visualstudio.com/docs/copilot/chat/mcp-servers\n */\n\nimport { join, dirname } from \"path\";\nimport { readFileSync, writeFileSync, existsSync, mkdirSync } from \"fs\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"copilot\",\n displayName: \"Copilot / VS Code\",\n configFile: \".vscode/mcp.json\",\n configNote: \"uses 'servers', not 'mcpServers'\",\n hintFile: \".github/copilot-instructions.md\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nfunction writeCopilotMcpConfig(ui: IUi, configPath: string): boolean {\n const dir = dirname(configPath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n const entry = { command: \"npx\", args: [\"webiny-mcp\", \"serve\"] };\n let config: { servers: Record<string, unknown> } = { servers: {} };\n\n if (existsSync(configPath)) {\n try {\n config = JSON.parse(readFileSync(configPath, \"utf8\"));\n config.servers ??= {};\n } catch {\n ui.warning(`Could not parse %s — will overwrite.`, configPath);\n }\n }\n\n if (config.servers.webiny) {\n ui.info(`${configPath} already has a %s entry — skipping.`, \"webiny\");\n return false;\n }\n\n config.servers.webiny = entry;\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n ui.success(`Registered Webiny MCP server in %s`, configPath);\n return true;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for GitHub Copilot (VS Code)...\");\n\n writeCopilotMcpConfig(ui, join(cwd, \".vscode\", \"mcp.json\"));\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \".github\", \"copilot-instructions.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,OAAO,QAAQ,MAAM;AACpC,SAASC,YAAY,EAAEC,aAAa,EAAEC,UAAU,EAAEC,SAAS,QAAQ,IAAI;AAGvE,SAASC,aAAa,EAAEC,eAAe,EAAEC,SAAS;AAElD,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,SAAS;EACfC,WAAW,EAAE,mBAAmB;EAChCC,UAAU,EAAE,kBAAkB;EAC9BC,UAAU,EAAE,kCAAkC;EAC9CC,QAAQ,EAAE;AACd,CAAC;AAOD,SAASC,qBAAqBA,CAACC,EAAO,EAAEC,UAAkB,EAAW;EACjE,MAAMC,GAAG,GAAGjB,OAAO,CAACgB,UAAU,CAAC;EAC/B,IAAI,CAACb,UAAU,CAACc,GAAG,CAAC,EAAE;IAClBb,SAAS,CAACa,GAAG,EAAE;MAAEC,SAAS,EAAE;IAAK,CAAC,CAAC;EACvC;EAEA,MAAMC,KAAK,GAAG;IAAEC,OAAO,EAAE,KAAK;IAAEC,IAAI,EAAE,CAAC,YAAY,EAAE,OAAO;EAAE,CAAC;EAC/D,IAAIC,MAA4C,GAAG;IAAEC,OAAO,EAAE,CAAC;EAAE,CAAC;EAElE,IAAIpB,UAAU,CAACa,UAAU,CAAC,EAAE;IACxB,IAAI;MACAM,MAAM,GAAGE,IAAI,CAACC,KAAK,CAACxB,YAAY,CAACe,UAAU,EAAE,MAAM,CAAC,CAAC;MACrDM,MAAM,CAACC,OAAO,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC,MAAM;MACJR,EAAE,CAACW,OAAO,CAAC,sCAAsC,EAAEV,UAAU,CAAC;IAClE;EACJ;EAEA,IAAIM,MAAM,CAACC,OAAO,CAACI,MAAM,EAAE;IACvBZ,EAAE,CAACa,IAAI,CAAC,GAAGZ,UAAU,qCAAqC,EAAE,QAAQ,CAAC;IACrE,OAAO,KAAK;EAChB;EAEAM,MAAM,CAACC,OAAO,CAACI,MAAM,GAAGR,KAAK;EAC7BjB,aAAa,CAACc,UAAU,EAAEQ,IAAI,CAACK,SAAS,CAACP,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;EACjEP,EAAE,CAACe,OAAO,CAAC,oCAAoC,EAAEd,UAAU,CAAC;EAC5D,OAAO,IAAI;AACf;AAEA,OAAO,eAAee,IAAIA,CAAC;EAAEhB,EAAE;EAAEiB;AAAgB,CAAC,EAAiB;EAC/DjB,EAAE,CAACa,IAAI,CAAC,4CAA4C,CAAC;EAErDd,qBAAqB,CAACC,EAAE,EAAEhB,IAAI,CAACiC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;EAE3D3B,aAAa,CAAC;IACVU,EAAE;IACFkB,QAAQ,EAAElC,IAAI,CAACiC,GAAG,EAAE,SAAS,EAAE,yBAAyB,CAAC;IACzDE,OAAO,EAAE5B,eAAe,CAAC;MAAE6B,OAAO,EAAE;IAAY,CAAC;EACrD,CAAC,CAAC;EAEF5B,SAAS,CAAC;IAAEQ;EAAG,CAAC,CAAC;AACrB","ignoreList":[]}
1
+ {"version":3,"file":"agents/copilot.js","sources":["../../src/agents/copilot.ts"],"sourcesContent":["/**\n * Agent adapter: GitHub Copilot / VS Code\n *\n * MCP config : .vscode/mcp.json (project-level)\n * Hint file : .github/copilot-instructions.md\n *\n * Note: VS Code uses \"servers\" as the top-level key, not \"mcpServers\".\n *\n * Docs: https://code.visualstudio.com/docs/copilot/chat/mcp-servers\n */\n\nimport { join, dirname } from \"path\";\nimport { readFileSync, writeFileSync, existsSync, mkdirSync } from \"fs\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"copilot\",\n displayName: \"Copilot / VS Code\",\n configFile: \".vscode/mcp.json\",\n configNote: \"uses 'servers', not 'mcpServers'\",\n hintFile: \".github/copilot-instructions.md\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nfunction writeCopilotMcpConfig(ui: IUi, configPath: string): boolean {\n const dir = dirname(configPath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n const entry = { command: \"npx\", args: [\"webiny-mcp\", \"serve\"] };\n let config: { servers: Record<string, unknown> } = { servers: {} };\n\n if (existsSync(configPath)) {\n try {\n config = JSON.parse(readFileSync(configPath, \"utf8\"));\n config.servers ??= {};\n } catch {\n ui.warning(`Could not parse %s — will overwrite.`, configPath);\n }\n }\n\n if (config.servers.webiny) {\n ui.info(`${configPath} already has a %s entry — skipping.`, \"webiny\");\n return false;\n }\n\n config.servers.webiny = entry;\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n ui.success(`Registered Webiny MCP server in %s`, configPath);\n return true;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for GitHub Copilot (VS Code)...\");\n\n writeCopilotMcpConfig(ui, join(cwd, \".vscode\", \"mcp.json\"));\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \".github\", \"copilot-instructions.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"names":["preset","writeCopilotMcpConfig","ui","configPath","dir","dirname","existsSync","mkdirSync","entry","config","JSON","readFileSync","writeFileSync","init","cwd","join","writeHintFile","webinyHintBlock","printDone"],"mappings":";;;AAiBO,MAAMA,SAAsB;IAC/B,MAAM;IACN,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,UAAU;AACd;AAOA,SAASC,sBAAsBC,EAAO,EAAEC,UAAkB;IACtD,MAAMC,MAAMC,QAAQF;IACpB,IAAI,CAACG,WAAWF,MACZG,UAAUH,KAAK;QAAE,WAAW;IAAK;IAGrC,MAAMI,QAAQ;QAAE,SAAS;QAAO,MAAM;YAAC;YAAc;SAAQ;IAAC;IAC9D,IAAIC,SAA+C;QAAE,SAAS,CAAC;IAAE;IAEjE,IAAIH,WAAWH,aACX,IAAI;QACAM,SAASC,KAAK,KAAK,CAACC,aAAaR,YAAY;QAC7CM,OAAO,OAAO,KAAK,CAAC;IACxB,EAAE,OAAM;QACJP,GAAG,OAAO,CAAC,wCAAwCC;IACvD;IAGJ,IAAIM,OAAO,OAAO,CAAC,MAAM,EAAE;QACvBP,GAAG,IAAI,CAAC,GAAGC,WAAW,mCAAmC,CAAC,EAAE;QAC5D,OAAO;IACX;IAEAM,OAAO,OAAO,CAAC,MAAM,GAAGD;IACxBI,cAAcT,YAAYO,KAAK,SAAS,CAACD,QAAQ,MAAM,KAAK;IAC5DP,GAAG,OAAO,CAAC,sCAAsCC;IACjD,OAAO;AACX;AAEO,eAAeU,KAAK,EAAEX,EAAE,EAAEY,GAAG,EAAc;IAC9CZ,GAAG,IAAI,CAAC;IAERD,sBAAsBC,IAAIa,KAAKD,KAAK,WAAW;IAE/CE,cAAc;QACVd;QACA,UAAUa,KAAKD,KAAK,WAAW;QAC/B,SAASG,gBAAgB;YAAE,SAAS;QAAY;IACpD;IAEAC,UAAU;QAAEhB;IAAG;AACnB"}
package/agents/cursor.js CHANGED
@@ -1,39 +1,28 @@
1
- /**
2
- * Agent adapter: Cursor
3
- *
4
- * MCP config : .cursor/mcp.json (project-level)
5
- * Hint file : .cursor/rules/webiny.mdc
6
- *
7
- * Docs: https://docs.cursor.com/context/model-context-protocol
8
- */
9
-
10
1
  import { join } from "path";
11
- import { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from "./shared.js";
12
- export const preset = {
13
- slug: "cursor",
14
- displayName: "Cursor",
15
- configFile: ".cursor/mcp.json",
16
- hintFile: ".cursor/rules/*.mdc"
2
+ import { printDone, webinyHintBlock, writeHintFile, writeMcpConfig } from "./shared.js";
3
+ const preset = {
4
+ slug: "cursor",
5
+ displayName: "Cursor",
6
+ configFile: ".cursor/mcp.json",
7
+ hintFile: ".cursor/rules/*.mdc"
17
8
  };
18
- export async function init({
19
- ui,
20
- cwd
21
- }) {
22
- ui.info("Setting up for Cursor...");
23
- writeMcpConfig({
24
- ui,
25
- configPath: join(cwd, ".cursor", "mcp.json")
26
- });
27
- writeHintFile({
28
- ui,
29
- hintPath: join(cwd, ".cursor", "rules", "webiny.mdc"),
30
- content: webinyHintBlock({
31
- heading: "# Webiny"
32
- })
33
- });
34
- printDone({
35
- ui
36
- });
9
+ async function init({ ui, cwd }) {
10
+ ui.info("Setting up for Cursor...");
11
+ writeMcpConfig({
12
+ ui,
13
+ configPath: join(cwd, ".cursor", "mcp.json")
14
+ });
15
+ writeHintFile({
16
+ ui,
17
+ hintPath: join(cwd, ".cursor", "rules", "webiny.mdc"),
18
+ content: webinyHintBlock({
19
+ heading: "# Webiny"
20
+ })
21
+ });
22
+ printDone({
23
+ ui
24
+ });
37
25
  }
26
+ export { init, preset };
38
27
 
39
28
  //# sourceMappingURL=cursor.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["join","writeMcpConfig","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","hintFile","init","ui","cwd","info","configPath","hintPath","content","heading"],"sources":["cursor.ts"],"sourcesContent":["/**\n * Agent adapter: Cursor\n *\n * MCP config : .cursor/mcp.json (project-level)\n * Hint file : .cursor/rules/webiny.mdc\n *\n * Docs: https://docs.cursor.com/context/model-context-protocol\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"cursor\",\n displayName: \"Cursor\",\n configFile: \".cursor/mcp.json\",\n hintFile: \".cursor/rules/*.mdc\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Cursor...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".cursor\", \"mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \".cursor\", \"rules\", \"webiny.mdc\"),\n content: webinyHintBlock({ heading: \"# Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,MAAM;AAG3B,SAASC,cAAc,EAAEC,aAAa,EAAEC,eAAe,EAAEC,SAAS;AAElE,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,QAAQ;EACdC,WAAW,EAAE,QAAQ;EACrBC,UAAU,EAAE,kBAAkB;EAC9BC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,0BAA0B,CAAC;EAEnCZ,cAAc,CAAC;IACXU,EAAE;IACFG,UAAU,EAAEd,IAAI,CAACY,GAAG,EAAE,SAAS,EAAE,UAAU;EAC/C,CAAC,CAAC;EAEFV,aAAa,CAAC;IACVS,EAAE;IACFI,QAAQ,EAAEf,IAAI,CAACY,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC;IACrDI,OAAO,EAAEb,eAAe,CAAC;MAAEc,OAAO,EAAE;IAAW,CAAC;EACpD,CAAC,CAAC;EAEFb,SAAS,CAAC;IAAEO;EAAG,CAAC,CAAC;AACrB","ignoreList":[]}
1
+ {"version":3,"file":"agents/cursor.js","sources":["../../src/agents/cursor.ts"],"sourcesContent":["/**\n * Agent adapter: Cursor\n *\n * MCP config : .cursor/mcp.json (project-level)\n * Hint file : .cursor/rules/webiny.mdc\n *\n * Docs: https://docs.cursor.com/context/model-context-protocol\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"cursor\",\n displayName: \"Cursor\",\n configFile: \".cursor/mcp.json\",\n hintFile: \".cursor/rules/*.mdc\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Cursor...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".cursor\", \"mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \".cursor\", \"rules\", \"webiny.mdc\"),\n content: webinyHintBlock({ heading: \"# Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"names":["preset","init","ui","cwd","writeMcpConfig","join","writeHintFile","webinyHintBlock","printDone"],"mappings":";;AAcO,MAAMA,SAAsB;IAC/B,MAAM;IACN,aAAa;IACb,YAAY;IACZ,UAAU;AACd;AAOO,eAAeC,KAAK,EAAEC,EAAE,EAAEC,GAAG,EAAc;IAC9CD,GAAG,IAAI,CAAC;IAERE,eAAe;QACXF;QACA,YAAYG,KAAKF,KAAK,WAAW;IACrC;IAEAG,cAAc;QACVJ;QACA,UAAUG,KAAKF,KAAK,WAAW,SAAS;QACxC,SAASI,gBAAgB;YAAE,SAAS;QAAW;IACnD;IAEAC,UAAU;QAAEN;IAAG;AACnB"}
@@ -2,28 +2,25 @@ import { readdirSync } from "fs";
2
2
  import { fileURLToPath } from "url";
3
3
  import { dirname, join } from "path";
4
4
  let cache = null;
5
- export async function discoverAgents() {
6
- if (cache) {
7
- return cache;
8
- }
9
- const agentsDir = dirname(fileURLToPath(import.meta.url));
10
- const files = readdirSync(agentsDir).filter(f => f.endsWith(".js") && !f.endsWith(".d.ts") && !f.endsWith(".js.map"));
11
- const agents = new Map();
12
- for (const file of files) {
13
- const mod = await import(join(agentsDir, file));
14
- if (mod.preset && typeof mod.init === "function") {
15
- agents.set(mod.preset.slug, {
16
- preset: mod.preset,
17
- init: mod.init
18
- });
5
+ async function discoverAgents() {
6
+ if (cache) return cache;
7
+ const agentsDir = dirname(fileURLToPath(import.meta.url));
8
+ const files = readdirSync(agentsDir).filter((f)=>f.endsWith(".js") && !f.endsWith(".d.ts") && !f.endsWith(".js.map"));
9
+ const agents = new Map();
10
+ for (const file of files){
11
+ const mod = await import(join(agentsDir, file));
12
+ if (mod.preset && "function" == typeof mod.init) agents.set(mod.preset.slug, {
13
+ preset: mod.preset,
14
+ init: mod.init
15
+ });
19
16
  }
20
- }
21
- cache = agents;
22
- return agents;
17
+ cache = agents;
18
+ return agents;
23
19
  }
24
- export async function discoverPresets() {
25
- const agents = await discoverAgents();
26
- return Array.from(agents.values()).map(a => a.preset);
20
+ async function discoverPresets() {
21
+ const agents = await discoverAgents();
22
+ return Array.from(agents.values()).map((a)=>a.preset);
27
23
  }
24
+ export { discoverAgents, discoverPresets };
28
25
 
29
26
  //# sourceMappingURL=discover.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["readdirSync","fileURLToPath","dirname","join","cache","discoverAgents","agentsDir","import","meta","url","files","filter","f","endsWith","agents","Map","file","mod","preset","init","set","slug","discoverPresets","Array","from","values","map","a"],"sources":["discover.ts"],"sourcesContent":["import { readdirSync } from \"fs\";\nimport { fileURLToPath } from \"url\";\nimport { dirname, join } from \"path\";\nimport type { AgentPreset, AgentModule } from \"./types.js\";\n\nlet cache: Map<string, AgentModule> | null = null;\n\nexport async function discoverAgents(): Promise<Map<string, AgentModule>> {\n if (cache) {\n return cache;\n }\n\n const agentsDir = dirname(fileURLToPath(import.meta.url));\n const files = readdirSync(agentsDir).filter(\n f => f.endsWith(\".js\") && !f.endsWith(\".d.ts\") && !f.endsWith(\".js.map\")\n );\n\n const agents = new Map<string, AgentModule>();\n\n for (const file of files) {\n const mod = await import(join(agentsDir, file));\n if (mod.preset && typeof mod.init === \"function\") {\n agents.set(mod.preset.slug, { preset: mod.preset, init: mod.init });\n }\n }\n\n cache = agents;\n return agents;\n}\n\nexport async function discoverPresets(): Promise<AgentPreset[]> {\n const agents = await discoverAgents();\n return Array.from(agents.values()).map(a => a.preset);\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,IAAI;AAChC,SAASC,aAAa,QAAQ,KAAK;AACnC,SAASC,OAAO,EAAEC,IAAI,QAAQ,MAAM;AAGpC,IAAIC,KAAsC,GAAG,IAAI;AAEjD,OAAO,eAAeC,cAAcA,CAAA,EAAsC;EACtE,IAAID,KAAK,EAAE;IACP,OAAOA,KAAK;EAChB;EAEA,MAAME,SAAS,GAAGJ,OAAO,CAACD,aAAa,CAACM,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;EACzD,MAAMC,KAAK,GAAGV,WAAW,CAACM,SAAS,CAAC,CAACK,MAAM,CACvCC,CAAC,IAAIA,CAAC,CAACC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAACD,CAAC,CAACC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAACD,CAAC,CAACC,QAAQ,CAAC,SAAS,CAC3E,CAAC;EAED,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAsB,CAAC;EAE7C,KAAK,MAAMC,IAAI,IAAIN,KAAK,EAAE;IACtB,MAAMO,GAAG,GAAG,MAAM,MAAM,CAACd,IAAI,CAACG,SAAS,EAAEU,IAAI,CAAC,CAAC;IAC/C,IAAIC,GAAG,CAACC,MAAM,IAAI,OAAOD,GAAG,CAACE,IAAI,KAAK,UAAU,EAAE;MAC9CL,MAAM,CAACM,GAAG,CAACH,GAAG,CAACC,MAAM,CAACG,IAAI,EAAE;QAAEH,MAAM,EAAED,GAAG,CAACC,MAAM;QAAEC,IAAI,EAAEF,GAAG,CAACE;MAAK,CAAC,CAAC;IACvE;EACJ;EAEAf,KAAK,GAAGU,MAAM;EACd,OAAOA,MAAM;AACjB;AAEA,OAAO,eAAeQ,eAAeA,CAAA,EAA2B;EAC5D,MAAMR,MAAM,GAAG,MAAMT,cAAc,CAAC,CAAC;EACrC,OAAOkB,KAAK,CAACC,IAAI,CAACV,MAAM,CAACW,MAAM,CAAC,CAAC,CAAC,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACT,MAAM,CAAC;AACzD","ignoreList":[]}
1
+ {"version":3,"file":"agents/discover.js","sources":["../../src/agents/discover.ts"],"sourcesContent":["import { readdirSync } from \"fs\";\nimport { fileURLToPath } from \"url\";\nimport { dirname, join } from \"path\";\nimport type { AgentPreset, AgentModule } from \"./types.js\";\n\nlet cache: Map<string, AgentModule> | null = null;\n\nexport async function discoverAgents(): Promise<Map<string, AgentModule>> {\n if (cache) {\n return cache;\n }\n\n const agentsDir = dirname(fileURLToPath(import.meta.url));\n const files = readdirSync(agentsDir).filter(\n f => f.endsWith(\".js\") && !f.endsWith(\".d.ts\") && !f.endsWith(\".js.map\")\n );\n\n const agents = new Map<string, AgentModule>();\n\n for (const file of files) {\n const mod = await import(join(agentsDir, file));\n if (mod.preset && typeof mod.init === \"function\") {\n agents.set(mod.preset.slug, { preset: mod.preset, init: mod.init });\n }\n }\n\n cache = agents;\n return agents;\n}\n\nexport async function discoverPresets(): Promise<AgentPreset[]> {\n const agents = await discoverAgents();\n return Array.from(agents.values()).map(a => a.preset);\n}\n"],"names":["cache","discoverAgents","agentsDir","dirname","fileURLToPath","files","readdirSync","f","agents","Map","file","mod","join","discoverPresets","Array","a"],"mappings":";;;AAKA,IAAIA,QAAyC;AAEtC,eAAeC;IAClB,IAAID,OACA,OAAOA;IAGX,MAAME,YAAYC,QAAQC,cAAc,YAAY,GAAG;IACvD,MAAMC,QAAQC,YAAYJ,WAAW,MAAM,CACvCK,CAAAA,IAAKA,EAAE,QAAQ,CAAC,UAAU,CAACA,EAAE,QAAQ,CAAC,YAAY,CAACA,EAAE,QAAQ,CAAC;IAGlE,MAAMC,SAAS,IAAIC;IAEnB,KAAK,MAAMC,QAAQL,MAAO;QACtB,MAAMM,MAAM,MAAM,MAAM,CAACC,KAAKV,WAAWQ;QACzC,IAAIC,IAAI,MAAM,IAAI,AAAoB,cAApB,OAAOA,IAAI,IAAI,EAC7BH,OAAO,GAAG,CAACG,IAAI,MAAM,CAAC,IAAI,EAAE;YAAE,QAAQA,IAAI,MAAM;YAAE,MAAMA,IAAI,IAAI;QAAC;IAEzE;IAEAX,QAAQQ;IACR,OAAOA;AACX;AAEO,eAAeK;IAClB,MAAML,SAAS,MAAMP;IACrB,OAAOa,MAAM,IAAI,CAACN,OAAO,MAAM,IAAI,GAAG,CAACO,CAAAA,IAAKA,EAAE,MAAM;AACxD"}
@@ -1,26 +1,87 @@
1
- /**
2
- * --instructions / --manual
3
- *
4
- * Prints a clear, copy-paste-friendly guide for wiring up the Webiny MCP
5
- * server in any agent not covered by the built-in adapters.
6
- *
7
- * The agent tables are auto-generated from preset metadata.
8
- */
9
-
10
1
  import { discoverPresets } from "./discover.js";
11
- export async function printInstructions() {
12
- const presets = await discoverPresets();
13
- const configRows = presets.map(p => {
14
- const note = p.configNote ? ` (${p.configNote})` : "";
15
- return formatRow(p.displayName, p.configFile + note);
16
- });
17
- const hintRows = presets.filter(p => p.hintFile).map(p => formatRow(p.displayName, p.hintFile));
18
- presets.filter(p => !p.hintFile && p.hintNote).forEach(p => hintRows.push(formatRow(p.displayName, p.hintNote)));
19
- const lines = ["", "╔══════════════════════════════════════════════════════════════════╗", "║ Webiny MCP Server — Manual Setup Guide ║", "╚══════════════════════════════════════════════════════════════════╝", "", "The Webiny MCP server works with any agent that supports the Model", "Context Protocol (MCP) over stdio transport.", "", "── Step 1: Register the MCP server ───────────────────────────────", "", "Most agents accept a JSON config file. Add the following entry:", "", ' "webiny": {', ' "command": "npx",', ' "args": ["webiny-mcp", "serve"]', " }", "", "Where this config lives depends on your agent:", "", " Agent Config file", " ───────────────── ──────────────────────────────────────", ...configRows, "", "Full example (the most common shape):", "", " {", ' "mcpServers": {', ' "webiny": {', ' "command": "npx",', ' "args": ["webiny-mcp", "serve"]', " }", " }", " }", "", "── Step 2: Tell your agent about the MCP tools ───────────────────", "", "Add the following to your agent's instruction / rules file so it", "knows to reach for the Webiny tools automatically:", "", " ## Webiny", " This project uses the Webiny framework.", " A `webiny` MCP server is available.", " When helping with Webiny-related tasks:", " 1. Call `list_webiny_skills` to see available skills.", " 2. Call `get_webiny_skill` with the relevant topic before writing code.", "", "Where this instruction file lives:", "", " Agent Instruction file", " ───────────────── ──────────────────────────────────────", ...hintRows, "", "── Step 3: Verify the server starts ──────────────────────────────", "", "Test it with the MCP Inspector before relying on it in your agent:", "", " npx @modelcontextprotocol/inspector npx webiny-mcp server", "", "Connect, click 'List Tools', and confirm you see:", " • list_webiny_skills", " • get_webiny_skill", "", "── Need a built-in adapter for your agent? ───────────────────────", "", "Open an issue or PR at: https://github.com/webiny/webiny-js", "The adapter just needs to write the right config file — see", "mcp/agents/claude.ts as a reference (~20 lines).", ""];
20
- process.stdout.write(lines.join("\n") + "\n");
2
+ async function printInstructions() {
3
+ const presets = await discoverPresets();
4
+ const configRows = presets.map((p)=>{
5
+ const note = p.configNote ? ` (${p.configNote})` : "";
6
+ return formatRow(p.displayName, p.configFile + note);
7
+ });
8
+ const hintRows = presets.filter((p)=>p.hintFile).map((p)=>formatRow(p.displayName, p.hintFile));
9
+ presets.filter((p)=>!p.hintFile && p.hintNote).forEach((p)=>hintRows.push(formatRow(p.displayName, p.hintNote)));
10
+ const lines = [
11
+ "",
12
+ "╔══════════════════════════════════════════════════════════════════╗",
13
+ "║ Webiny MCP Server — Manual Setup Guide ║",
14
+ "╚══════════════════════════════════════════════════════════════════╝",
15
+ "",
16
+ "The Webiny MCP server works with any agent that supports the Model",
17
+ "Context Protocol (MCP) over stdio transport.",
18
+ "",
19
+ "── Step 1: Register the MCP server ───────────────────────────────",
20
+ "",
21
+ "Most agents accept a JSON config file. Add the following entry:",
22
+ "",
23
+ ' "webiny": {',
24
+ ' "command": "npx",',
25
+ ' "args": ["webiny-mcp", "serve"]',
26
+ " }",
27
+ "",
28
+ "Where this config lives depends on your agent:",
29
+ "",
30
+ " Agent Config file",
31
+ " ───────────────── ──────────────────────────────────────",
32
+ ...configRows,
33
+ "",
34
+ "Full example (the most common shape):",
35
+ "",
36
+ " {",
37
+ ' "mcpServers": {',
38
+ ' "webiny": {',
39
+ ' "command": "npx",',
40
+ ' "args": ["webiny-mcp", "serve"]',
41
+ " }",
42
+ " }",
43
+ " }",
44
+ "",
45
+ "── Step 2: Tell your agent about the MCP tools ───────────────────",
46
+ "",
47
+ "Add the following to your agent's instruction / rules file so it",
48
+ "knows to reach for the Webiny tools automatically:",
49
+ "",
50
+ " ## Webiny",
51
+ " This project uses the Webiny framework.",
52
+ " A `webiny` MCP server is available.",
53
+ " When helping with Webiny-related tasks:",
54
+ " 1. Call `list_webiny_skills` to see available skills.",
55
+ " 2. Call `get_webiny_skill` with the relevant topic before writing code.",
56
+ "",
57
+ "Where this instruction file lives:",
58
+ "",
59
+ " Agent Instruction file",
60
+ " ───────────────── ──────────────────────────────────────",
61
+ ...hintRows,
62
+ "",
63
+ "── Step 3: Verify the server starts ──────────────────────────────",
64
+ "",
65
+ "Test it with the MCP Inspector before relying on it in your agent:",
66
+ "",
67
+ " npx @modelcontextprotocol/inspector npx webiny-mcp server",
68
+ "",
69
+ "Connect, click 'List Tools', and confirm you see:",
70
+ " • list_webiny_skills",
71
+ " • get_webiny_skill",
72
+ "",
73
+ "── Need a built-in adapter for your agent? ───────────────────────",
74
+ "",
75
+ "Open an issue or PR at: https://github.com/webiny/webiny-js",
76
+ "The adapter just needs to write the right config file — see",
77
+ "mcp/agents/claude.ts as a reference (~20 lines).",
78
+ ""
79
+ ];
80
+ process.stdout.write(lines.join("\n") + "\n");
21
81
  }
22
82
  function formatRow(agent, path) {
23
- return ` ${agent.padEnd(17)} ${path}`;
83
+ return ` ${agent.padEnd(17)} ${path}`;
24
84
  }
85
+ export { printInstructions };
25
86
 
26
87
  //# sourceMappingURL=instructions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["discoverPresets","printInstructions","presets","configRows","map","p","note","configNote","formatRow","displayName","configFile","hintRows","filter","hintFile","hintNote","forEach","push","lines","process","stdout","write","join","agent","path","padEnd"],"sources":["instructions.ts"],"sourcesContent":["/**\n * --instructions / --manual\n *\n * Prints a clear, copy-paste-friendly guide for wiring up the Webiny MCP\n * server in any agent not covered by the built-in adapters.\n *\n * The agent tables are auto-generated from preset metadata.\n */\n\nimport { discoverPresets } from \"./discover.js\";\n\nexport async function printInstructions(): Promise<void> {\n const presets = await discoverPresets();\n\n const configRows = presets.map(p => {\n const note = p.configNote ? ` (${p.configNote})` : \"\";\n return formatRow(p.displayName, p.configFile + note);\n });\n\n const hintRows = presets\n .filter(p => p.hintFile)\n .map(p => formatRow(p.displayName, p.hintFile!));\n presets\n .filter(p => !p.hintFile && p.hintNote)\n .forEach(p => hintRows.push(formatRow(p.displayName, p.hintNote!)));\n\n const lines = [\n \"\",\n \"╔══════════════════════════════════════════════════════════════════╗\",\n \"║ Webiny MCP Server — Manual Setup Guide ║\",\n \"╚══════════════════════════════════════════════════════════════════╝\",\n \"\",\n \"The Webiny MCP server works with any agent that supports the Model\",\n \"Context Protocol (MCP) over stdio transport.\",\n \"\",\n \"── Step 1: Register the MCP server ───────────────────────────────\",\n \"\",\n \"Most agents accept a JSON config file. Add the following entry:\",\n \"\",\n ' \"webiny\": {',\n ' \"command\": \"npx\",',\n ' \"args\": [\"webiny-mcp\", \"serve\"]',\n \" }\",\n \"\",\n \"Where this config lives depends on your agent:\",\n \"\",\n \" Agent Config file\",\n \" ───────────────── ──────────────────────────────────────\",\n ...configRows,\n \"\",\n \"Full example (the most common shape):\",\n \"\",\n \" {\",\n ' \"mcpServers\": {',\n ' \"webiny\": {',\n ' \"command\": \"npx\",',\n ' \"args\": [\"webiny-mcp\", \"serve\"]',\n \" }\",\n \" }\",\n \" }\",\n \"\",\n \"── Step 2: Tell your agent about the MCP tools ───────────────────\",\n \"\",\n \"Add the following to your agent's instruction / rules file so it\",\n \"knows to reach for the Webiny tools automatically:\",\n \"\",\n \" ## Webiny\",\n \" This project uses the Webiny framework.\",\n \" A `webiny` MCP server is available.\",\n \" When helping with Webiny-related tasks:\",\n \" 1. Call `list_webiny_skills` to see available skills.\",\n \" 2. Call `get_webiny_skill` with the relevant topic before writing code.\",\n \"\",\n \"Where this instruction file lives:\",\n \"\",\n \" Agent Instruction file\",\n \" ───────────────── ──────────────────────────────────────\",\n ...hintRows,\n \"\",\n \"── Step 3: Verify the server starts ──────────────────────────────\",\n \"\",\n \"Test it with the MCP Inspector before relying on it in your agent:\",\n \"\",\n \" npx @modelcontextprotocol/inspector npx webiny-mcp server\",\n \"\",\n \"Connect, click 'List Tools', and confirm you see:\",\n \" • list_webiny_skills\",\n \" • get_webiny_skill\",\n \"\",\n \"── Need a built-in adapter for your agent? ───────────────────────\",\n \"\",\n \"Open an issue or PR at: https://github.com/webiny/webiny-js\",\n \"The adapter just needs to write the right config file — see\",\n \"mcp/agents/claude.ts as a reference (~20 lines).\",\n \"\"\n ];\n\n process.stdout.write(lines.join(\"\\n\") + \"\\n\");\n}\n\nfunction formatRow(agent: string, path: string): string {\n return ` ${agent.padEnd(17)} ${path}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe;AAExB,OAAO,eAAeC,iBAAiBA,CAAA,EAAkB;EACrD,MAAMC,OAAO,GAAG,MAAMF,eAAe,CAAC,CAAC;EAEvC,MAAMG,UAAU,GAAGD,OAAO,CAACE,GAAG,CAACC,CAAC,IAAI;IAChC,MAAMC,IAAI,GAAGD,CAAC,CAACE,UAAU,GAAG,MAAMF,CAAC,CAACE,UAAU,GAAG,GAAG,EAAE;IACtD,OAAOC,SAAS,CAACH,CAAC,CAACI,WAAW,EAAEJ,CAAC,CAACK,UAAU,GAAGJ,IAAI,CAAC;EACxD,CAAC,CAAC;EAEF,MAAMK,QAAQ,GAAGT,OAAO,CACnBU,MAAM,CAACP,CAAC,IAAIA,CAAC,CAACQ,QAAQ,CAAC,CACvBT,GAAG,CAACC,CAAC,IAAIG,SAAS,CAACH,CAAC,CAACI,WAAW,EAAEJ,CAAC,CAACQ,QAAS,CAAC,CAAC;EACpDX,OAAO,CACFU,MAAM,CAACP,CAAC,IAAI,CAACA,CAAC,CAACQ,QAAQ,IAAIR,CAAC,CAACS,QAAQ,CAAC,CACtCC,OAAO,CAACV,CAAC,IAAIM,QAAQ,CAACK,IAAI,CAACR,SAAS,CAACH,CAAC,CAACI,WAAW,EAAEJ,CAAC,CAACS,QAAS,CAAC,CAAC,CAAC;EAEvE,MAAMG,KAAK,GAAG,CACV,EAAE,EACF,sEAAsE,EACtE,qEAAqE,EACrE,sEAAsE,EACtE,EAAE,EACF,oEAAoE,EACpE,8CAA8C,EAC9C,EAAE,EACF,oEAAoE,EACpE,EAAE,EACF,iEAAiE,EACjE,EAAE,EACF,eAAe,EACf,uBAAuB,EACvB,qCAAqC,EACrC,KAAK,EACL,EAAE,EACF,gDAAgD,EAChD,EAAE,EACF,kCAAkC,EAClC,6DAA6D,EAC7D,GAAGd,UAAU,EACb,EAAE,EACF,uCAAuC,EACvC,EAAE,EACF,KAAK,EACL,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,yCAAyC,EACzC,SAAS,EACT,OAAO,EACP,KAAK,EACL,EAAE,EACF,oEAAoE,EACpE,EAAE,EACF,kEAAkE,EAClE,oDAAoD,EACpD,EAAE,EACF,aAAa,EACb,2CAA2C,EAC3C,uCAAuC,EACvC,2CAA2C,EAC3C,yDAAyD,EACzD,2EAA2E,EAC3E,EAAE,EACF,oCAAoC,EACpC,EAAE,EACF,uCAAuC,EACvC,6DAA6D,EAC7D,GAAGQ,QAAQ,EACX,EAAE,EACF,oEAAoE,EACpE,EAAE,EACF,oEAAoE,EACpE,EAAE,EACF,6DAA6D,EAC7D,EAAE,EACF,mDAAmD,EACnD,wBAAwB,EACxB,sBAAsB,EACtB,EAAE,EACF,oEAAoE,EACpE,EAAE,EACF,6DAA6D,EAC7D,6DAA6D,EAC7D,kDAAkD,EAClD,EAAE,CACL;EAEDO,OAAO,CAACC,MAAM,CAACC,KAAK,CAACH,KAAK,CAACI,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjD;AAEA,SAASb,SAASA,CAACc,KAAa,EAAEC,IAAY,EAAU;EACpD,OAAO,KAAKD,KAAK,CAACE,MAAM,CAAC,EAAE,CAAC,KAAKD,IAAI,EAAE;AAC3C","ignoreList":[]}
1
+ {"version":3,"file":"agents/instructions.js","sources":["../../src/agents/instructions.ts"],"sourcesContent":["/**\n * --instructions / --manual\n *\n * Prints a clear, copy-paste-friendly guide for wiring up the Webiny MCP\n * server in any agent not covered by the built-in adapters.\n *\n * The agent tables are auto-generated from preset metadata.\n */\n\nimport { discoverPresets } from \"./discover.js\";\n\nexport async function printInstructions(): Promise<void> {\n const presets = await discoverPresets();\n\n const configRows = presets.map(p => {\n const note = p.configNote ? ` (${p.configNote})` : \"\";\n return formatRow(p.displayName, p.configFile + note);\n });\n\n const hintRows = presets\n .filter(p => p.hintFile)\n .map(p => formatRow(p.displayName, p.hintFile!));\n presets\n .filter(p => !p.hintFile && p.hintNote)\n .forEach(p => hintRows.push(formatRow(p.displayName, p.hintNote!)));\n\n const lines = [\n \"\",\n \"╔══════════════════════════════════════════════════════════════════╗\",\n \"║ Webiny MCP Server — Manual Setup Guide ║\",\n \"╚══════════════════════════════════════════════════════════════════╝\",\n \"\",\n \"The Webiny MCP server works with any agent that supports the Model\",\n \"Context Protocol (MCP) over stdio transport.\",\n \"\",\n \"── Step 1: Register the MCP server ───────────────────────────────\",\n \"\",\n \"Most agents accept a JSON config file. Add the following entry:\",\n \"\",\n ' \"webiny\": {',\n ' \"command\": \"npx\",',\n ' \"args\": [\"webiny-mcp\", \"serve\"]',\n \" }\",\n \"\",\n \"Where this config lives depends on your agent:\",\n \"\",\n \" Agent Config file\",\n \" ───────────────── ──────────────────────────────────────\",\n ...configRows,\n \"\",\n \"Full example (the most common shape):\",\n \"\",\n \" {\",\n ' \"mcpServers\": {',\n ' \"webiny\": {',\n ' \"command\": \"npx\",',\n ' \"args\": [\"webiny-mcp\", \"serve\"]',\n \" }\",\n \" }\",\n \" }\",\n \"\",\n \"── Step 2: Tell your agent about the MCP tools ───────────────────\",\n \"\",\n \"Add the following to your agent's instruction / rules file so it\",\n \"knows to reach for the Webiny tools automatically:\",\n \"\",\n \" ## Webiny\",\n \" This project uses the Webiny framework.\",\n \" A `webiny` MCP server is available.\",\n \" When helping with Webiny-related tasks:\",\n \" 1. Call `list_webiny_skills` to see available skills.\",\n \" 2. Call `get_webiny_skill` with the relevant topic before writing code.\",\n \"\",\n \"Where this instruction file lives:\",\n \"\",\n \" Agent Instruction file\",\n \" ───────────────── ──────────────────────────────────────\",\n ...hintRows,\n \"\",\n \"── Step 3: Verify the server starts ──────────────────────────────\",\n \"\",\n \"Test it with the MCP Inspector before relying on it in your agent:\",\n \"\",\n \" npx @modelcontextprotocol/inspector npx webiny-mcp server\",\n \"\",\n \"Connect, click 'List Tools', and confirm you see:\",\n \" • list_webiny_skills\",\n \" • get_webiny_skill\",\n \"\",\n \"── Need a built-in adapter for your agent? ───────────────────────\",\n \"\",\n \"Open an issue or PR at: https://github.com/webiny/webiny-js\",\n \"The adapter just needs to write the right config file — see\",\n \"mcp/agents/claude.ts as a reference (~20 lines).\",\n \"\"\n ];\n\n process.stdout.write(lines.join(\"\\n\") + \"\\n\");\n}\n\nfunction formatRow(agent: string, path: string): string {\n return ` ${agent.padEnd(17)} ${path}`;\n}\n"],"names":["printInstructions","presets","discoverPresets","configRows","p","note","formatRow","hintRows","lines","process","agent","path"],"mappings":";AAWO,eAAeA;IAClB,MAAMC,UAAU,MAAMC;IAEtB,MAAMC,aAAaF,QAAQ,GAAG,CAACG,CAAAA;QAC3B,MAAMC,OAAOD,EAAE,UAAU,GAAG,CAAC,GAAG,EAAEA,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG;QACpD,OAAOE,UAAUF,EAAE,WAAW,EAAEA,EAAE,UAAU,GAAGC;IACnD;IAEA,MAAME,WAAWN,QACZ,MAAM,CAACG,CAAAA,IAAKA,EAAE,QAAQ,EACtB,GAAG,CAACA,CAAAA,IAAKE,UAAUF,EAAE,WAAW,EAAEA,EAAE,QAAQ;IACjDH,QACK,MAAM,CAACG,CAAAA,IAAK,CAACA,EAAE,QAAQ,IAAIA,EAAE,QAAQ,EACrC,OAAO,CAACA,CAAAA,IAAKG,SAAS,IAAI,CAACD,UAAUF,EAAE,WAAW,EAAEA,EAAE,QAAQ;IAEnE,MAAMI,QAAQ;QACV;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;WACGL;QACH;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;WACGI;QACH;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACH;IAEDE,QAAQ,MAAM,CAAC,KAAK,CAACD,MAAM,IAAI,CAAC,QAAQ;AAC5C;AAEA,SAASF,UAAUI,KAAa,EAAEC,IAAY;IAC1C,OAAO,CAAC,EAAE,EAAED,MAAM,MAAM,CAAC,IAAI,EAAE,EAAEC,MAAM;AAC3C"}