@hubspot/cli 7.6.0-experimental.0 → 7.7.0-experimental.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.
Files changed (35) hide show
  1. package/bin/cli.js +2 -2
  2. package/bin/hsmcp.d.ts +2 -0
  3. package/bin/hsmcp.js +13 -0
  4. package/commands/project/validate.d.ts +4 -0
  5. package/commands/project/validate.js +53 -0
  6. package/commands/project.js +2 -0
  7. package/commands/setupMcp.d.ts +8 -0
  8. package/commands/setupMcp.js +229 -0
  9. package/lang/en.d.ts +51 -0
  10. package/lang/en.js +51 -0
  11. package/lib/prompts/promptUtils.d.ts +0 -1
  12. package/lib/prompts/promptUtils.js +0 -2
  13. package/mcp-server/index.d.ts +1 -0
  14. package/mcp-server/index.js +17 -0
  15. package/mcp-server/mcpLoader.d.ts +5 -0
  16. package/mcp-server/mcpLoader.js +24 -0
  17. package/mcp-server/tools/ExplainProjectStructureTool.d.ts +33 -0
  18. package/mcp-server/tools/ExplainProjectStructureTool.js +266 -0
  19. package/mcp-server/tools/GenerateAppComponentTool.d.ts +99 -0
  20. package/mcp-server/tools/GenerateAppComponentTool.js +193 -0
  21. package/mcp-server/tools/GenerateCardComponentTool.d.ts +74 -0
  22. package/mcp-server/tools/GenerateCardComponentTool.js +146 -0
  23. package/mcp-server/tools/GenerateProjectConfigTool.d.ts +32 -0
  24. package/mcp-server/tools/GenerateProjectConfigTool.js +40 -0
  25. package/mcp-server/tools/HubSpotCLIHelper.d.ts +24 -0
  26. package/mcp-server/tools/HubSpotCLIHelper.js +110 -0
  27. package/mcp-server/tools/UploadProjectTool.d.ts +44 -0
  28. package/mcp-server/tools/UploadProjectTool.js +153 -0
  29. package/mcp-server/tools/ValidateProjectTool.d.ts +62 -0
  30. package/mcp-server/tools/ValidateProjectTool.js +324 -0
  31. package/package.json +6 -3
  32. package/commands/testAccount/create.d.ts +0 -7
  33. package/commands/testAccount/create.js +0 -118
  34. package/commands/testAccount.d.ts +0 -3
  35. package/commands/testAccount.js +0 -23
package/bin/cli.js CHANGED
@@ -40,7 +40,7 @@ const feedbackCommand = require('../commands/feedback');
40
40
  const doctorCommand = require('../commands/doctor');
41
41
  const completionCommand = require('../commands/completion');
42
42
  const appCommand = require('../commands/app');
43
- const testAccountCommand = require('../commands/testAccount');
43
+ const setupMcpCommand = require('../commands/setupMcp');
44
44
  const getTerminalWidth = () => {
45
45
  const width = yargs.terminalWidth();
46
46
  if (width >= 100)
@@ -119,7 +119,7 @@ const argv = yargs
119
119
  .command(doctorCommand)
120
120
  .command(completionCommand)
121
121
  .command(appCommand)
122
- .command(testAccountCommand)
122
+ .command(setupMcpCommand)
123
123
  .help()
124
124
  .alias('h', 'help')
125
125
  .recommendCommands()
package/bin/hsmcp.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/bin/hsmcp.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ console.log('Starting MCP server...');
4
+ try {
5
+ require('../mcp-server/index');
6
+ }
7
+ catch (error) {
8
+ console.error('Failed to start MCP server:');
9
+ console.error('Error name:', error.name || 'Unknown');
10
+ console.error('Error message:', error.message || 'No message');
11
+ console.error('Full error:', error);
12
+ process.exit(1);
13
+ }
@@ -0,0 +1,4 @@
1
+ import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
2
+ type ProjectValidateArgs = CommonArgs;
3
+ declare const projectValidateCommand: YargsCommandModule<unknown, ProjectValidateArgs>;
4
+ export default projectValidateCommand;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const project_parsing_lib_1 = require("@hubspot/project-parsing-lib");
8
+ const project_parsing_lib_2 = require("@hubspot/project-parsing-lib");
9
+ const ui_1 = require("../../lib/ui");
10
+ const config_1 = require("../../lib/projects/config");
11
+ const lang_1 = require("../../lib/lang");
12
+ const index_1 = require("../../lib/errorHandlers/index");
13
+ const exitCodes_1 = require("../../lib/enums/exitCodes");
14
+ const yargsUtils_1 = require("../../lib/yargsUtils");
15
+ const logger_1 = require("../../lib/ui/logger");
16
+ const command = 'validate';
17
+ const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.project.subcommands.validate.describe`), false);
18
+ async function handler(args) {
19
+ const { derivedAccountId } = args;
20
+ const { projectConfig, projectDir } = await (0, config_1.getProjectConfig)();
21
+ (0, config_1.validateProjectConfig)(projectConfig, projectDir);
22
+ try {
23
+ await (0, project_parsing_lib_2.translate)({
24
+ projectSourceDir: path_1.default.join(projectDir, projectConfig.srcDir),
25
+ platformVersion: projectConfig.platformVersion,
26
+ accountId: derivedAccountId,
27
+ });
28
+ logger_1.uiLogger.success('Project validated successfully. No Errors');
29
+ }
30
+ catch (e) {
31
+ if ((0, project_parsing_lib_1.isTranslationError)(e)) {
32
+ logger_1.uiLogger.error(e.toString());
33
+ }
34
+ else {
35
+ (0, index_1.logError)(e);
36
+ }
37
+ return process.exit(exitCodes_1.EXIT_CODES.ERROR);
38
+ }
39
+ process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
40
+ }
41
+ function projectValidateBuilder(yargs) {
42
+ return yargs;
43
+ }
44
+ const builder = (0, yargsUtils_1.makeYargsBuilder)(projectValidateBuilder, command, describe, {
45
+ useGlobalOptions: true,
46
+ });
47
+ const projectValidateCommand = {
48
+ command,
49
+ describe,
50
+ handler,
51
+ builder,
52
+ };
53
+ exports.default = projectValidateCommand;
@@ -20,6 +20,7 @@ const migrateApp_1 = __importDefault(require("./project/migrateApp"));
20
20
  const cloneApp_1 = __importDefault(require("./project/cloneApp"));
21
21
  const installDeps_1 = __importDefault(require("./project/installDeps"));
22
22
  const profile_1 = __importDefault(require("./project/profile"));
23
+ const validate_1 = __importDefault(require("./project/validate"));
23
24
  const yargsUtils_1 = require("../lib/yargsUtils");
24
25
  const command = ['project', 'projects'];
25
26
  const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.project.describe`), false);
@@ -40,6 +41,7 @@ function projectBuilder(yargs) {
40
41
  .command(cloneApp_1.default)
41
42
  .command(installDeps_1.default)
42
43
  .command(profile_1.default)
44
+ .command(validate_1.default)
43
45
  .demandCommand(1, '');
44
46
  return yargs;
45
47
  }
@@ -0,0 +1,8 @@
1
+ import { CommonArgs, YargsCommandModule } from '../types/Yargs';
2
+ type SetupMcpArgs = CommonArgs & {
3
+ autoSetup?: boolean;
4
+ showInstructions?: boolean;
5
+ global?: boolean;
6
+ };
7
+ declare const setupMcpCommand: YargsCommandModule<unknown, SetupMcpArgs>;
8
+ export default setupMcpCommand;
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const exitCodes_1 = require("../lib/enums/exitCodes");
7
+ const en_1 = require("../lang/en");
8
+ const yargsUtils_1 = require("../lib/yargsUtils");
9
+ const logger_1 = require("@hubspot/local-dev-lib/logger");
10
+ const promptUtils_1 = require("../lib/prompts/promptUtils");
11
+ const fs_extra_1 = __importDefault(require("fs-extra"));
12
+ const path_1 = __importDefault(require("path"));
13
+ const os_1 = __importDefault(require("os"));
14
+ const command = 'setup-mcp';
15
+ const describe = en_1.commands.setupMcp.describe;
16
+ function getCursorMcpConfigPath(global = true) {
17
+ if (global) {
18
+ // Global configuration: ~/.cursor/mcp.json
19
+ const homeDir = os_1.default.homedir();
20
+ return path_1.default.join(homeDir, '.cursor', 'mcp.json');
21
+ }
22
+ else {
23
+ // Project-specific configuration: .cursor/mcp.json in current directory
24
+ return path_1.default.join(process.cwd(), '.cursor', 'mcp.json');
25
+ }
26
+ }
27
+ const MCP_SERVER_COMMAND = 'hsmcp';
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ async function readCursorConfig(global = true) {
30
+ const configPath = getCursorMcpConfigPath(global);
31
+ try {
32
+ if (await fs_extra_1.default.pathExists(configPath)) {
33
+ const content = await fs_extra_1.default.readFile(configPath, 'utf8');
34
+ return JSON.parse(content);
35
+ }
36
+ }
37
+ catch (error) {
38
+ logger_1.logger.debug(`Error reading Cursor config: ${error}`);
39
+ }
40
+ return { mcpServers: {} };
41
+ }
42
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
+ async function writeCursorConfig(config, global = true) {
44
+ const configPath = getCursorMcpConfigPath(global);
45
+ const configDir = path_1.default.dirname(configPath);
46
+ // Ensure the directory exists
47
+ await fs_extra_1.default.ensureDir(configDir);
48
+ // Write the config with proper formatting
49
+ await fs_extra_1.default.writeFile(configPath, JSON.stringify(config, null, 2));
50
+ }
51
+ async function setupMcpServer(global = true) {
52
+ try {
53
+ const config = await readCursorConfig(global);
54
+ // Check if hsmcp command is available
55
+ try {
56
+ require('child_process').execSync(`which ${MCP_SERVER_COMMAND} 2>/dev/null`, {
57
+ encoding: 'utf8',
58
+ });
59
+ }
60
+ catch (error) {
61
+ logger_1.logger.error(en_1.commands.setupMcp.errors.serverNotFound);
62
+ logger_1.logger.error(en_1.commands.setupMcp.errors.installHint);
63
+ return false;
64
+ }
65
+ // Check if already configured
66
+ if (config.mcpServers && config.mcpServers['hubspot-cli-mcp']) {
67
+ logger_1.logger.info(en_1.commands.setupMcp.warnings.alreadyConfigured);
68
+ const { shouldOverwrite } = await (0, promptUtils_1.promptUser)([
69
+ {
70
+ type: 'confirm',
71
+ name: 'shouldOverwrite',
72
+ message: en_1.commands.setupMcp.prompts.overwrite,
73
+ default: false,
74
+ },
75
+ ]);
76
+ if (!shouldOverwrite) {
77
+ return true;
78
+ }
79
+ }
80
+ // Configure the MCP server with the simple global command
81
+ if (!config.mcpServers) {
82
+ config.mcpServers = {};
83
+ }
84
+ config.mcpServers['hubspot-cli-mcp'] = {
85
+ command: MCP_SERVER_COMMAND,
86
+ args: [],
87
+ };
88
+ await writeCursorConfig(config, global);
89
+ const configType = global ? 'global' : 'project-specific';
90
+ logger_1.logger.success(en_1.commands.setupMcp.success.configured.replace('Claude', `Cursor (${configType})`));
91
+ logger_1.logger.info(en_1.commands.setupMcp.success.restartCursor);
92
+ return true;
93
+ }
94
+ catch (error) {
95
+ logger_1.logger.error(`${en_1.commands.setupMcp.errors.configurationFailed}: ${error}`);
96
+ return false;
97
+ }
98
+ }
99
+ function displayInstructions(global = true) {
100
+ const configPath = getCursorMcpConfigPath(global);
101
+ const configType = global ? 'global' : 'project-specific';
102
+ logger_1.logger.log(en_1.commands.setupMcp.instructions.title.replace('Claude', `Cursor (${configType})`));
103
+ logger_1.logger.log('');
104
+ logger_1.logger.log(en_1.commands.setupMcp.instructions.step1);
105
+ logger_1.logger.log(` ${configPath}`);
106
+ logger_1.logger.log('');
107
+ logger_1.logger.log(en_1.commands.setupMcp.instructions.step2);
108
+ logger_1.logger.log(' {');
109
+ logger_1.logger.log(' "mcpServers": {');
110
+ logger_1.logger.log(' "hubspot-cli-mcp": {');
111
+ logger_1.logger.log(` "command": "${MCP_SERVER_COMMAND}",`);
112
+ logger_1.logger.log(' "args": []');
113
+ logger_1.logger.log(' }');
114
+ logger_1.logger.log(' }');
115
+ logger_1.logger.log(' }');
116
+ logger_1.logger.log('');
117
+ logger_1.logger.log(en_1.commands.setupMcp.instructions.step3.replace('Claude', 'Cursor'));
118
+ logger_1.logger.log('');
119
+ logger_1.logger.log(en_1.commands.setupMcp.instructions.documentation);
120
+ }
121
+ async function handler(args) {
122
+ const useGlobal = args.global !== false; // Default to global unless explicitly set to false
123
+ if (args.showInstructions) {
124
+ displayInstructions(useGlobal);
125
+ process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
126
+ return;
127
+ }
128
+ if (args.autoSetup) {
129
+ const success = await setupMcpServer(useGlobal);
130
+ process.exit(success ? exitCodes_1.EXIT_CODES.SUCCESS : exitCodes_1.EXIT_CODES.ERROR);
131
+ return;
132
+ }
133
+ // Interactive mode - determine scope first if not specified
134
+ let isGlobal = useGlobal;
135
+ if (args.global === undefined) {
136
+ const { scope } = await (0, promptUtils_1.promptUser)([
137
+ {
138
+ type: 'list',
139
+ name: 'scope',
140
+ message: en_1.commands.setupMcp.prompts.selectScope,
141
+ choices: [
142
+ {
143
+ name: en_1.commands.setupMcp.choices.global,
144
+ value: 'global',
145
+ },
146
+ {
147
+ name: en_1.commands.setupMcp.choices.project,
148
+ value: 'project',
149
+ },
150
+ ],
151
+ },
152
+ ]);
153
+ isGlobal = scope === 'global';
154
+ }
155
+ // Then ask what action to take
156
+ const { action } = await (0, promptUtils_1.promptUser)([
157
+ {
158
+ type: 'list',
159
+ name: 'action',
160
+ message: en_1.commands.setupMcp.prompts.selectAction,
161
+ choices: [
162
+ {
163
+ name: en_1.commands.setupMcp.choices.autoSetup,
164
+ value: 'auto',
165
+ },
166
+ {
167
+ name: en_1.commands.setupMcp.choices.showInstructions,
168
+ value: 'instructions',
169
+ },
170
+ ],
171
+ },
172
+ ]);
173
+ if (action === 'auto') {
174
+ const success = await setupMcpServer(isGlobal);
175
+ process.exit(success ? exitCodes_1.EXIT_CODES.SUCCESS : exitCodes_1.EXIT_CODES.ERROR);
176
+ }
177
+ else {
178
+ displayInstructions(isGlobal);
179
+ process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
180
+ }
181
+ }
182
+ function setupMcpBuilder(yargs) {
183
+ yargs
184
+ .options({
185
+ 'auto-setup': {
186
+ describe: en_1.commands.setupMcp.options.autoSetup.describe,
187
+ type: 'boolean',
188
+ default: false,
189
+ },
190
+ 'show-instructions': {
191
+ describe: en_1.commands.setupMcp.options.showInstructions.describe,
192
+ type: 'boolean',
193
+ default: false,
194
+ },
195
+ global: {
196
+ describe: en_1.commands.setupMcp.options.global.describe,
197
+ type: 'boolean',
198
+ },
199
+ })
200
+ .example([
201
+ ['$0 setup-mcp', en_1.commands.setupMcp.examples.default],
202
+ ['$0 setup-mcp --auto-setup', en_1.commands.setupMcp.examples.autoSetup],
203
+ [
204
+ '$0 setup-mcp --auto-setup --global',
205
+ en_1.commands.setupMcp.examples.autoSetupGlobal,
206
+ ],
207
+ [
208
+ '$0 setup-mcp --auto-setup --no-global',
209
+ en_1.commands.setupMcp.examples.autoSetupProject,
210
+ ],
211
+ [
212
+ '$0 setup-mcp --show-instructions',
213
+ en_1.commands.setupMcp.examples.showInstructions,
214
+ ],
215
+ ]);
216
+ return yargs;
217
+ }
218
+ const builder = (0, yargsUtils_1.makeYargsBuilder)(setupMcpBuilder, command, describe, {
219
+ useGlobalOptions: true,
220
+ });
221
+ const setupMcpCommand = {
222
+ command,
223
+ describe,
224
+ handler,
225
+ builder,
226
+ };
227
+ exports.default = setupMcpCommand;
228
+ // Legacy export for compatibility
229
+ module.exports = setupMcpCommand;
package/lang/en.d.ts CHANGED
@@ -2211,6 +2211,57 @@ Profiles enable you to reference variables in your component configuration files
2211
2211
  };
2212
2212
  };
2213
2213
  };
2214
+ readonly setupMcp: {
2215
+ readonly describe: "Configure the HubSpot CLI MCP (Model Context Protocol) server for use with Cursor.";
2216
+ readonly errors: {
2217
+ readonly serverNotFound: "hsmcp command not found. Please ensure the HubSpot CLI is properly installed and available in your PATH.";
2218
+ readonly installHint: "If you installed the CLI locally, make sure to install it globally with: npm install -g @hubspot/cli";
2219
+ readonly configurationFailed: "Failed to configure MCP server";
2220
+ };
2221
+ readonly warnings: {
2222
+ readonly alreadyConfigured: "MCP server is already configured.";
2223
+ };
2224
+ readonly success: {
2225
+ readonly configured: "MCP server successfully configured for Cursor.";
2226
+ readonly restartCursor: "Please restart Cursor to apply the changes.";
2227
+ };
2228
+ readonly instructions: {
2229
+ readonly title: "Manual MCP Server Configuration Instructions:";
2230
+ readonly step1: "1. Open or create the Cursor configuration file at:";
2231
+ readonly step2: "2. Add the following configuration to the file:";
2232
+ readonly step3: "3. Restart Cursor to apply the changes.";
2233
+ readonly documentation: "For more information, visit: https://docs.cursor.com/context/model-context-protocol";
2234
+ };
2235
+ readonly options: {
2236
+ readonly autoSetup: {
2237
+ readonly describe: "Automatically configure the MCP server in Cursor configuration";
2238
+ };
2239
+ readonly showInstructions: {
2240
+ readonly describe: "Display manual configuration instructions instead of auto-setup";
2241
+ };
2242
+ readonly global: {
2243
+ readonly describe: "Configure globally for all Cursor workspaces (default: true)";
2244
+ };
2245
+ };
2246
+ readonly prompts: {
2247
+ readonly selectAction: "How would you like to configure the MCP server?";
2248
+ readonly selectScope: "Configure MCP server for:";
2249
+ readonly overwrite: "MCP server is already configured. Overwrite existing configuration?";
2250
+ };
2251
+ readonly choices: {
2252
+ readonly autoSetup: "Automatically configure (recommended)";
2253
+ readonly showInstructions: "Show manual configuration instructions";
2254
+ readonly global: "Global (all Cursor workspaces)";
2255
+ readonly project: "Current project only";
2256
+ };
2257
+ readonly examples: {
2258
+ readonly default: "Configure the MCP server interactively";
2259
+ readonly autoSetup: "Automatically configure the MCP server";
2260
+ readonly autoSetupGlobal: "Automatically configure the MCP server globally";
2261
+ readonly autoSetupProject: "Automatically configure for current project only";
2262
+ readonly showInstructions: "Display manual configuration instructions";
2263
+ };
2264
+ };
2214
2265
  };
2215
2266
  export declare const lib: {
2216
2267
  readonly process: {
package/lang/en.js CHANGED
@@ -2213,6 +2213,57 @@ exports.commands = {
2213
2213
  },
2214
2214
  },
2215
2215
  },
2216
+ setupMcp: {
2217
+ describe: 'Configure the HubSpot CLI MCP (Model Context Protocol) server for use with Cursor.',
2218
+ errors: {
2219
+ serverNotFound: 'hsmcp command not found. Please ensure the HubSpot CLI is properly installed and available in your PATH.',
2220
+ installHint: 'If you installed the CLI locally, make sure to install it globally with: npm install -g @hubspot/cli',
2221
+ configurationFailed: 'Failed to configure MCP server',
2222
+ },
2223
+ warnings: {
2224
+ alreadyConfigured: 'MCP server is already configured.',
2225
+ },
2226
+ success: {
2227
+ configured: 'MCP server successfully configured for Cursor.',
2228
+ restartCursor: 'Please restart Cursor to apply the changes.',
2229
+ },
2230
+ instructions: {
2231
+ title: 'Manual MCP Server Configuration Instructions:',
2232
+ step1: '1. Open or create the Cursor configuration file at:',
2233
+ step2: '2. Add the following configuration to the file:',
2234
+ step3: '3. Restart Cursor to apply the changes.',
2235
+ documentation: 'For more information, visit: https://docs.cursor.com/context/model-context-protocol',
2236
+ },
2237
+ options: {
2238
+ autoSetup: {
2239
+ describe: 'Automatically configure the MCP server in Cursor configuration',
2240
+ },
2241
+ showInstructions: {
2242
+ describe: 'Display manual configuration instructions instead of auto-setup',
2243
+ },
2244
+ global: {
2245
+ describe: 'Configure globally for all Cursor workspaces (default: true)',
2246
+ },
2247
+ },
2248
+ prompts: {
2249
+ selectAction: 'How would you like to configure the MCP server?',
2250
+ selectScope: 'Configure MCP server for:',
2251
+ overwrite: 'MCP server is already configured. Overwrite existing configuration?',
2252
+ },
2253
+ choices: {
2254
+ autoSetup: 'Automatically configure (recommended)',
2255
+ showInstructions: 'Show manual configuration instructions',
2256
+ global: 'Global (all Cursor workspaces)',
2257
+ project: 'Current project only',
2258
+ },
2259
+ examples: {
2260
+ default: 'Configure the MCP server interactively',
2261
+ autoSetup: 'Automatically configure the MCP server',
2262
+ autoSetupGlobal: 'Automatically configure the MCP server globally',
2263
+ autoSetupProject: 'Automatically configure for current project only',
2264
+ showInstructions: 'Display manual configuration instructions',
2265
+ },
2266
+ },
2216
2267
  };
2217
2268
  exports.lib = {
2218
2269
  process: {
@@ -1,5 +1,4 @@
1
1
  import { PromptConfig, GenericPromptResponse, PromptWhen, PromptChoices } from '../../types/Prompts';
2
- export declare const Separator: any;
3
2
  export declare function promptUser<T extends GenericPromptResponse>(config: PromptConfig<T> | PromptConfig<T>[]): Promise<T>;
4
3
  export declare function confirmPrompt(message: string, options?: {
5
4
  defaultAnswer?: boolean;
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Separator = void 0;
4
3
  exports.promptUser = promptUser;
5
4
  exports.confirmPrompt = confirmPrompt;
6
5
  exports.listPrompt = listPrompt;
7
6
  exports.inputPrompt = inputPrompt;
8
7
  const inquirer = require('inquirer');
9
8
  const promptModule = inquirer.createPromptModule();
10
- exports.Separator = new inquirer.Separator();
11
9
  function promptUser(config) {
12
10
  return promptModule(config);
13
11
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { MCPServer } from 'mcp-framework';
2
+ import { dirname, join } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ const __filename = fileURLToPath(import.meta.url);
5
+ const __dirname = dirname(__filename);
6
+ // Calculate the correct base path for tools
7
+ // ToolLoader does: dirname(basePath) + "/tools"
8
+ // We want it to look in dist/mcp-server/tools
9
+ // So basePath should be dist/mcp-server/anything
10
+ // __filename is dist/mcp-server/index.js, so dirname is dist/mcp-server
11
+ // We need to provide a path like dist/mcp-server/main.js
12
+ const basePath = join(__dirname, 'main.js');
13
+ console.log('Debug: basePath:', basePath);
14
+ const server = new MCPServer({
15
+ basePath: basePath,
16
+ });
17
+ server.start();
@@ -0,0 +1,5 @@
1
+ export declare function getMCPServer(): Promise<any>;
2
+ export declare function getMCPTool(): Promise<any>;
3
+ export declare class MCPToolBase {
4
+ static create(): Promise<any>;
5
+ }
@@ -0,0 +1,24 @@
1
+ // Dynamic import loader for mcp-framework to handle ESM/CommonJS compatibility
2
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
+ let mcpFramework = null;
4
+ async function loadMCPFramework() {
5
+ if (!mcpFramework) {
6
+ mcpFramework = await import('mcp-framework');
7
+ }
8
+ return mcpFramework;
9
+ }
10
+ export async function getMCPServer() {
11
+ const framework = await loadMCPFramework();
12
+ return framework.MCPServer;
13
+ }
14
+ export async function getMCPTool() {
15
+ const framework = await loadMCPFramework();
16
+ return framework.MCPTool;
17
+ }
18
+ // Export a ready-to-use MCPTool base class
19
+ export class MCPToolBase {
20
+ static async create() {
21
+ const MCPTool = await getMCPTool();
22
+ return MCPTool;
23
+ }
24
+ }
@@ -0,0 +1,33 @@
1
+ import { MCPTool } from "mcp-framework";
2
+ import { z } from "zod";
3
+ interface ExplainProjectStructureInput {
4
+ section?: string;
5
+ }
6
+ declare class ExplainProjectStructureTool extends MCPTool<ExplainProjectStructureInput> {
7
+ name: string;
8
+ description: string;
9
+ schema: {
10
+ section: {
11
+ type: z.ZodOptional<z.ZodString>;
12
+ description: string;
13
+ };
14
+ };
15
+ execute(input: ExplainProjectStructureInput): Promise<{
16
+ section: string;
17
+ title: string;
18
+ content: string;
19
+ message?: undefined;
20
+ sections?: undefined;
21
+ } | {
22
+ message: string;
23
+ sections: {
24
+ section: string;
25
+ title: string;
26
+ content: string;
27
+ }[];
28
+ section?: undefined;
29
+ title?: undefined;
30
+ content?: undefined;
31
+ }>;
32
+ }
33
+ export default ExplainProjectStructureTool;