@hubspot/cli 7.7.0-experimental.1 → 7.7.0-experimental.2

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.
@@ -8,7 +8,7 @@ class UploadProjectTool extends MCPTool {
8
8
  schema = {
9
9
  projectPath: {
10
10
  type: z.string().optional(),
11
- description: 'Path to the project directory. Defaults to current directory',
11
+ description: 'Path to the project directory. When using MCP server globally, provide the absolute path to your project (e.g., "/Users/yourname/projects/my-hubspot-project"). Defaults to "." for local usage.',
12
12
  },
13
13
  accountId: {
14
14
  type: z.string().optional(),
@@ -20,8 +20,8 @@ class UploadProjectTool extends MCPTool {
20
20
  },
21
21
  };
22
22
  async execute(input) {
23
- // Default to current working directory, which should be where Cursor is running from
24
- const { projectPath = process.cwd(), accountId, autoInstallCLI = false, } = input;
23
+ // Default to current directory "." which should resolve relative to where the MCP client is running
24
+ const { projectPath = '.', accountId, autoInstallCLI = false } = input;
25
25
  try {
26
26
  // Step 1: Check if HubSpot CLI is installed
27
27
  const cliCheckResult = await this.cliHelper.checkCLIInstallation();
@@ -110,6 +110,8 @@ class UploadProjectTool extends MCPTool {
110
110
  else {
111
111
  // Parse upload failure
112
112
  const errorOutput = uploadResult.output || uploadResult.error || 'Upload failed';
113
+ // Check if this looks like a path issue with global MCP server
114
+ const isPathIssue = errorOutput.includes('Unable to locate a project configuration file') || errorOutput.includes('MCP Server CWD: /');
113
115
  return {
114
116
  status: 'upload-failed',
115
117
  message: '❌ Project upload failed',
@@ -123,12 +125,23 @@ class UploadProjectTool extends MCPTool {
123
125
  'Ensure you have network connectivity to HubSpot',
124
126
  'Try uploading to a different account if you have access to multiple',
125
127
  `Working directory was: ${projectPath}`,
128
+ ...(isPathIssue
129
+ ? [
130
+ '⚠️ PATH ISSUE DETECTED: You may be using the global MCP server',
131
+ 'When using global MCP server, provide the absolute path to your project:',
132
+ 'Example: {"projectPath": "/Users/yourname/projects/my-hubspot-project"}',
133
+ 'Or consider running the MCP server locally from your project directory',
134
+ ]
135
+ : []),
126
136
  ],
127
137
  nextSteps: [
128
138
  '1. Check authentication status: hs auth info',
129
139
  '2. Validate project first: hs project validate',
130
- '3. Review the error output above for specific issues',
131
- '4. Try the upload command again after fixing issues',
140
+ ...(isPathIssue
141
+ ? ['3. Provide absolute projectPath if using global MCP server']
142
+ : []),
143
+ '4. Review the error output above for specific issues',
144
+ '5. Try the upload command again after fixing issues',
132
145
  ],
133
146
  };
134
147
  }
@@ -12,12 +12,12 @@ class ValidateProjectTool extends MCPTool {
12
12
  },
13
13
  projectPath: {
14
14
  type: z.string().optional(),
15
- description: 'Path to the project directory. Defaults to current directory',
15
+ description: 'Path to the project directory. When using MCP server globally, provide the absolute path to your project (e.g., "/Users/yourname/projects/my-hubspot-project"). Defaults to "." for local usage.',
16
16
  },
17
17
  };
18
18
  async execute(input) {
19
- // Default to current working directory, which should be where Cursor is running from
20
- const { autoFix = false, projectPath = process.cwd() } = input;
19
+ // Default to current directory "." which should resolve relative to where the MCP client is running
20
+ const { autoFix = false, projectPath = '.' } = input;
21
21
  try {
22
22
  // Step 1: Check if HubSpot CLI is installed
23
23
  const cliCheckResult = await this.cliHelper.checkCLIInstallation();
@@ -101,6 +101,18 @@ class ValidateProjectTool extends MCPTool {
101
101
  if (!isValid && output.includes('Project validation failed:')) {
102
102
  errors.push(...this.parseValidationErrors(output));
103
103
  }
104
+ // Add debugging information about directory context
105
+ if (result.output.includes('Unable to locate a project configuration file')) {
106
+ errors.push(`Working directory was: ${projectPath}`);
107
+ errors.push("Make sure you're running this from a directory containing hsproject.json");
108
+ // Check if this looks like a global MCP server path issue
109
+ if (result.output.includes('MCP Server CWD: /')) {
110
+ errors.push('⚠️ PATH ISSUE DETECTED: You may be using the global MCP server');
111
+ errors.push('When using global MCP server, provide the absolute path to your project:');
112
+ errors.push('Example: {"projectPath": "/Users/yourname/projects/my-hubspot-project"}');
113
+ errors.push('Or consider running the MCP server locally from your project directory');
114
+ }
115
+ }
104
116
  return {
105
117
  isValid: isValid,
106
118
  output: output,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.7.0-experimental.1",
3
+ "version": "7.7.0-experimental.2",
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",