Skip to content

Commit 4c9389b

Browse files
authored
Merge pull request #6 from advancedcommunities/fix-deployment
Fix deployment
2 parents 7388a1a + 23d7b76 commit 4c9389b

File tree

6 files changed

+28
-13
lines changed

6 files changed

+28
-13
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.5.5] - 2025-10-26
9+
10+
### Fixed
11+
12+
- **Salesforce CLI Path Resolution on Windows**: Fixed issue where `sf` command in PATH was being incorrectly quoted on Windows
13+
- The `deploy_start` tool and all other SF CLI commands now work correctly when SF CLI is in the system PATH
14+
- Only quote SF CLI paths when they contain spaces (indicating full path like "C:\Program Files\sf\bin\sf.cmd")
15+
- Don't quote plain command names (like "sf") that should be resolved from PATH
16+
- Fixes "Command failed: 'sf' is not recognized" errors on Windows
17+
- Applied fix to both `executeSfCommand` and `executeSfCommandRaw` functions in sfCommand.ts
18+
819
## [1.5.4] - 2025-10-22
920

1021
### Fixed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dxt_version": "0.2",
33
"name": "salesforce-mcp-server",
44
"display_name": "Salesforce MCP Server",
5-
"version": "1.5.4",
5+
"version": "1.5.5",
66
"description": "Salesforce MCP Server - Interact with Salesforce orgs through AI assistants",
77
"icon": "icon.png",
88
"long_description": "Enables AI assistants to execute Apex code, query Salesforce data, and manage org metadata using your existing Salesforce CLI authentication. Perfect for developers and administrators who want to automate Salesforce tasks through natural language interactions.\n\nSupports environment variables:\n- READ_ONLY=true - Prevents Apex code execution\n- ALLOWED_ORGS=ALL or comma-separated org list - Restricts access to specific orgs (default: ALL)",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@advanced-communities/salesforce-mcp-server",
3-
"version": "1.5.4",
3+
"version": "1.5.5",
44
"description": "MCP server enabling AI assistants to interact with Salesforce orgs through the Salesforce CLI",
55
"main": "./src/index.ts",
66
"scripts": {

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function buildServerDescription(): string {
2525
const allowedOrgs = permissions.getAllowedOrgs();
2626
const permissionInfo = [];
2727

28-
let description = `Salesforce MCP Server v1.5.3 - AI-powered Salesforce automation via CLI integration\n`;
28+
let description = `Salesforce MCP Server v1.5.5 - AI-powered Salesforce automation via CLI integration\n`;
2929
description += `Capabilities: Apex execution, SOQL queries, org management, code testing & coverage\n`;
3030

3131
if (readOnlyMode) {

src/utils/sfCommand.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ function findSfPath(): string {
5050

5151
export function executeSfCommand(command: string): Promise<any> {
5252
const sfPath = findSfPath();
53-
const fullCommand = command.replace(/^sf\s+/, `"${sfPath}" `);
53+
// Only quote the path if it contains spaces (indicating it's a full path, not a command name)
54+
const quotedPath = sfPath.includes(" ") ? `"${sfPath}"` : sfPath;
55+
const fullCommand = command.replace(/^sf\s+/, `${quotedPath} `);
5456

5557
return new Promise((resolve, reject) => {
5658
exec(
@@ -65,8 +67,8 @@ export function executeSfCommand(command: string): Promise<any> {
6567
reject(
6668
new Error(
6769
"Salesforce CLI (sf) not found. Please ensure it is installed and accessible. " +
68-
"Visit https://developer.salesforce.com/tools/salesforcecli for installation instructions."
69-
)
70+
"Visit https://developer.salesforce.com/tools/salesforcecli for installation instructions.",
71+
),
7072
);
7173
return;
7274
}
@@ -95,14 +97,16 @@ export function executeSfCommand(command: string): Promise<any> {
9597
} catch (parseError) {
9698
reject(parseError);
9799
}
98-
}
100+
},
99101
);
100102
});
101103
}
102104

103105
export function executeSfCommandRaw(command: string): Promise<string> {
104106
const sfPath = findSfPath();
105-
const fullCommand = command.replace(/^sf\s+/, `"${sfPath}" `);
107+
// Only quote the path if it contains spaces (indicating it's a full path, not a command name)
108+
const quotedPath = sfPath.includes(" ") ? `"${sfPath}"` : sfPath;
109+
const fullCommand = command.replace(/^sf\s+/, `${quotedPath} `);
106110

107111
return new Promise((resolve, reject) => {
108112
exec(
@@ -117,8 +121,8 @@ export function executeSfCommandRaw(command: string): Promise<string> {
117121
reject(
118122
new Error(
119123
"Salesforce CLI (sf) not found. Please ensure it is installed and accessible. " +
120-
"Visit https://developer.salesforce.com/tools/salesforcecli for installation instructions."
121-
)
124+
"Visit https://developer.salesforce.com/tools/salesforcecli for installation instructions.",
125+
),
122126
);
123127
} else {
124128
// For scanner commands, non-zero exit code with stdout means violations were found
@@ -137,7 +141,7 @@ export function executeSfCommandRaw(command: string): Promise<string> {
137141
}
138142
// Return raw stdout without JSON parsing
139143
resolve(stdout);
140-
}
144+
},
141145
);
142146
});
143147
}

0 commit comments

Comments
 (0)