@hubspot/cli 7.7.5-experimental.0 → 7.7.7-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 +1 -1
- package/commands/mcp/setup.js +16 -18
- package/commands/mcp/start.js +9 -0
- package/package.json +3 -3
package/commands/mcp/setup.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare function builder(yargs: Argv): Argv;
|
|
|
6
6
|
declare function handler(argv: ArgumentsCamelCase<MCPSetupArgs>): Promise<void>;
|
|
7
7
|
declare const _default: {
|
|
8
8
|
command: string[];
|
|
9
|
-
describe:
|
|
9
|
+
describe: undefined;
|
|
10
10
|
builder: typeof builder;
|
|
11
11
|
handler: typeof handler;
|
|
12
12
|
};
|
package/commands/mcp/setup.js
CHANGED
|
@@ -14,8 +14,7 @@ const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
|
14
14
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
15
15
|
const chalk_1 = __importDefault(require("chalk"));
|
|
16
16
|
const command = ['setup', 'update'];
|
|
17
|
-
const describe =
|
|
18
|
-
const mcpServerPath = path_1.default.join(os_1.default.homedir(), 'src', 'hubspot-cli', 'dist', 'mcp-server', 'server.js');
|
|
17
|
+
const describe = undefined;
|
|
19
18
|
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
20
19
|
const supportedTools = [
|
|
21
20
|
{ name: 'Claude', value: 'claude' },
|
|
@@ -31,6 +30,14 @@ function builder(yargs) {
|
|
|
31
30
|
return yargs;
|
|
32
31
|
}
|
|
33
32
|
async function handler(argv) {
|
|
33
|
+
const mcpsdk = '@modelcontextprotocol/sdk';
|
|
34
|
+
try {
|
|
35
|
+
await import(mcpsdk);
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
logger_1.logger.error(`This feature requires the ${mcpsdk} dependency to be installed, which requires node >=20`);
|
|
39
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
40
|
+
}
|
|
34
41
|
await addMcpServerToConfig(argv.targets);
|
|
35
42
|
}
|
|
36
43
|
exports.default = { command, describe, builder, handler };
|
|
@@ -108,9 +115,8 @@ async function setupClaudeDesktop() {
|
|
|
108
115
|
}
|
|
109
116
|
// Add or update HubSpot CLI MCP server
|
|
110
117
|
config.mcpServers['hubspot-cli-mcp'] = {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
args: [mcpServerPath],
|
|
118
|
+
command: 'hs',
|
|
119
|
+
args: ['mcp', 'start'],
|
|
114
120
|
};
|
|
115
121
|
// Write the updated config
|
|
116
122
|
fs_1.default.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
@@ -138,22 +144,15 @@ async function setupClaudeCode() {
|
|
|
138
144
|
// Run claude mcp add command
|
|
139
145
|
const mcpConfig = JSON.stringify({
|
|
140
146
|
type: 'stdio',
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
args: [mcpServerPath],
|
|
147
|
+
command: 'hs',
|
|
148
|
+
args: ['mcp', 'start'],
|
|
144
149
|
});
|
|
145
150
|
const { stdout } = await execAsync('claude mcp list');
|
|
146
151
|
if (stdout.includes('hubspot-cli-mcp')) {
|
|
147
152
|
SpinniesManager_1.default.update('claudeCode', {
|
|
148
153
|
text: 'CLI mcp server already installed, reinstalling',
|
|
149
154
|
});
|
|
150
|
-
|
|
151
|
-
await execAsync('claude mcp remove "hubspot-cli-mcp" --scope user');
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
// @ts-ignore
|
|
155
|
-
logger_1.logger.warn(error.stderr);
|
|
156
|
-
}
|
|
155
|
+
await execAsync('claude mcp remove "hubspot-cli-mcp" --scope user');
|
|
157
156
|
}
|
|
158
157
|
await execAsync(`claude mcp add-json "hubspot-cli-mcp" '${mcpConfig}' --scope user`);
|
|
159
158
|
SpinniesManager_1.default.succeed('claudeCode', {
|
|
@@ -216,9 +215,8 @@ async function setupCursor() {
|
|
|
216
215
|
}
|
|
217
216
|
// Add or update HubSpot CLI MCP server
|
|
218
217
|
config.mcpServers['hubspot-cli-mcp'] = {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
args: [mcpServerPath],
|
|
218
|
+
command: 'hs',
|
|
219
|
+
args: ['mcp', 'start'],
|
|
222
220
|
};
|
|
223
221
|
// Write the updated config
|
|
224
222
|
fs_1.default.writeFileSync(cursorConfigPath, JSON.stringify(config, null, 2));
|
package/commands/mcp/start.js
CHANGED
|
@@ -7,12 +7,21 @@ const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
10
11
|
const command = 'start';
|
|
11
12
|
const describe = undefined; // Keep this command hidden, doesn't seem useful to expose
|
|
12
13
|
function builder(yargs) {
|
|
13
14
|
return yargs;
|
|
14
15
|
}
|
|
15
16
|
async function handler() {
|
|
17
|
+
const mcpsdk = '@modelcontextprotocol/sdk';
|
|
18
|
+
try {
|
|
19
|
+
await import(mcpsdk);
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
logger_1.logger.error(`This feature requires the ${mcpsdk} dependency to be installed, which requires node >=20`);
|
|
23
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
24
|
+
}
|
|
16
25
|
await startMcpServer();
|
|
17
26
|
}
|
|
18
27
|
exports.default = { command, describe, builder, handler };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.7-experimental.0",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.6",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
12
|
"@hubspot/ui-extensions-dev-server": "0.9.2",
|
|
13
|
-
"@modelcontextprotocol/sdk": "1.13.3",
|
|
14
13
|
"archiver": "7.0.1",
|
|
15
14
|
"boxen": "8.0.1",
|
|
16
15
|
"chalk": "4.1.2",
|
|
@@ -62,7 +61,8 @@
|
|
|
62
61
|
"typescript": "^5.6.2"
|
|
63
62
|
},
|
|
64
63
|
"optionalDependencies": {
|
|
65
|
-
"@hubspot/cms-dev-server": "^1.0.9"
|
|
64
|
+
"@hubspot/cms-dev-server": "^1.0.9",
|
|
65
|
+
"@modelcontextprotocol/sdk": "1.13.3"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "ts-node ./scripts/build.ts",
|