@teambit/cli-mcp-server 0.0.0-00149e000ea14bbdcb0391c0d576b4a2b40f8cde

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ import type { Command, CommandOptions } from '@teambit/cli';
2
+ import type { CliMcpServerMain } from './cli-mcp-server.main.runtime';
3
+ export type McpSetupCmdOptions = {
4
+ consumerProject?: boolean;
5
+ includeAdditional?: string;
6
+ global?: boolean;
7
+ };
8
+ export declare class McpSetupCmd implements Command {
9
+ private mcpServerMain;
10
+ name: string;
11
+ description: string;
12
+ extendedDescription: string;
13
+ arguments: {
14
+ name: string;
15
+ description: string;
16
+ }[];
17
+ options: CommandOptions;
18
+ constructor(mcpServerMain: CliMcpServerMain);
19
+ report([editor]: [string], { consumerProject, includeAdditional, global: isGlobal }: McpSetupCmdOptions): Promise<string>;
20
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.McpSetupCmd = void 0;
7
+ function _cli() {
8
+ const data = require("@teambit/cli");
9
+ _cli = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
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; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
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); }
17
+ class McpSetupCmd {
18
+ constructor(mcpServerMain) {
19
+ this.mcpServerMain = mcpServerMain;
20
+ _defineProperty(this, "name", 'setup [editor]');
21
+ _defineProperty(this, "description", 'Setup MCP integration with VS Code, Cursor, Windsurf, Roo Code, Cline, Claude Code, or other editors');
22
+ _defineProperty(this, "extendedDescription", 'Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, Windsurf, Roo Code, Cline, and Claude Code.');
23
+ _defineProperty(this, "arguments", [{
24
+ name: 'editor',
25
+ description: 'Editor to setup (default: vscode). Available: vscode, cursor, windsurf, roo, cline, claude-code'
26
+ }]);
27
+ _defineProperty(this, "options", [['', 'consumer-project', 'Configure for non-Bit workspaces that only consume Bit component packages'], ['', 'include-additional <commands>', 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes'], ['g', 'global', 'Setup global configuration (default: workspace-specific)']]);
28
+ }
29
+ async report([editor = 'vscode'], {
30
+ consumerProject,
31
+ includeAdditional,
32
+ global: isGlobal = false
33
+ }) {
34
+ try {
35
+ await this.mcpServerMain.setupEditor(editor, {
36
+ consumerProject,
37
+ includeAdditional,
38
+ isGlobal
39
+ });
40
+ const scope = isGlobal ? 'global' : 'workspace';
41
+ const editorName = this.mcpServerMain.getEditorDisplayName(editor);
42
+
43
+ // Get the config file path based on the editor type
44
+ const configPath = this.mcpServerMain.getEditorConfigPath(editor, isGlobal);
45
+
46
+ // Special message for Claude Code to mention restart requirement
47
+ if (editor.toLowerCase() === 'claude-code') {
48
+ return [(0, _cli().formatSuccessSummary)(`configured ${editorName} MCP integration (${scope})`), ` Configuration written to: ${configPath}`, (0, _cli().formatHint)(` Restart Claude Code to use the Bit MCP tools.`)].join('\n');
49
+ }
50
+ return [(0, _cli().formatSuccessSummary)(`configured ${editorName} MCP integration (${scope})`), ` Configuration written to: ${configPath}`].join('\n');
51
+ } catch (error) {
52
+ const editorName = this.mcpServerMain.getEditorDisplayName(editor);
53
+ return `${_cli().errorSymbol} Error setting up ${editorName} integration: ${error.message}`;
54
+ }
55
+ }
56
+ }
57
+ exports.McpSetupCmd = McpSetupCmd;
58
+
59
+ //# sourceMappingURL=setup-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_cli","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","McpSetupCmd","constructor","mcpServerMain","name","description","report","editor","consumerProject","includeAdditional","global","isGlobal","setupEditor","scope","editorName","getEditorDisplayName","configPath","getEditorConfigPath","toLowerCase","formatSuccessSummary","formatHint","join","error","errorSymbol","message","exports"],"sources":["setup-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { formatSuccessSummary, formatHint, errorSymbol } from '@teambit/cli';\nimport type { CliMcpServerMain } from './cli-mcp-server.main.runtime';\n\nexport type McpSetupCmdOptions = {\n consumerProject?: boolean;\n includeAdditional?: 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, Roo Code, Cline, Claude Code, or other editors';\n extendedDescription =\n 'Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, Windsurf, Roo Code, Cline, and Claude Code.';\n arguments = [\n {\n name: 'editor',\n description: 'Editor to setup (default: vscode). Available: vscode, cursor, windsurf, roo, cline, claude-code',\n },\n ];\n options = [\n ['', 'consumer-project', 'Configure for non-Bit workspaces that only consume Bit component packages'],\n [\n '',\n 'include-additional <commands>',\n 'Add specific commands to the default MCP tools set. 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 { consumerProject, includeAdditional, global: isGlobal = false }: McpSetupCmdOptions\n ): Promise<string> {\n try {\n await this.mcpServerMain.setupEditor(editor, {\n consumerProject,\n includeAdditional,\n isGlobal,\n });\n\n const scope = isGlobal ? 'global' : 'workspace';\n const editorName = this.mcpServerMain.getEditorDisplayName(editor);\n\n // Get the config file path based on the editor type\n const configPath = this.mcpServerMain.getEditorConfigPath(editor, isGlobal);\n\n // Special message for Claude Code to mention restart requirement\n if (editor.toLowerCase() === 'claude-code') {\n return [\n formatSuccessSummary(`configured ${editorName} MCP integration (${scope})`),\n ` Configuration written to: ${configPath}`,\n formatHint(` Restart Claude Code to use the Bit MCP tools.`),\n ].join('\\n');\n }\n\n return [\n formatSuccessSummary(`configured ${editorName} MCP integration (${scope})`),\n ` Configuration written to: ${configPath}`,\n ].join('\\n');\n } catch (error) {\n const editorName = this.mcpServerMain.getEditorDisplayName(editor);\n return `${errorSymbol} Error setting up ${editorName} integration: ${(error as Error).message}`;\n }\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6E,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;A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OAAO,CACL,IAAAF,2BAAoB,EAAC,cAAcL,UAAU,qBAAqBD,KAAK,GAAG,CAAC,EAC3E,+BAA+BG,UAAU,EAAE,CAC5C,CAACK,IAAI,CAAC,IAAI,CAAC;IACd,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMR,UAAU,GAAG,IAAI,CAACX,aAAa,CAACY,oBAAoB,CAACR,MAAM,CAAC;MAClE,OAAO,GAAGgB,kBAAW,qBAAqBT,UAAU,iBAAkBQ,KAAK,CAAWE,OAAO,EAAE;IACjG;EACF;AACF;AAACC,OAAA,CAAAxB,WAAA,GAAAA,WAAA","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@teambit/cli-mcp-server",
3
+ "version": "0.0.0-00149e000ea14bbdcb0391c0d576b4a2b40f8cde",
4
+ "homepage": "https://bit.cloud/teambit/mcp/cli-mcp-server",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.mcp",
8
+ "name": "cli-mcp-server",
9
+ "version": "00149e000ea14bbdcb0391c0d576b4a2b40f8cde"
10
+ },
11
+ "dependencies": {
12
+ "comment-json": "4.2.5",
13
+ "fs-extra": "10.0.0",
14
+ "node-fetch": "2.6.7",
15
+ "strip-ansi": "6.0.0",
16
+ "zod": "^3.24.4",
17
+ "@modelcontextprotocol/sdk": "^1.22.0",
18
+ "lodash": "4.17.21",
19
+ "chalk": "4.1.2",
20
+ "@teambit/harmony": "0.4.12",
21
+ "@teambit/cli": "0.0.1352",
22
+ "@teambit/legacy.constants": "0.0.34",
23
+ "@teambit/logger": "0.0.1445",
24
+ "@teambit/mcp.mcp-config-writer": "0.0.13",
25
+ "@teambit/scope.modules.find-scope-path": "0.0.36",
26
+ "@teambit/scope.network": "0.0.137",
27
+ "@teambit/component-id": "1.2.4",
28
+ "@teambit/component.modules.component-url": "0.0.195",
29
+ "@teambit/legacy.consumer": "0.0.137",
30
+ "@teambit/pkg.modules.component-package-name": "0.0.144",
31
+ "@teambit/scope.remotes": "0.0.137"
32
+ },
33
+ "devDependencies": {
34
+ "@types/fs-extra": "9.0.7",
35
+ "@types/node-fetch": "2.5.12",
36
+ "@types/lodash": "4.14.165",
37
+ "@teambit/harmony.envs.core-aspect-env": "1.0.0",
38
+ "@teambit/component.testing.mock-components": "0.0.0-d34e388da8191a13e2fb4d3e784e1ae4c36afd0f",
39
+ "@teambit/harmony.testing.load-aspect": "0.0.0-d7c4c9b039fe744729501c2dde4fbac2a1355294",
40
+ "@teambit/workspace.testing.mock-workspace": "0.0.0-96a96beb354ff6103587380aeac6f837a0d7c424"
41
+ },
42
+ "peerDependencies": {
43
+ "chai": "5.2.1"
44
+ },
45
+ "license": "Apache-2.0",
46
+ "optionalDependencies": {},
47
+ "peerDependenciesMeta": {},
48
+ "exports": {
49
+ ".": {
50
+ "types": "./dist/index.d.ts",
51
+ "node": {
52
+ "require": "./dist/index.js",
53
+ "import": "./dist/esm.mjs"
54
+ },
55
+ "default": "./dist/index.js"
56
+ },
57
+ "./dist/*": "./dist/*",
58
+ "./artifacts/*": "./artifacts/*"
59
+ },
60
+ "private": false,
61
+ "engines": {
62
+ "node": ">=16.0.0"
63
+ },
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "https://github.com/teambit/bit"
67
+ },
68
+ "keywords": [
69
+ "bit",
70
+ "bit-aspect",
71
+ "bit-core-aspect",
72
+ "components",
73
+ "collaboration",
74
+ "web"
75
+ ]
76
+ }
@@ -0,0 +1,41 @@
1
+ declare module '*.png' {
2
+ const value: any;
3
+ export = value;
4
+ }
5
+ declare module '*.svg' {
6
+ import type { FunctionComponent, SVGProps } from 'react';
7
+
8
+ export const ReactComponent: FunctionComponent<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
11
+ const src: string;
12
+ export default src;
13
+ }
14
+ declare module '*.jpg' {
15
+ const value: any;
16
+ export = value;
17
+ }
18
+ declare module '*.jpeg' {
19
+ const value: any;
20
+ export = value;
21
+ }
22
+ declare module '*.gif' {
23
+ const value: any;
24
+ export = value;
25
+ }
26
+ declare module '*.bmp' {
27
+ const value: any;
28
+ export = value;
29
+ }
30
+ declare module '*.otf' {
31
+ const value: any;
32
+ export = value;
33
+ }
34
+ declare module '*.woff' {
35
+ const value: any;
36
+ export = value;
37
+ }
38
+ declare module '*.woff2' {
39
+ const value: any;
40
+ export = value;
41
+ }
@@ -0,0 +1,46 @@
1
+ declare module '*.module.css' {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
5
+ declare module '*.module.scss' {
6
+ const classes: { readonly [key: string]: string };
7
+ export default classes;
8
+ }
9
+ declare module '*.module.sass' {
10
+ const classes: { readonly [key: string]: string };
11
+ export default classes;
12
+ }
13
+
14
+ declare module '*.module.less' {
15
+ const classes: { readonly [key: string]: string };
16
+ export default classes;
17
+ }
18
+
19
+ declare module '*.less' {
20
+ const classes: { readonly [key: string]: string };
21
+ export default classes;
22
+ }
23
+
24
+ declare module '*.css' {
25
+ const classes: { readonly [key: string]: string };
26
+ export default classes;
27
+ }
28
+
29
+ declare module '*.sass' {
30
+ const classes: { readonly [key: string]: string };
31
+ export default classes;
32
+ }
33
+
34
+ declare module '*.scss' {
35
+ const classes: { readonly [key: string]: string };
36
+ export default classes;
37
+ }
38
+
39
+ declare module '*.mdx' {
40
+ const component: any;
41
+ export default component;
42
+ }
43
+
44
+ // `reset-css` ships only `reset.css` (no `.d.ts`). TS6 refuses bare
45
+ // side-effect imports without declarations, so we declare the module here.
46
+ declare module 'reset-css';