@teambit/cli-mcp-server 0.0.11 → 0.0.13
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/README.docs.mdx +52 -30
- package/dist/README.docs.mdx +52 -30
- package/dist/cli-mcp-server.main.runtime.d.ts +13 -1
- package/dist/cli-mcp-server.main.runtime.js +213 -138
- package/dist/cli-mcp-server.main.runtime.js.map +1 -1
- package/dist/cli-mcp-server.spec.d.ts +1 -0
- package/dist/cli-mcp-server.spec.js +532 -0
- package/dist/cli-mcp-server.spec.js.map +1 -0
- package/dist/mcp-server.cmd.d.ts +15 -2
- package/dist/mcp-server.cmd.js +29 -2
- package/dist/mcp-server.cmd.js.map +1 -1
- package/dist/{preview-1748575149030.js → preview-1749007248643.js} +1 -1
- package/dist/setup-cmd.d.ts +23 -0
- package/dist/setup-cmd.js +58 -0
- package/dist/setup-cmd.js.map +1 -0
- package/dist/setup-utils.d.ts +53 -0
- package/dist/setup-utils.js +259 -0
- package/dist/setup-utils.js.map +1 -0
- package/package.json +17 -6
package/dist/mcp-server.cmd.js
CHANGED
|
@@ -3,24 +3,51 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.McpServerCmd = void 0;
|
|
6
|
+
exports.McpStartCmd = exports.McpServerCmd = void 0;
|
|
7
|
+
function _lodash() {
|
|
8
|
+
const data = require("lodash");
|
|
9
|
+
_lodash = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
7
14
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
17
|
class McpServerCmd {
|
|
11
18
|
constructor(mcpServer) {
|
|
12
19
|
this.mcpServer = mcpServer;
|
|
13
|
-
_defineProperty(this, "name", 'mcp-server');
|
|
20
|
+
_defineProperty(this, "name", 'mcp-server [sub-command]');
|
|
14
21
|
_defineProperty(this, "description", 'Start the Bit CLI Model Context Protocol (MCP) server for programmatic and remote access to Bit commands.');
|
|
15
22
|
_defineProperty(this, "alias", '');
|
|
16
23
|
_defineProperty(this, "group", 'advanced');
|
|
17
24
|
_defineProperty(this, "loader", false);
|
|
18
25
|
_defineProperty(this, "options", [['e', 'extended', 'Enable the full set of Bit CLI commands as MCP tools'], ['', 'include-only <commands>', 'Specify a subset of commands to expose as MCP tools. Use comma-separated list in quotes, e.g. "status,install,compile"'], ['', 'include-additional <commands>', 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes. Only applies when --extended is not used'], ['', 'exclude <commands>', 'Prevent specific commands from being exposed as MCP tools. Use comma-separated list in quotes'], ['', 'bit-bin <binary>', 'Specify the binary to use for running Bit commands (default: "bit")'], ['', 'consumer-project', 'For non-Bit workspaces that only consume Bit component packages. Enables only "schema", "show", and "remote_search" tools']]);
|
|
26
|
+
_defineProperty(this, "commands", []);
|
|
19
27
|
}
|
|
20
28
|
async wait(args, flags) {
|
|
29
|
+
if ((0, _lodash().compact)(args).length) {
|
|
30
|
+
throw new Error(`"${args}" is not a subcommand of "mcp-server", please run "bit mcp-server --help" to list the subcommands`);
|
|
31
|
+
}
|
|
21
32
|
await this.mcpServer.runMcpServer(flags);
|
|
22
33
|
}
|
|
23
34
|
}
|
|
24
35
|
exports.McpServerCmd = McpServerCmd;
|
|
36
|
+
class McpStartCmd {
|
|
37
|
+
constructor(mcpServer) {
|
|
38
|
+
this.mcpServer = mcpServer;
|
|
39
|
+
_defineProperty(this, "name", 'start');
|
|
40
|
+
_defineProperty(this, "description", 'Start the MCP server');
|
|
41
|
+
_defineProperty(this, "extendedDescription", 'Start the Model Context Protocol (MCP) server with the specified configuration');
|
|
42
|
+
_defineProperty(this, "alias", '');
|
|
43
|
+
_defineProperty(this, "group", 'advanced');
|
|
44
|
+
_defineProperty(this, "loader", false);
|
|
45
|
+
_defineProperty(this, "options", [['e', 'extended', 'Enable the full set of Bit CLI commands as MCP tools'], ['', 'include-only <commands>', 'Specify a subset of commands to expose as MCP tools. Use comma-separated list in quotes, e.g. "status,install,compile"'], ['', 'include-additional <commands>', 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes. Only applies when --extended is not used'], ['', 'exclude <commands>', 'Prevent specific commands from being exposed as MCP tools. Use comma-separated list in quotes'], ['', 'bit-bin <binary>', 'Specify the binary to use for running Bit commands (default: "bit")'], ['', 'consumer-project', 'For non-Bit workspaces that only consume Bit component packages. Enables only "schema", "show", and "remote_search" tools']]);
|
|
46
|
+
}
|
|
47
|
+
async wait(args, flags) {
|
|
48
|
+
await this.mcpServer.runMcpServer(flags);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.McpStartCmd = McpStartCmd;
|
|
25
52
|
|
|
26
53
|
//# sourceMappingURL=mcp-server.cmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_lodash","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","McpServerCmd","constructor","mcpServer","wait","args","flags","compact","length","Error","runMcpServer","exports","McpStartCmd"],"sources":["mcp-server.cmd.ts"],"sourcesContent":["import { compact } from 'lodash';\nimport { CLIArgs, Command, CommandOptions } from '@teambit/cli';\nimport { CliMcpServerMain } from './cli-mcp-server.main.runtime';\n\nexport type McpStartCmdOptions = {\n extended?: boolean;\n includeOnly?: string;\n includeAdditional?: string;\n exclude?: string;\n bitBin?: string;\n consumerProject?: boolean;\n};\n\nexport class McpServerCmd implements Command {\n name = 'mcp-server [sub-command]';\n description =\n 'Start the Bit CLI Model Context Protocol (MCP) server for programmatic and remote access to Bit commands.';\n alias = '';\n group = 'advanced';\n loader = false;\n options = [\n ['e', 'extended', 'Enable the full set of Bit CLI commands as MCP tools'],\n [\n '',\n 'include-only <commands>',\n 'Specify a subset of commands to expose as MCP tools. Use comma-separated list in quotes, e.g. \"status,install,compile\"',\n ],\n [\n '',\n 'include-additional <commands>',\n 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes. Only applies when --extended is not used',\n ],\n [\n '',\n 'exclude <commands>',\n 'Prevent specific commands from being exposed as MCP tools. Use comma-separated list in quotes',\n ],\n ['', 'bit-bin <binary>', 'Specify the binary to use for running Bit commands (default: \"bit\")'],\n [\n '',\n 'consumer-project',\n 'For non-Bit workspaces that only consume Bit component packages. Enables only \"schema\", \"show\", and \"remote_search\" tools',\n ],\n ] as CommandOptions;\n commands: Command[] = [];\n\n constructor(private mcpServer: CliMcpServerMain) {}\n\n async wait(args: CLIArgs, flags: McpStartCmdOptions): Promise<void> {\n if (compact(args).length) {\n throw new Error(\n `\"${args}\" is not a subcommand of \"mcp-server\", please run \"bit mcp-server --help\" to list the subcommands`\n );\n }\n\n await this.mcpServer.runMcpServer(flags);\n }\n}\n\nexport class McpStartCmd implements Command {\n name = 'start';\n description = 'Start the MCP server';\n extendedDescription = 'Start the Model Context Protocol (MCP) server with the specified configuration';\n alias = '';\n group = 'advanced';\n loader = false;\n options = [\n ['e', 'extended', 'Enable the full set of Bit CLI commands as MCP tools'],\n [\n '',\n 'include-only <commands>',\n 'Specify a subset of commands to expose as MCP tools. Use comma-separated list in quotes, e.g. \"status,install,compile\"',\n ],\n [\n '',\n 'include-additional <commands>',\n 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes. Only applies when --extended is not used',\n ],\n [\n '',\n 'exclude <commands>',\n 'Prevent specific commands from being exposed as MCP tools. Use comma-separated list in quotes',\n ],\n ['', 'bit-bin <binary>', 'Specify the binary to use for running Bit commands (default: \"bit\")'],\n [\n '',\n 'consumer-project',\n 'For non-Bit workspaces that only consume Bit component packages. Enables only \"schema\", \"show\", and \"remote_search\" tools',\n ],\n ] as CommandOptions;\n\n constructor(private mcpServer: CliMcpServerMain) {}\n\n async wait(args: CLIArgs, flags: McpStartCmdOptions): Promise<void> {\n await this.mcpServer.runMcpServer(flags);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiC,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAa1B,MAAMgB,YAAY,CAAoB;EAiC3CC,WAAWA,CAASC,SAA2B,EAAE;IAAA,KAA7BA,SAA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AkI,CACnI,EACD,CACE,EAAE,EACF,oBAAoB,EACpB,+FAA+F,CAChG,EACD,CAAC,EAAE,EAAE,kBAAkB,EAAE,qEAAqE,CAAC,EAC/F,CACE,EAAE,EACF,kBAAkB,EAClB,2HAA2H,CAC5H,CACF;EAEiD;EAElD,MAAMsB,IAAIA,CAACC,IAAa,EAAEC,KAAyB,EAAiB;IAClE,MAAM,IAAI,CAACH,SAAS,CAACO,YAAY,CAACJ,KAAK,CAAC;EAC1C;AACF;AAACK,OAAA,CAAAC,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
;
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.mcp_cli-mcp-server@0.0.
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.mcp_cli-mcp-server@0.0.13/dist/README.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { CliMcpServerMain } from './cli-mcp-server.main.runtime';
|
|
3
|
+
export type McpSetupCmdOptions = {
|
|
4
|
+
extended?: boolean;
|
|
5
|
+
consumerProject?: boolean;
|
|
6
|
+
includeOnly?: string;
|
|
7
|
+
includeAdditional?: string;
|
|
8
|
+
exclude?: string;
|
|
9
|
+
global?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare class McpSetupCmd implements Command {
|
|
12
|
+
private mcpServerMain;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
extendedDescription: string;
|
|
16
|
+
arguments: {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}[];
|
|
20
|
+
options: CommandOptions;
|
|
21
|
+
constructor(mcpServerMain: CliMcpServerMain);
|
|
22
|
+
report([editor]: [string], { extended, consumerProject, includeOnly, includeAdditional, exclude, global: isGlobal }: McpSetupCmdOptions): Promise<string>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.McpSetupCmd = void 0;
|
|
7
|
+
function _chalk() {
|
|
8
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
9
|
+
_chalk = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
class McpSetupCmd {
|
|
19
|
+
constructor(mcpServerMain) {
|
|
20
|
+
this.mcpServerMain = mcpServerMain;
|
|
21
|
+
_defineProperty(this, "name", 'setup [editor]');
|
|
22
|
+
_defineProperty(this, "description", 'Setup MCP integration with VS Code, Cursor, Windsurf, or other editors');
|
|
23
|
+
_defineProperty(this, "extendedDescription", 'Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, and Windsurf.');
|
|
24
|
+
_defineProperty(this, "arguments", [{
|
|
25
|
+
name: 'editor',
|
|
26
|
+
description: 'Editor to setup (default: vscode). Available: vscode, cursor, windsurf'
|
|
27
|
+
}]);
|
|
28
|
+
_defineProperty(this, "options", [['e', 'extended', 'Enable the full set of Bit CLI commands as MCP tools'], ['', 'consumer-project', 'Configure for non-Bit workspaces that only consume Bit component packages'], ['', 'include-only <commands>', 'Specify a subset of commands to expose as MCP tools. Use comma-separated list in quotes'], ['', 'include-additional <commands>', 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes'], ['', 'exclude <commands>', 'Prevent specific commands from being exposed as MCP tools. Use comma-separated list in quotes'], ['g', 'global', 'Setup global configuration (default: workspace-specific)']]);
|
|
29
|
+
}
|
|
30
|
+
async report([editor = 'vscode'], {
|
|
31
|
+
extended,
|
|
32
|
+
consumerProject,
|
|
33
|
+
includeOnly,
|
|
34
|
+
includeAdditional,
|
|
35
|
+
exclude,
|
|
36
|
+
global: isGlobal = false
|
|
37
|
+
}) {
|
|
38
|
+
try {
|
|
39
|
+
await this.mcpServerMain.setupEditor(editor, {
|
|
40
|
+
extended,
|
|
41
|
+
consumerProject,
|
|
42
|
+
includeOnly,
|
|
43
|
+
includeAdditional,
|
|
44
|
+
exclude,
|
|
45
|
+
isGlobal
|
|
46
|
+
});
|
|
47
|
+
const scope = isGlobal ? 'global' : 'workspace';
|
|
48
|
+
const editorName = this.mcpServerMain.getEditorDisplayName(editor);
|
|
49
|
+
return _chalk().default.green(`✓ Successfully configured ${editorName} MCP integration (${scope})`);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
const editorName = this.mcpServerMain.getEditorDisplayName(editor);
|
|
52
|
+
return _chalk().default.red(`Error setting up ${editorName} integration: ${error.message}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.McpSetupCmd = McpSetupCmd;
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=setup-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","McpSetupCmd","constructor","mcpServerMain","name","description","report","editor","extended","consumerProject","includeOnly","includeAdditional","exclude","global","isGlobal","setupEditor","scope","editorName","getEditorDisplayName","chalk","green","error","red","message","exports"],"sources":["setup-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { CliMcpServerMain } from './cli-mcp-server.main.runtime';\n\nexport type McpSetupCmdOptions = {\n extended?: boolean;\n consumerProject?: boolean;\n includeOnly?: string;\n includeAdditional?: string;\n exclude?: string;\n global?: boolean;\n};\n\nexport class McpSetupCmd implements Command {\n name = 'setup [editor]';\n description = 'Setup MCP integration with VS Code, Cursor, Windsurf, or other editors';\n extendedDescription =\n 'Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, and Windsurf.';\n arguments = [\n {\n name: 'editor',\n description: 'Editor to setup (default: vscode). Available: vscode, cursor, windsurf',\n },\n ];\n options = [\n ['e', 'extended', 'Enable the full set of Bit CLI commands as MCP tools'],\n ['', 'consumer-project', 'Configure for non-Bit workspaces that only consume Bit component packages'],\n [\n '',\n 'include-only <commands>',\n 'Specify a subset of commands to expose as MCP tools. Use comma-separated list in quotes',\n ],\n [\n '',\n 'include-additional <commands>',\n 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes',\n ],\n [\n '',\n 'exclude <commands>',\n 'Prevent specific commands from being exposed as MCP tools. Use comma-separated list in quotes',\n ],\n ['g', 'global', 'Setup global configuration (default: workspace-specific)'],\n ] as CommandOptions;\n\n constructor(private mcpServerMain: CliMcpServerMain) {}\n\n async report(\n [editor = 'vscode']: [string],\n { extended, consumerProject, includeOnly, includeAdditional, exclude, global: isGlobal = false }: McpSetupCmdOptions\n ): Promise<string> {\n try {\n await this.mcpServerMain.setupEditor(editor, {\n extended,\n consumerProject,\n includeOnly,\n includeAdditional,\n exclude,\n isGlobal,\n });\n\n const scope = isGlobal ? 'global' : 'workspace';\n const editorName = this.mcpServerMain.getEditorDisplayName(editor);\n return chalk.green(`✓ Successfully configured ${editorName} MCP integration (${scope})`);\n } catch (error) {\n const editorName = this.mcpServerMain.getEditorDisplayName(editor);\n return chalk.red(`Error setting up ${editorName} integration: ${(error as Error).message}`);\n }\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAYnB,MAAMgB,WAAW,CAAoB;EAgC1CC,WAAWA,CAASC,aAA+B,EAAE;IAAA,KAAjCA,aAA+B,GAA/BA,aAA+B;IAAAp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oBL,UAAU,iBAAkBI,KAAK,CAAWE,OAAO,EAAE,CAAC;IAC7F;EACF;AACF;AAACC,OAAA,CAAAvB,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for setting up MCP server configuration
|
|
3
|
+
*/
|
|
4
|
+
export interface SetupOptions {
|
|
5
|
+
extended?: boolean;
|
|
6
|
+
consumerProject?: boolean;
|
|
7
|
+
includeOnly?: string;
|
|
8
|
+
includeAdditional?: string;
|
|
9
|
+
exclude?: string;
|
|
10
|
+
isGlobal: boolean;
|
|
11
|
+
workspaceDir?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Utility class for setting up MCP server configurations across different editors
|
|
15
|
+
*/
|
|
16
|
+
export declare class McpSetupUtils {
|
|
17
|
+
/**
|
|
18
|
+
* Build MCP server arguments based on provided options
|
|
19
|
+
*/
|
|
20
|
+
static buildMcpServerArgs(options: SetupOptions): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Read and parse a JSON file, returning empty object if file doesn't exist
|
|
23
|
+
*/
|
|
24
|
+
static readJsonFile(filePath: string): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* Get display name for an editor
|
|
27
|
+
*/
|
|
28
|
+
static getEditorDisplayName(editor: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Get VS Code settings.json path based on global/workspace scope
|
|
31
|
+
*/
|
|
32
|
+
static getVSCodeSettingsPath(isGlobal: boolean, workspaceDir?: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Setup VS Code MCP integration
|
|
35
|
+
*/
|
|
36
|
+
static setupVSCode(options: SetupOptions): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get Cursor mcp.json path based on global/workspace scope
|
|
39
|
+
*/
|
|
40
|
+
static getCursorSettingsPath(isGlobal: boolean, workspaceDir?: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Setup Cursor MCP integration
|
|
43
|
+
*/
|
|
44
|
+
static setupCursor(options: SetupOptions): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Get Windsurf mcp.json path based on global/workspace scope
|
|
47
|
+
*/
|
|
48
|
+
static getWindsurfSettingsPath(isGlobal: boolean, workspaceDir?: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Setup Windsurf MCP integration
|
|
51
|
+
*/
|
|
52
|
+
static setupWindsurf(options: SetupOptions): Promise<void>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.McpSetupUtils = void 0;
|
|
7
|
+
function _fsExtra() {
|
|
8
|
+
const data = _interopRequireDefault(require("fs-extra"));
|
|
9
|
+
_fsExtra = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _path() {
|
|
15
|
+
const data = _interopRequireDefault(require("path"));
|
|
16
|
+
_path = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _os() {
|
|
22
|
+
const data = require("os");
|
|
23
|
+
_os = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
/**
|
|
30
|
+
* Options for setting up MCP server configuration
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Utility class for setting up MCP server configurations across different editors
|
|
35
|
+
*/
|
|
36
|
+
class McpSetupUtils {
|
|
37
|
+
/**
|
|
38
|
+
* Build MCP server arguments based on provided options
|
|
39
|
+
*/
|
|
40
|
+
static buildMcpServerArgs(options) {
|
|
41
|
+
const {
|
|
42
|
+
extended,
|
|
43
|
+
consumerProject,
|
|
44
|
+
includeOnly,
|
|
45
|
+
includeAdditional,
|
|
46
|
+
exclude
|
|
47
|
+
} = options;
|
|
48
|
+
const args = ['mcp-server'];
|
|
49
|
+
if (extended) {
|
|
50
|
+
args.push('--extended');
|
|
51
|
+
}
|
|
52
|
+
if (consumerProject) {
|
|
53
|
+
args.push('--consumer-project');
|
|
54
|
+
}
|
|
55
|
+
if (includeOnly) {
|
|
56
|
+
args.push('--include-only', includeOnly);
|
|
57
|
+
}
|
|
58
|
+
if (includeAdditional) {
|
|
59
|
+
args.push('--include-additional', includeAdditional);
|
|
60
|
+
}
|
|
61
|
+
if (exclude) {
|
|
62
|
+
args.push('--exclude', exclude);
|
|
63
|
+
}
|
|
64
|
+
return args;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Read and parse a JSON file, returning empty object if file doesn't exist
|
|
69
|
+
*/
|
|
70
|
+
static async readJsonFile(filePath) {
|
|
71
|
+
if (!(await _fsExtra().default.pathExists(filePath))) {
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
const content = await _fsExtra().default.readFile(filePath, 'utf8');
|
|
76
|
+
return JSON.parse(content);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
throw new Error(`Failed to parse ${_path().default.basename(filePath)}: ${error.message}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Get display name for an editor
|
|
84
|
+
*/
|
|
85
|
+
static getEditorDisplayName(editor) {
|
|
86
|
+
switch (editor) {
|
|
87
|
+
case 'vscode':
|
|
88
|
+
return 'VS Code';
|
|
89
|
+
case 'cursor':
|
|
90
|
+
return 'Cursor';
|
|
91
|
+
case 'windsurf':
|
|
92
|
+
return 'Windsurf';
|
|
93
|
+
default:
|
|
94
|
+
return editor;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Get VS Code settings.json path based on global/workspace scope
|
|
100
|
+
*/
|
|
101
|
+
static getVSCodeSettingsPath(isGlobal, workspaceDir) {
|
|
102
|
+
if (isGlobal) {
|
|
103
|
+
// Global VS Code settings
|
|
104
|
+
const platform = process.platform;
|
|
105
|
+
switch (platform) {
|
|
106
|
+
case 'win32':
|
|
107
|
+
return _path().default.join((0, _os().homedir)(), 'AppData', 'Roaming', 'Code', 'User', 'settings.json');
|
|
108
|
+
case 'darwin':
|
|
109
|
+
return _path().default.join((0, _os().homedir)(), 'Library', 'Application Support', 'Code', 'User', 'settings.json');
|
|
110
|
+
case 'linux':
|
|
111
|
+
return _path().default.join((0, _os().homedir)(), '.config', 'Code', 'User', 'settings.json');
|
|
112
|
+
default:
|
|
113
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
// Workspace-specific settings
|
|
117
|
+
const targetDir = workspaceDir || process.cwd();
|
|
118
|
+
return _path().default.join(targetDir, '.vscode', 'settings.json');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Setup VS Code MCP integration
|
|
124
|
+
*/
|
|
125
|
+
static async setupVSCode(options) {
|
|
126
|
+
const {
|
|
127
|
+
isGlobal,
|
|
128
|
+
workspaceDir
|
|
129
|
+
} = options;
|
|
130
|
+
|
|
131
|
+
// Determine settings.json path
|
|
132
|
+
const settingsPath = this.getVSCodeSettingsPath(isGlobal, workspaceDir);
|
|
133
|
+
|
|
134
|
+
// Ensure directory exists
|
|
135
|
+
await _fsExtra().default.ensureDir(_path().default.dirname(settingsPath));
|
|
136
|
+
|
|
137
|
+
// Read existing settings or create empty object
|
|
138
|
+
const settings = await this.readJsonFile(settingsPath);
|
|
139
|
+
|
|
140
|
+
// Build MCP server args
|
|
141
|
+
const args = this.buildMcpServerArgs(options);
|
|
142
|
+
|
|
143
|
+
// Create or update MCP configuration
|
|
144
|
+
if (!settings.mcp) {
|
|
145
|
+
settings.mcp = {};
|
|
146
|
+
}
|
|
147
|
+
if (!settings.mcp.servers) {
|
|
148
|
+
settings.mcp.servers = {};
|
|
149
|
+
}
|
|
150
|
+
settings.mcp.servers['bit-cli'] = {
|
|
151
|
+
command: 'bit',
|
|
152
|
+
args: args
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// Write updated settings
|
|
156
|
+
await _fsExtra().default.writeFile(settingsPath, JSON.stringify(settings, null, 2));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Get Cursor mcp.json path based on global/workspace scope
|
|
161
|
+
*/
|
|
162
|
+
static getCursorSettingsPath(isGlobal, workspaceDir) {
|
|
163
|
+
if (isGlobal) {
|
|
164
|
+
// Global Cursor MCP configuration
|
|
165
|
+
return _path().default.join((0, _os().homedir)(), '.cursor', 'mcp.json');
|
|
166
|
+
} else {
|
|
167
|
+
// Workspace-specific MCP configuration
|
|
168
|
+
const targetDir = workspaceDir || process.cwd();
|
|
169
|
+
return _path().default.join(targetDir, '.cursor', 'mcp.json');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Setup Cursor MCP integration
|
|
175
|
+
*/
|
|
176
|
+
static async setupCursor(options) {
|
|
177
|
+
const {
|
|
178
|
+
isGlobal,
|
|
179
|
+
workspaceDir
|
|
180
|
+
} = options;
|
|
181
|
+
|
|
182
|
+
// Determine mcp.json path
|
|
183
|
+
const mcpConfigPath = this.getCursorSettingsPath(isGlobal, workspaceDir);
|
|
184
|
+
|
|
185
|
+
// Ensure directory exists
|
|
186
|
+
await _fsExtra().default.ensureDir(_path().default.dirname(mcpConfigPath));
|
|
187
|
+
|
|
188
|
+
// Read existing MCP configuration or create empty object
|
|
189
|
+
const mcpConfig = await this.readJsonFile(mcpConfigPath);
|
|
190
|
+
|
|
191
|
+
// Build MCP server args
|
|
192
|
+
const args = this.buildMcpServerArgs(options);
|
|
193
|
+
|
|
194
|
+
// Create or update MCP configuration for Cursor
|
|
195
|
+
if (!mcpConfig.mcpServers) {
|
|
196
|
+
mcpConfig.mcpServers = {};
|
|
197
|
+
}
|
|
198
|
+
mcpConfig.mcpServers.bit = {
|
|
199
|
+
type: 'stdio',
|
|
200
|
+
command: 'bit',
|
|
201
|
+
args: args
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// Write updated MCP configuration
|
|
205
|
+
await _fsExtra().default.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Get Windsurf mcp.json path based on global/workspace scope
|
|
210
|
+
*/
|
|
211
|
+
static getWindsurfSettingsPath(isGlobal, workspaceDir) {
|
|
212
|
+
if (isGlobal) {
|
|
213
|
+
// Global Windsurf MCP configuration
|
|
214
|
+
return _path().default.join((0, _os().homedir)(), '.windsurf', 'mcp.json');
|
|
215
|
+
} else {
|
|
216
|
+
// Workspace-specific MCP configuration
|
|
217
|
+
const targetDir = workspaceDir || process.cwd();
|
|
218
|
+
return _path().default.join(targetDir, '.windsurf', 'mcp.json');
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Setup Windsurf MCP integration
|
|
224
|
+
*/
|
|
225
|
+
static async setupWindsurf(options) {
|
|
226
|
+
const {
|
|
227
|
+
isGlobal,
|
|
228
|
+
workspaceDir
|
|
229
|
+
} = options;
|
|
230
|
+
|
|
231
|
+
// Determine mcp.json path
|
|
232
|
+
const mcpConfigPath = this.getWindsurfSettingsPath(isGlobal, workspaceDir);
|
|
233
|
+
|
|
234
|
+
// Ensure directory exists
|
|
235
|
+
await _fsExtra().default.ensureDir(_path().default.dirname(mcpConfigPath));
|
|
236
|
+
|
|
237
|
+
// Read existing MCP configuration or create empty object
|
|
238
|
+
const mcpConfig = await this.readJsonFile(mcpConfigPath);
|
|
239
|
+
|
|
240
|
+
// Build MCP server args
|
|
241
|
+
const args = this.buildMcpServerArgs(options);
|
|
242
|
+
|
|
243
|
+
// Create or update MCP configuration for Windsurf
|
|
244
|
+
if (!mcpConfig.mcpServers) {
|
|
245
|
+
mcpConfig.mcpServers = {};
|
|
246
|
+
}
|
|
247
|
+
mcpConfig.mcpServers.bit = {
|
|
248
|
+
type: 'stdio',
|
|
249
|
+
command: 'bit',
|
|
250
|
+
args: args
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
// Write updated MCP configuration
|
|
254
|
+
await _fsExtra().default.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
exports.McpSetupUtils = McpSetupUtils;
|
|
258
|
+
|
|
259
|
+
//# sourceMappingURL=setup-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_os","e","__esModule","default","McpSetupUtils","buildMcpServerArgs","options","extended","consumerProject","includeOnly","includeAdditional","exclude","args","push","readJsonFile","filePath","fs","pathExists","content","readFile","JSON","parse","error","Error","path","basename","message","getEditorDisplayName","editor","getVSCodeSettingsPath","isGlobal","workspaceDir","platform","process","join","homedir","targetDir","cwd","setupVSCode","settingsPath","ensureDir","dirname","settings","mcp","servers","command","writeFile","stringify","getCursorSettingsPath","setupCursor","mcpConfigPath","mcpConfig","mcpServers","bit","type","getWindsurfSettingsPath","setupWindsurf","exports"],"sources":["setup-utils.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport { homedir } from 'os';\n\n/**\n * Options for setting up MCP server configuration\n */\nexport interface SetupOptions {\n extended?: boolean;\n consumerProject?: boolean;\n includeOnly?: string;\n includeAdditional?: string;\n exclude?: string;\n isGlobal: boolean;\n workspaceDir?: string;\n}\n\n/**\n * Utility class for setting up MCP server configurations across different editors\n */\nexport class McpSetupUtils {\n /**\n * Build MCP server arguments based on provided options\n */\n static buildMcpServerArgs(options: SetupOptions): string[] {\n const { extended, consumerProject, includeOnly, includeAdditional, exclude } = options;\n const args = ['mcp-server'];\n\n if (extended) {\n args.push('--extended');\n }\n\n if (consumerProject) {\n args.push('--consumer-project');\n }\n\n if (includeOnly) {\n args.push('--include-only', includeOnly);\n }\n\n if (includeAdditional) {\n args.push('--include-additional', includeAdditional);\n }\n\n if (exclude) {\n args.push('--exclude', exclude);\n }\n\n return args;\n }\n\n /**\n * Read and parse a JSON file, returning empty object if file doesn't exist\n */\n static async readJsonFile(filePath: string): Promise<any> {\n if (!(await fs.pathExists(filePath))) {\n return {};\n }\n\n try {\n const content = await fs.readFile(filePath, 'utf8');\n return JSON.parse(content);\n } catch (error) {\n throw new Error(`Failed to parse ${path.basename(filePath)}: ${(error as Error).message}`);\n }\n }\n\n /**\n * Get display name for an editor\n */\n static getEditorDisplayName(editor: string): string {\n switch (editor) {\n case 'vscode':\n return 'VS Code';\n case 'cursor':\n return 'Cursor';\n case 'windsurf':\n return 'Windsurf';\n default:\n return editor;\n }\n }\n\n /**\n * Get VS Code settings.json path based on global/workspace scope\n */\n static getVSCodeSettingsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global VS Code settings\n const platform = process.platform;\n switch (platform) {\n case 'win32':\n return path.join(homedir(), 'AppData', 'Roaming', 'Code', 'User', 'settings.json');\n case 'darwin':\n return path.join(homedir(), 'Library', 'Application Support', 'Code', 'User', 'settings.json');\n case 'linux':\n return path.join(homedir(), '.config', 'Code', 'User', 'settings.json');\n default:\n throw new Error(`Unsupported platform: ${platform}`);\n }\n } else {\n // Workspace-specific settings\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.vscode', 'settings.json');\n }\n }\n\n /**\n * Setup VS Code MCP integration\n */\n static async setupVSCode(options: SetupOptions): Promise<void> {\n const { isGlobal, workspaceDir } = options;\n\n // Determine settings.json path\n const settingsPath = this.getVSCodeSettingsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(settingsPath));\n\n // Read existing settings or create empty object\n const settings = await this.readJsonFile(settingsPath);\n\n // Build MCP server args\n const args = this.buildMcpServerArgs(options);\n\n // Create or update MCP configuration\n if (!settings.mcp) {\n settings.mcp = {};\n }\n\n if (!settings.mcp.servers) {\n settings.mcp.servers = {};\n }\n\n settings.mcp.servers['bit-cli'] = {\n command: 'bit',\n args: args,\n };\n\n // Write updated settings\n await fs.writeFile(settingsPath, JSON.stringify(settings, null, 2));\n }\n\n /**\n * Get Cursor mcp.json path based on global/workspace scope\n */\n static getCursorSettingsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global Cursor MCP configuration\n return path.join(homedir(), '.cursor', 'mcp.json');\n } else {\n // Workspace-specific MCP configuration\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.cursor', 'mcp.json');\n }\n }\n\n /**\n * Setup Cursor MCP integration\n */\n static async setupCursor(options: SetupOptions): Promise<void> {\n const { isGlobal, workspaceDir } = options;\n\n // Determine mcp.json path\n const mcpConfigPath = this.getCursorSettingsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(mcpConfigPath));\n\n // Read existing MCP configuration or create empty object\n const mcpConfig = await this.readJsonFile(mcpConfigPath);\n\n // Build MCP server args\n const args = this.buildMcpServerArgs(options);\n\n // Create or update MCP configuration for Cursor\n if (!mcpConfig.mcpServers) {\n mcpConfig.mcpServers = {};\n }\n\n mcpConfig.mcpServers.bit = {\n type: 'stdio',\n command: 'bit',\n args: args,\n };\n\n // Write updated MCP configuration\n await fs.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));\n }\n\n /**\n * Get Windsurf mcp.json path based on global/workspace scope\n */\n static getWindsurfSettingsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global Windsurf MCP configuration\n return path.join(homedir(), '.windsurf', 'mcp.json');\n } else {\n // Workspace-specific MCP configuration\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.windsurf', 'mcp.json');\n }\n }\n\n /**\n * Setup Windsurf MCP integration\n */\n static async setupWindsurf(options: SetupOptions): Promise<void> {\n const { isGlobal, workspaceDir } = options;\n\n // Determine mcp.json path\n const mcpConfigPath = this.getWindsurfSettingsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(mcpConfigPath));\n\n // Read existing MCP configuration or create empty object\n const mcpConfig = await this.readJsonFile(mcpConfigPath);\n\n // Build MCP server args\n const args = this.buildMcpServerArgs(options);\n\n // Create or update MCP configuration for Windsurf\n if (!mcpConfig.mcpServers) {\n mcpConfig.mcpServers = {};\n }\n\n mcpConfig.mcpServers.bit = {\n type: 'stdio',\n command: 'bit',\n args: args,\n };\n\n // Write updated MCP configuration\n await fs.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,IAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6B,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7B;AACA;AACA;;AAWA;AACA;AACA;AACO,MAAMG,aAAa,CAAC;EACzB;AACF;AACA;EACE,OAAOC,kBAAkBA,CAACC,OAAqB,EAAY;IACzD,MAAM;MAAEC,QAAQ;MAAEC,eAAe;MAAEC,WAAW;MAAEC,iBAAiB;MAAEC;IAA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AMtC,IAAI,GAAG,IAAI,CAACP,kBAAkB,CAACC,OAAO,CAAC;;IAE7C;IACA,IAAI,CAAC6C,SAAS,CAACC,UAAU,EAAE;MACzBD,SAAS,CAACC,UAAU,GAAG,CAAC,CAAC;IAC3B;IAEAD,SAAS,CAACC,UAAU,CAACC,GAAG,GAAG;MACzBC,IAAI,EAAE,OAAO;MACbT,OAAO,EAAE,KAAK;MACdjC,IAAI,EAAEA;IACR,CAAC;;IAED;IACA,MAAMI,kBAAE,CAAC8B,SAAS,CAACI,aAAa,EAAE9B,IAAI,CAAC2B,SAAS,CAACI,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;EACvE;AACF;AAACM,OAAA,CAAArD,aAAA,GAAAA,aAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/cli-mcp-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/mcp/cli-mcp-server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.mcp",
|
|
8
8
|
"name": "cli-mcp-server",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.13"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"fs-extra": "10.0.0",
|
|
12
13
|
"node-fetch": "2.6.7",
|
|
13
14
|
"zod": "^3.24.4",
|
|
14
15
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
16
|
+
"lodash": "4.17.21",
|
|
17
|
+
"chalk": "4.1.2",
|
|
15
18
|
"@teambit/harmony": "0.4.7",
|
|
16
|
-
"@teambit/cli": "0.0.
|
|
19
|
+
"@teambit/cli": "0.0.1202",
|
|
17
20
|
"@teambit/legacy.constants": "0.0.11",
|
|
18
|
-
"@teambit/logger": "0.0.
|
|
21
|
+
"@teambit/logger": "0.0.1295",
|
|
19
22
|
"@teambit/scope.network": "0.0.50"
|
|
20
23
|
},
|
|
21
24
|
"devDependencies": {
|
|
25
|
+
"@types/fs-extra": "9.0.7",
|
|
22
26
|
"@types/node-fetch": "2.5.12",
|
|
23
|
-
"@
|
|
27
|
+
"@types/lodash": "4.14.165",
|
|
28
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.69",
|
|
29
|
+
"@teambit/component.testing.mock-components": "0.0.312",
|
|
30
|
+
"@teambit/harmony.testing.load-aspect": "0.0.307",
|
|
31
|
+
"@teambit/workspace.testing.mock-workspace": "0.0.89"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"chai": "4.3.0",
|
|
35
|
+
"@types/chai": "4.3.19"
|
|
24
36
|
},
|
|
25
|
-
"peerDependencies": {},
|
|
26
37
|
"license": "Apache-2.0",
|
|
27
38
|
"optionalDependencies": {},
|
|
28
39
|
"peerDependenciesMeta": {},
|