Salesforce CLICAUTION
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Model Context Protocol (MCP) server for providing Salesforce CLI functionality to LLM tools like Claude Desktop.
Overview
This MCP server wraps the Salesforce CLI (sf) command-line tool and exposes its commands as MCP tools and resources, allowing LLM-powered agents to:
- View help information about Salesforce CLI topics and commands
- Execute Salesforce CLI commands with appropriate parameters
- Leverage Salesforce CLI capabilities in AI workflows
Requirements
- Node.js 18+ and npm
- Salesforce CLI (
sf) installed and configured - Your Salesforce org credentials configured in the CLI
Installation
# Clone the repository git clone cd sfMcp # Install dependencies npm install
Usage
Starting the server
# Basic usage npm start # With project roots npm start /path/to/project1 /path/to/project2 # or using the convenience script npm run with-roots /path/to/project1 /path/to/project2 # As an npx package with roots npx -y codefriar/sf-mcp /path/to/project1 /path/to/project2
The MCP server uses stdio transport, which can be used with MCP clients like the MCP Inspector or Claude Desktop.
Configuring in Claude Desktop
To configure this MCP in Claude Desktop's .claude.json configuration:
{
"tools": {
"salesforce": {
"command": "/path/to/node",
"args": [
"/path/to/sf-mcp/build/index.js",
"/path/to/project1",
"/path/to/project2"
]
}
}
}Using the npm package directly:
{
"tools": {
"salesforce": {
"command": "/path/to/npx",
"args": [
"-y",
"codefriar/sf-mcp",
"/path/to/project1",
"/path/to/project2"
]
}
}
}Development
# Watch mode (recompiles on file changes) npm run dev # In another terminal npm start [optional project roots...]
Available Tools and Resour
94bf48706318OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add sf-mcp -- npx -y [email protected]
{
"mcpServers": {
"sf-mcp": {
"command": "npx",
"args": [
"-y",
"[email protected]"
]
}
}
}Exposed tools (5)
3 read · 1 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
sf_cache_clear | destructive | Clear the cached SF command metadata to force a refresh |
sf_cache_refresh | read | Refresh the SF command cache by re-scanning all available commands |
sf_detect_project_directory | read | Get instructions for setting up Salesforce project directories for command execution |
sf_list_roots | read | List all configured Salesforce project directories and their metadata |
sf_set_project_directory | write | Set a Salesforce project directory for command execution context |
Trust audit
CAUTIONgrade B · trust 88/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | WARN |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (3 observation(s))
- Network
- none-observed
- Shell
- declared (5 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (4)
<entry key="CHAT_STATE" value="eyJjdXJyZW50Q29udmVyc2F0aW9uSWQiOiJiOTcyZWQwZi0yNmUzLTQ4NjktOTY4YS01YzEyZTIyOTZhNzEiLCJjb252ZXJzYXRpb25zIjp7ImI5NzJlZDBmLTI2ZTMtNDg2OS05NjhhLTVjMTJlMjI5NmE3MSI6eyJpZCI6I
sf_cache_clear
@modelcontextprotocol/sdk, zod, @eslint/js, @types/node, eslint, prettier, standard-release, standard-version
Gates applied: no_behavioural_pass, no_license.
94bf48706318full audit observations/trust-audit/mcp-server/codefriar__salesforce-cli.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 94bf48706318 | CAUTION | B | 88 | first audit |
Questions
What tools does Salesforce CLI expose?
5 in total: 3 read-only, 1 that write, and 1 that can delete or overwrite (sf_cache_clear). Every one is listed on this page with its risk.
Is Salesforce CLI safe to connect to an agent?
With care. The audit graded it B (88/100) and found 4 things worth knowing before you trust this server, listed below with the exact line each was found on. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Salesforce CLI need?
No credential environment variables were found in its source, so it appears to need none.
How does Salesforce CLI run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as sf-mcp at 1.3.2.
How current is this page?
The grade is for one exact copy of the source (94bf48706318), read on 2026-10-08. The repository is watched and re-audited when it changes.