@hubspot/cli 7.7.11-experimental.0 → 7.7.13-experimental.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/commands/mcp/setup.d.ts
CHANGED
package/commands/mcp/setup.js
CHANGED
|
@@ -18,14 +18,13 @@ const logger_1 = require("../../lib/ui/logger");
|
|
|
18
18
|
const command = ['setup', 'update'];
|
|
19
19
|
const describe = undefined; // Leave hidden for now
|
|
20
20
|
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
21
|
-
const claudeCode = 'claude
|
|
22
|
-
const claudeDesktop = 'claude-desktop';
|
|
21
|
+
const claudeCode = 'claude';
|
|
23
22
|
const windsurf = 'windsurf';
|
|
24
23
|
const cursor = 'cursor';
|
|
25
24
|
const mcpServerName = 'hubspot-cli-mcp';
|
|
25
|
+
const supportedMintlifyClients = [windsurf, cursor];
|
|
26
26
|
const supportedTools = [
|
|
27
27
|
{ name: en_1.commands.mcp.setup.claudeCode, value: claudeCode },
|
|
28
|
-
// { name: commands.mcp.setup.claudeDesktop, value: claudeDesktop },
|
|
29
28
|
{ name: en_1.commands.mcp.setup.cursor, value: cursor },
|
|
30
29
|
{ name: en_1.commands.mcp.setup.windsurf, value: windsurf },
|
|
31
30
|
];
|
|
@@ -33,8 +32,8 @@ const hsCommand = 'hs';
|
|
|
33
32
|
const mcpCommandArgs = ['mcp', 'start'];
|
|
34
33
|
function setupBuilder(yargs) {
|
|
35
34
|
yargs
|
|
36
|
-
.option('
|
|
37
|
-
describe: en_1.commands.mcp.setup.args.
|
|
35
|
+
.option('client', {
|
|
36
|
+
describe: en_1.commands.mcp.setup.args.client,
|
|
38
37
|
type: 'array',
|
|
39
38
|
choices: [...supportedTools.map(tool => tool.value)],
|
|
40
39
|
})
|
|
@@ -54,11 +53,16 @@ async function handler(args) {
|
|
|
54
53
|
logger_1.uiLogger.error(en_1.commands.mcp.setup.errors.needsNode20);
|
|
55
54
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
56
55
|
}
|
|
57
|
-
await addMcpServerToConfig(args.
|
|
56
|
+
const derivedTargets = await addMcpServerToConfig(args.client);
|
|
58
57
|
if (args.addDocsSearch) {
|
|
59
58
|
logger_1.uiLogger.info(en_1.commands.mcp.setup.installingDocSearch);
|
|
59
|
+
logger_1.uiLogger.log('');
|
|
60
60
|
await new Promise(() => {
|
|
61
|
-
const
|
|
61
|
+
const subcommands = ['mint-mcp', 'add', 'hubspot-migration'];
|
|
62
|
+
const docsSearchClients = derivedTargets.filter(target => supportedMintlifyClients.includes(target));
|
|
63
|
+
const childProcess = (0, child_process_1.spawn)(`npx`, docsSearchClients && docsSearchClients.length
|
|
64
|
+
? [...subcommands, '--client', ...docsSearchClients]
|
|
65
|
+
: subcommands, {
|
|
62
66
|
stdio: 'inherit',
|
|
63
67
|
});
|
|
64
68
|
childProcess.on('exit', code => {
|
|
@@ -92,9 +96,6 @@ async function addMcpServerToConfig(targets) {
|
|
|
92
96
|
derivedTargets = targets;
|
|
93
97
|
}
|
|
94
98
|
SpinniesManager_1.default.init();
|
|
95
|
-
if (derivedTargets.includes(claudeDesktop)) {
|
|
96
|
-
await runSetupFunction(setupClaudeDesktop);
|
|
97
|
-
}
|
|
98
99
|
if (derivedTargets.includes(claudeCode)) {
|
|
99
100
|
await runSetupFunction(setupClaudeCode);
|
|
100
101
|
}
|
|
@@ -105,12 +106,14 @@ async function addMcpServerToConfig(targets) {
|
|
|
105
106
|
await runSetupFunction(setupWindsurf);
|
|
106
107
|
}
|
|
107
108
|
logger_1.uiLogger.info(en_1.commands.mcp.setup.success(derivedTargets));
|
|
109
|
+
return derivedTargets;
|
|
108
110
|
}
|
|
109
111
|
catch (error) {
|
|
110
112
|
SpinniesManager_1.default.fail('mcpSetup', {
|
|
111
113
|
text: en_1.commands.mcp.setup.spinners.failedToConfigure,
|
|
112
114
|
});
|
|
113
115
|
(0, errorHandlers_1.logError)(error);
|
|
116
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
119
|
async function runSetupFunction(func) {
|
|
@@ -119,51 +122,49 @@ async function runSetupFunction(func) {
|
|
|
119
122
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
function
|
|
125
|
+
function setupMcpConfigFile(config) {
|
|
123
126
|
try {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
text: en_1.commands.mcp.setup.spinners.configuringClaudeDesktop,
|
|
127
|
+
SpinniesManager_1.default.add('spinner', {
|
|
128
|
+
text: config.configuringMessage,
|
|
127
129
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
SpinniesManager_1.default.fail('claudeDesktop', {
|
|
137
|
-
text: en_1.commands.mcp.setup.spinners.failedToConfigureClaudeDesktop,
|
|
138
|
-
});
|
|
139
|
-
(0, errorHandlers_1.logError)(error);
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
130
|
+
if (!fs_1.default.existsSync(config.configPath)) {
|
|
131
|
+
SpinniesManager_1.default.succeed('spinner', {
|
|
132
|
+
text: config.configMissingMessage ||
|
|
133
|
+
`Config file not found at ${config.configPath}`,
|
|
134
|
+
});
|
|
135
|
+
return false;
|
|
142
136
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
137
|
+
let mcpConfig = {};
|
|
138
|
+
try {
|
|
139
|
+
const configContent = fs_1.default.readFileSync(config.configPath, 'utf8');
|
|
140
|
+
mcpConfig = JSON.parse(configContent);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
SpinniesManager_1.default.fail('spinner', {
|
|
144
|
+
text: config.failedMessage,
|
|
145
|
+
});
|
|
146
|
+
(0, errorHandlers_1.logError)(error);
|
|
147
|
+
return false;
|
|
147
148
|
}
|
|
148
149
|
// Initialize mcpServers if it doesn't exist
|
|
149
|
-
if (!
|
|
150
|
-
|
|
150
|
+
if (!mcpConfig.mcpServers) {
|
|
151
|
+
mcpConfig.mcpServers = {};
|
|
151
152
|
}
|
|
152
153
|
// Add or update HubSpot CLI MCP server
|
|
153
|
-
|
|
154
|
+
mcpConfig.mcpServers[mcpServerName] = {
|
|
154
155
|
command: hsCommand,
|
|
155
156
|
args: mcpCommandArgs,
|
|
156
157
|
};
|
|
157
158
|
// Write the updated config
|
|
158
|
-
fs_1.default.writeFileSync(configPath, JSON.stringify(
|
|
159
|
-
SpinniesManager_1.default.succeed('
|
|
160
|
-
text:
|
|
159
|
+
fs_1.default.writeFileSync(config.configPath, JSON.stringify(mcpConfig, null, 2));
|
|
160
|
+
SpinniesManager_1.default.succeed('spinner', {
|
|
161
|
+
text: config.configuredMessage,
|
|
161
162
|
});
|
|
162
163
|
return true;
|
|
163
164
|
}
|
|
164
165
|
catch (error) {
|
|
165
|
-
SpinniesManager_1.default.fail('
|
|
166
|
-
text:
|
|
166
|
+
SpinniesManager_1.default.fail('spinner', {
|
|
167
|
+
text: config.failedMessage,
|
|
167
168
|
});
|
|
168
169
|
(0, errorHandlers_1.logError)(error);
|
|
169
170
|
return false;
|
|
@@ -221,108 +222,23 @@ async function setupClaudeCode() {
|
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
function setupCursor() {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
});
|
|
233
|
-
return false;
|
|
234
|
-
}
|
|
235
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
236
|
-
let config = {};
|
|
237
|
-
// Read existing config
|
|
238
|
-
try {
|
|
239
|
-
const configContent = fs_1.default.readFileSync(cursorConfigPath, 'utf8');
|
|
240
|
-
config = JSON.parse(configContent);
|
|
241
|
-
}
|
|
242
|
-
catch (error) {
|
|
243
|
-
(0, errorHandlers_1.logError)(error);
|
|
244
|
-
return false;
|
|
245
|
-
}
|
|
246
|
-
// Initialize mcpServers if it doesn't exist
|
|
247
|
-
if (!config.mcpServers) {
|
|
248
|
-
config.mcpServers = {};
|
|
249
|
-
}
|
|
250
|
-
// Add or update HubSpot CLI MCP server
|
|
251
|
-
config.mcpServers[mcpServerName] = {
|
|
252
|
-
command: hsCommand,
|
|
253
|
-
args: mcpCommandArgs,
|
|
254
|
-
};
|
|
255
|
-
// Write the updated config
|
|
256
|
-
fs_1.default.writeFileSync(cursorConfigPath, JSON.stringify(config, null, 2));
|
|
257
|
-
SpinniesManager_1.default.succeed('cursor', {
|
|
258
|
-
text: en_1.commands.mcp.setup.spinners.configuredCursor,
|
|
259
|
-
});
|
|
260
|
-
return true;
|
|
261
|
-
}
|
|
262
|
-
catch (error) {
|
|
263
|
-
SpinniesManager_1.default.fail('cursor', {
|
|
264
|
-
text: en_1.commands.mcp.setup.spinners.failedToConfigureCursor,
|
|
265
|
-
});
|
|
266
|
-
(0, errorHandlers_1.logError)(error);
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
function getClaudeDesktopConfigPath() {
|
|
271
|
-
const platform = os_1.default.platform();
|
|
272
|
-
const homeDir = os_1.default.homedir();
|
|
273
|
-
if (platform === 'win32') {
|
|
274
|
-
const appData = process.env.APPDATA || path_1.default.join(homeDir, 'AppData', 'Roaming');
|
|
275
|
-
return path_1.default.join(appData, 'Claude', 'claude_desktop_config.json');
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
return path_1.default.join(homeDir, '.config', 'claude', 'claude_desktop_config.json');
|
|
279
|
-
}
|
|
225
|
+
const cursorConfigPath = path_1.default.join(os_1.default.homedir(), '.cursor', 'mcp.json');
|
|
226
|
+
return setupMcpConfigFile({
|
|
227
|
+
configPath: cursorConfigPath,
|
|
228
|
+
configuringMessage: en_1.commands.mcp.setup.spinners.configuringCursor,
|
|
229
|
+
configuredMessage: en_1.commands.mcp.setup.spinners.configuredCursor,
|
|
230
|
+
failedMessage: en_1.commands.mcp.setup.spinners.failedToConfigureCursor,
|
|
231
|
+
configMissingMessage: en_1.commands.mcp.setup.spinners.noCursorMcpFile(cursorConfigPath),
|
|
232
|
+
});
|
|
280
233
|
}
|
|
281
234
|
function setupWindsurf() {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
});
|
|
291
|
-
return false;
|
|
292
|
-
}
|
|
293
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
294
|
-
let config = {};
|
|
295
|
-
// Read existing config
|
|
296
|
-
try {
|
|
297
|
-
const configContent = fs_1.default.readFileSync(windsurf, 'utf8');
|
|
298
|
-
config = JSON.parse(configContent);
|
|
299
|
-
}
|
|
300
|
-
catch (error) {
|
|
301
|
-
(0, errorHandlers_1.logError)(error);
|
|
302
|
-
return false;
|
|
303
|
-
}
|
|
304
|
-
// Initialize mcpServers if it doesn't exist
|
|
305
|
-
if (!config.mcpServers) {
|
|
306
|
-
config.mcpServers = {};
|
|
307
|
-
}
|
|
308
|
-
// Add or update HubSpot CLI MCP server
|
|
309
|
-
config.mcpServers[mcpServerName] = {
|
|
310
|
-
command: hsCommand,
|
|
311
|
-
args: mcpCommandArgs,
|
|
312
|
-
};
|
|
313
|
-
// Write the updated config
|
|
314
|
-
fs_1.default.writeFileSync(windsurf, JSON.stringify(config, null, 2));
|
|
315
|
-
SpinniesManager_1.default.succeed('cursor', {
|
|
316
|
-
text: en_1.commands.mcp.setup.spinners.configuredWindsurf,
|
|
317
|
-
});
|
|
318
|
-
return true;
|
|
319
|
-
}
|
|
320
|
-
catch (error) {
|
|
321
|
-
SpinniesManager_1.default.fail('cursor', {
|
|
322
|
-
text: en_1.commands.mcp.setup.spinners.failedToConfigureWindsurf,
|
|
323
|
-
});
|
|
324
|
-
(0, errorHandlers_1.logError)(error);
|
|
325
|
-
return false;
|
|
326
|
-
}
|
|
235
|
+
const windsurfConfigPath = path_1.default.join(os_1.default.homedir(), '.codeium', 'windsurf', 'mcp_config.json');
|
|
236
|
+
return setupMcpConfigFile({
|
|
237
|
+
configPath: windsurfConfigPath,
|
|
238
|
+
configuringMessage: en_1.commands.mcp.setup.spinners.configuringWindsurf,
|
|
239
|
+
configuredMessage: en_1.commands.mcp.setup.spinners.configuredWindsurf,
|
|
240
|
+
failedMessage: en_1.commands.mcp.setup.spinners.failedToConfigureWindsurf,
|
|
241
|
+
configMissingMessage: en_1.commands.mcp.setup.spinners.noWindsurfFile(windsurfConfigPath),
|
|
242
|
+
});
|
|
327
243
|
}
|
|
328
244
|
exports.default = { command, describe, builder, handler };
|
package/lang/en.d.ts
CHANGED
|
@@ -766,13 +766,13 @@ Global configuration replaces hubspot.config.yml, and you will be prompted to mi
|
|
|
766
766
|
};
|
|
767
767
|
readonly mcp: {
|
|
768
768
|
readonly setup: {
|
|
769
|
-
readonly installingDocSearch: "Adding the docs-search mcp server
|
|
769
|
+
readonly installingDocSearch: "Adding the docs-search mcp server";
|
|
770
770
|
readonly claudeCode: "Claude Code";
|
|
771
771
|
readonly claudeDesktop: "Claude Desktop";
|
|
772
772
|
readonly cursor: "Cursor";
|
|
773
773
|
readonly windsurf: "Windsurf";
|
|
774
774
|
readonly args: {
|
|
775
|
-
readonly
|
|
775
|
+
readonly client: "Target applications to configure";
|
|
776
776
|
readonly docsSearch: "Should the docs search mcp server be installed";
|
|
777
777
|
};
|
|
778
778
|
readonly success: (derivedTargets: string[]) => string;
|
|
@@ -799,7 +799,7 @@ Global configuration replaces hubspot.config.yml, and you will be prompted to mi
|
|
|
799
799
|
readonly configuredWindsurf: "Configured Windsurf";
|
|
800
800
|
};
|
|
801
801
|
readonly prompts: {
|
|
802
|
-
readonly targets: "[--
|
|
802
|
+
readonly targets: "[--client] Which tools would you like to add the HubSpot CLI MCP server to?";
|
|
803
803
|
readonly targetsRequired: "Must choose at least one application to configure.";
|
|
804
804
|
};
|
|
805
805
|
};
|
package/lang/en.js
CHANGED
|
@@ -778,13 +778,13 @@ exports.commands = {
|
|
|
778
778
|
},
|
|
779
779
|
mcp: {
|
|
780
780
|
setup: {
|
|
781
|
-
installingDocSearch: 'Adding the docs-search mcp server
|
|
781
|
+
installingDocSearch: 'Adding the docs-search mcp server',
|
|
782
782
|
claudeCode: 'Claude Code',
|
|
783
783
|
claudeDesktop: 'Claude Desktop',
|
|
784
784
|
cursor: 'Cursor',
|
|
785
785
|
windsurf: 'Windsurf',
|
|
786
786
|
args: {
|
|
787
|
-
|
|
787
|
+
client: 'Target applications to configure',
|
|
788
788
|
docsSearch: 'Should the docs search mcp server be installed',
|
|
789
789
|
},
|
|
790
790
|
success: (derivedTargets) => `You can now use the HubSpot CLI tools in ${derivedTargets.join(', ')}. ${chalk_1.default.bold('You may need to restart these tools to apply the changes')}.`,
|
|
@@ -811,7 +811,7 @@ exports.commands = {
|
|
|
811
811
|
configuredWindsurf: 'Configured Windsurf',
|
|
812
812
|
},
|
|
813
813
|
prompts: {
|
|
814
|
-
targets: '[--
|
|
814
|
+
targets: '[--client] Which tools would you like to add the HubSpot CLI MCP server to?',
|
|
815
815
|
targetsRequired: 'Must choose at least one application to configure.',
|
|
816
816
|
},
|
|
817
817
|
},
|
|
@@ -40,7 +40,13 @@ async function injectAccountIdMiddleware(argv) {
|
|
|
40
40
|
const SKIP_CONFIG_VALIDATION = {
|
|
41
41
|
init: { target: true },
|
|
42
42
|
auth: { target: true },
|
|
43
|
-
mcp: {
|
|
43
|
+
mcp: {
|
|
44
|
+
target: false,
|
|
45
|
+
subCommands: {
|
|
46
|
+
setup: { target: true },
|
|
47
|
+
start: { target: true },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
44
50
|
};
|
|
45
51
|
async function loadConfigMiddleware(argv) {
|
|
46
52
|
// Skip this when no command is provided
|
|
@@ -106,7 +112,13 @@ const configSubCommands = {
|
|
|
106
112
|
const SKIP_ACCOUNT_VALIDATION = {
|
|
107
113
|
init: { target: true },
|
|
108
114
|
auth: { target: true },
|
|
109
|
-
mcp: {
|
|
115
|
+
mcp: {
|
|
116
|
+
target: false,
|
|
117
|
+
subCommands: {
|
|
118
|
+
setup: { target: true },
|
|
119
|
+
start: { target: true },
|
|
120
|
+
},
|
|
121
|
+
},
|
|
110
122
|
account: accountsSubCommands,
|
|
111
123
|
accounts: accountsSubCommands,
|
|
112
124
|
sandbox: sandboxesSubCommands,
|
|
@@ -84,9 +84,7 @@ class CreateProjectTool extends types_1.Tool {
|
|
|
84
84
|
content,
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
command = (0, command_1.addFlag)(command, 'features', features);
|
|
89
|
-
}
|
|
87
|
+
command = (0, command_1.addFlag)(command, 'features', features || []);
|
|
90
88
|
try {
|
|
91
89
|
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteCurrentWorkingDirectory, command);
|
|
92
90
|
return {
|
package/package.json
CHANGED