@webiny/mcp 6.3.0-beta.4 → 6.4.0-beta.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/agents/claude.js +23 -34
- package/agents/claude.js.map +1 -1
- package/agents/cline.js +17 -30
- package/agents/cline.js.map +1 -1
- package/agents/copilot.js +49 -63
- package/agents/copilot.js.map +1 -1
- package/agents/cursor.js +23 -34
- package/agents/cursor.js.map +1 -1
- package/agents/discover.js +17 -20
- package/agents/discover.js.map +1 -1
- package/agents/instructions.js +81 -20
- package/agents/instructions.js.map +1 -1
- package/agents/kiro.js +23 -34
- package/agents/kiro.js.map +1 -1
- package/agents/opencode.js +53 -76
- package/agents/opencode.js.map +1 -1
- package/agents/shared.js +62 -113
- package/agents/shared.js.map +1 -1
- package/agents/types.js +0 -3
- package/agents/windsurf.js +23 -34
- package/agents/windsurf.js.map +1 -1
- package/bin.js +0 -2
- package/cli/ConfigureMcp.js +31 -38
- package/cli/ConfigureMcp.js.map +1 -1
- package/cli/McpServer.js +145 -184
- package/cli/McpServer.js.map +1 -1
- package/cli.js +51 -50
- package/cli.js.map +1 -1
- package/index.js +0 -7
- package/package.json +4 -4
- package/skills/generated/api/SKILL.md +6 -1
- package/skills/generated/api/cms/SKILL.md +19 -1
- package/ui.js +20 -28
- package/ui.js.map +1 -1
- package/agents/types.js.map +0 -1
- package/bin.js.map +0 -1
- package/index.js.map +0 -1
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 {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
package/agents/claude.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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 {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
package/agents/cline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
recursive: true
|
|
12
|
+
const dir = dirname(configPath);
|
|
13
|
+
if (!existsSync(dir)) mkdirSync(dir, {
|
|
14
|
+
recursive: true
|
|
27
15
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
45
|
-
ui.
|
|
46
|
-
return
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
package/agents/copilot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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 {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
package/agents/cursor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
package/agents/discover.js
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
22
|
-
return agents;
|
|
17
|
+
cache = agents;
|
|
18
|
+
return agents;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
package/agents/discover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
package/agents/instructions.js
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
83
|
+
return ` ${agent.padEnd(17)} ${path}`;
|
|
24
84
|
}
|
|
85
|
+
export { printInstructions };
|
|
25
86
|
|
|
26
87
|
//# sourceMappingURL=instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|