Basic information
About Salesforce MCP Server
Unlock seamless Salesforce org management with the secure, flexible Salesforce DX MCP Server. Streamline workflows and boost productivity.
Salesforce is a MCP server in the Cloud Infrastructure category listed in the AddMCP.net directory, published by salesforcecli. It exposes 12 tools, including get_username, resume_tool_operation, run_soql_query, create_org_snapshot and more. Supported transport: stdio. Runtime: TypeScript. License: Apache-2.0. The repository has 437 GitHub stars. Source code is hosted on github.com. Related topics: cloud-infrastructure, developer-tools, official.
Setup
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": [
"-y",
"@salesforce/mcp",
"--orgs",
"DEFAULT_TARGET_ORG",
"--toolsets",
"all"
]
}
}
}
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": [
"-y",
"@salesforce/mcp",
"--orgs",
"DEFAULT_TARGET_ORG",
"--toolsets",
"all"
]
}
}
}
{
"servers": {
"salesforce": {
"command": "npx",
"args": [
"-y",
"@salesforce/mcp",
"--orgs",
"DEFAULT_TARGET_ORG",
"--toolsets",
"all"
]
}
}
}
Salesforce MCP Server — by salesforcecli config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": [
"-y",
"@salesforce/mcp",
"--orgs",
"DEFAULT_TARGET_ORG",
"--toolsets",
"all"
]
}
}
}
Salesforce MCP Server — by salesforcecli tools
-
get_username
— Intelligently determines the appropriate username or alias for Salesforce operations.
WHEN TO USE THIS TOOL:
- When uncertain which org username a user wants for Salesforce operations.
To resolve the default org username, set the defaultTargetOrg param to true and defaultDevHub to false.
To resole the default devhub org username, set the defaultTargetOrg param to false and defaultDevHub to true.
If it's not clear which type of org to resolve, set both defaultTargetOrg and defaultDevHub to false to an allow-listed org username available.
defaultTargetOrg:boolean, defaultDevHub:boolean, directory:string* -
resume_tool_operation
— Resume a long running operation that was not completed by another tool.
AGENT INSTRUCTIONS:
Use this tool to resume a long running operation.
EXAMPLE USAGE:
Resume the metadata deploy job 0Af1234567890
Resume the deployment and wait for 10 minutes
Resume the deployment to my org
Resume scratch org creation
Resume job 2SR1234567890
Resume agent tests
Resume org snapshot with ID 0OoKa000000XZAbKAO
Report on my org snapshot
jobId:string*, wait:number, usernameOrAlias:string*, directory:string* -
run_soql_query
— Run a SOQL query against a Salesforce org.
query:string*, usernameOrAlias:string*, directory:string*, useToolingApi:boolean -
create_org_snapshot
— Creates a new snapshot of an org
AGENT INSTRUCTIONS:
Example usage:
Create a snapshot called 07042025
create a snapshot called 07042025 with the description, "this is a snapshot for commit 5b1a09b1743 - new login flow working"
create a snapshot of my MyScratch in myDevHub
directory:string*, devHub:string*, sourceOrg:string*, description:string, name:string -
create_scratch_org
— Creates a scratch org with the specified parameters.
AGENT INSTRUCTIONS:
Example usage:
Create a scratch org
create a scratch org with the definition file myDefinition.json that lasts 3 days
create a scratch org aliased as MyNewOrg and set as default and don't wait for it to finish
directory:string*, devHub:string*, duration:number, edition:string, definitionFile:string, alias:string, async:boolean, setDefault:boolean, snapshot:string, sourceOrg:string, username:string, description:string, … -
delete_org
— Deletes specified salesforce org.
AGENT INSTRUCTIONS:
ALWAYS confirm with the user before deleting an org
Example usage:
Can you delete my org
Can you delete MyAliasedOrg
Can you delete [email protected]
directory:string*, usernameOrAlias:string* -
list_all_orgs
— Lists all configured Salesforce orgs.
AGENT INSTRUCTIONS:
DO NOT use this tool to try to determine which org a user wants, use #get_username instead. Only use it if the user explicitly asks for a list of orgs.
Example usage:
Can you list all Salesforce orgs for me
List all Salesforce orgs
List all orgs
directory:string* -
open_org
— Open a Salesforce org in the browser.
You can specify a metadata file you want to open.
filePath:string, usernameOrAlias:string*, directory:string* -
deploy_metadata
— Deploy metadata to an org from your local project.
AGENT INSTRUCTIONS:
If the user doesn't specify what to deploy exactly ("deploy my changes"), leave the "sourceDir", "ignoreConflicts" and "manifest" params empty so the tool calculates which files to deploy.
EXAMPLE USAGE:
Deploy changes to my org
Deploy this file to my org
Deploy the manifest
Deploy X metadata to my org
Deploy X local files to my org and ignore any conflicts between the local project and org
Deploy X to my org and run A,B and C apex tests.
ignoreConflicts:boolean, sourceDir:array, manifest:string, apexTestLevel:string, apexTests:array, usernameOrAlias:string*, directory:string* -
retrieve_metadata
— Retrieve metadata from an org to your local project.
AGENT INSTRUCTIONS:
If the user doesn't specify what to retrieve exactly ("retrieve my changes"), leave the "sourceDir", "ignoreConflicts", and "manifest" params empty so the tool calculates which files to retrieve.
EXAMPLE USAGE:
Retrieve changes
Retrieve changes from my org
Retrieve this file from my org
Retrieve the metadata in the manifest
Retrieve X metadata from my org
Retrieve X metadata from my org and ignore any conflicts between the local project and org
ignoreConflicts:boolean, sourceDir:array, manifest:string, usernameOrAlias:string*, directory:string* -
assign_permission_set
— Assign a permission set to one or more org users.
permissionSetName:string*, usernameOrAlias:string*, onBehalfOf:string, directory:string* -
run_apex_test
— Run Apex tests in an org.
AGENT INSTRUCTIONS:
If the user doesn't specify what to test, take context from the currently open file
This will ONLY run APEX tests, NOT agent tests, lightning tests, flow tests, or any other type of test.
this should be chosen when a file in the 'classes' directory is mentioned
EXAMPLE USAGE:
Run tests A, B, C.
Run the myTestMethod in this file
Run this test and include success and failures
Run all tests in the org.
Test the "mySuite" suite asynchronously. I’ll check results later.
Run tests for this file and include coverage
What are the results for 707XXXXXXXXXXXX
testLevel:string*, classNames:array, methodNames:array, async:boolean, suiteName:string, testRunId:string, verbose:boolean, codeCoverage:boolean, usernameOrAlias:string*, directory:string*
Overview
What is Salesforce?
The Salesforce DX MCP server is Salesforce's official local Salesforce MCP server, published as @salesforce/mcp, that lets AI assistants query data, deploy and retrieve metadata, manage orgs and run Apex tests in your authorized Salesforce orgs.
It is maintained by Salesforce in the open-source salesforcecli/mcp repository (mirrored as forcedotcom/mcp) under the Apache-2.0 license, and documented in the Salesforce DX Developer Guide. Important: the README states that this local server reaches end of life on November 2, 2026. After that date the repositories will be archived and the npm package marked deprecated; it stays installable (pinned version 0.30.15 keeps working), and Salesforce points users to skills in forcedotcom/sf-skills instead.
How to use Salesforce?
Prerequisites:
- Node.js 20 or newer (the package's
enginesfield requires>=20.0.0), sonpxcan run it. - At least one org authorized on your machine. Use the Salesforce CLI command
sf org login web, or SFDX: Authorize an Org from the VS Code command palette. No API key goes into the MCP config; the server uses your locally authorized orgs.
Every client uses the same args. The --orgs flag is required; --toolsets, --tools and the Boolean flags are optional:
{
"mcpServers": {
"Salesforce DX": {
"command": "npx",
"args": ["-y", "@salesforce/mcp",
"--orgs", "DEFAULT_TARGET_ORG",
"--toolsets", "orgs,metadata,data,users",
"--tools", "run_apex_test",
"--allow-non-ga-tools"]
}
}
}
This starts the server with every tool in the orgs, metadata, data and users toolsets, plus run_apex_test, including tools that are not yet generally available.
Claude Code
Add the snippet above to the .mcp.json file in your project root, then restart Claude Code.
Cursor
Add the same mcpServers block to your Cursor mcp.json file. The README's Cursor and Cline examples use @salesforce/mcp@latest to always pull the newest release.
VS Code
With GitHub Copilot, create .vscode/mcp.json in your project. VS Code uses a servers key instead of mcpServers:
{
"servers": {
"Salesforce DX": {
"command": "npx",
"args": ["-y", "@salesforce/mcp",
"--orgs", "DEFAULT_TARGET_ORG",
"--toolsets", "orgs,metadata,data,users",
"--tools", "run_apex_test",
"--allow-non-ga-tools"]
}
}
}
Other clients
Cline uses cline_mcp_settings.json with the same block. For Windsurf, Trae and Zed, the README says to follow the same pattern in each client's MCP settings.
Flags
--orgs:DEFAULT_TARGET_ORG,DEFAULT_TARGET_DEV_HUB,ALLOW_ALL_ORGS(use with caution) or a specific username or alias. Separate multiple values with commas.--toolsets: comma-separated toolsets, orall.--tools: individual tool names, combined with toolsets.--allow-non-ga-tools,--debug,--dynamic-tools(experimental),--no-telemetry(telemetry is on by default).
Key features of Salesforce
- Official Salesforce DX MCP server, run locally with
npx -y @salesforce/mcp. - Org allow-list: the server can only reach orgs you name in
--orgs. - Toolsets cut LLM context. The README says there are over 60 tools, so enabling
allis not recommended. - Fine-grained
--toolsselection that you can mix with toolsets. - GA and non-GA tools. Non-GA tools stay off unless you pass
--allow-non-ga-tools. - Experimental
--dynamic-toolsmode starts with a minimal core and loads tools as they are needed (documented for VS Code and Cline). - Developer toolsets beyond org operations: LWC and Aura experts, Code Analyzer, DevOps Center, mobile and Apex performance scanning.
Salesforce tools
- Core (always on):
get_usernamepicks the right org username or alias, andresume_tool_operationresumes long-running jobs such as deployments or scratch org creation. - Orgs:
list_all_orgs,create_scratch_org,create_org_snapshot,delete_organdopen_org. All exceptlist_all_orgsare non-GA. - Data and users:
run_soql_queryruns SOQL.assign_permission_setassigns permission sets. - Metadata:
deploy_metadataandretrieve_metadatamove source between your DX project and an org. - Testing:
run_apex_testandrun_agent_test. - Developer toolsets:
code-analysis(run_code_analyzer),lwc-experts,aura-experts,devops,mobile/mobile-core,scale-products(scan_apex_class_for_antipatterns),experts-validationandenrichment.
Use cases of Salesforce
- Query records in plain language: "List the 10 most recently created accounts in my default org."
- Deploy work in progress: "Deploy my changes to my org and run the AccountServiceTest Apex tests."
- Pull org changes into source control: "Retrieve the metadata in the manifest from my org."
- Manage scratch orgs: "Create a scratch org aliased as MyNewOrg that lasts 3 days."
- Administer users: "Assign the Sales_Ops permission set to this user."
- Review code quality: run Salesforce Code Analyzer on Apex or LWC files and summarize the violations.
Frequently asked questions
1 Is the Salesforce MCP server official?
Yes. @salesforce/mcp is published by Salesforce and maintained in the salesforcecli/mcp / forcedotcom/mcp repositories, with docs in the Salesforce DX Developer Guide.
2 Is the Salesforce DX MCP server being discontinued?
Yes. The README announces end of life on November 2, 2026. After that, no further releases will ship, the repositories will be archived and the npm package deprecated, though it stays installable.
3 Is it free?
The server is open source under Apache-2.0 and runs locally via npx. You still need access to a Salesforce org that you can authorize.
4 Do I need an API key or token?
No key goes into the MCP config. The server uses orgs you've authorized with the Salesforce CLI (sf org login web) or VS Code, and you list them with --orgs.
5 Does the Salesforce MCP server work with Claude Code, Cursor and VS Code?
Yes. The README gives configs for Claude Code (.mcp.json), Cursor (mcp.json), VS Code with Copilot (.vscode/mcp.json) and Cline, and says Windsurf, Trae and Zed follow the same pattern.
6 Is it a remote or local server?
Local. It runs on your machine over stdio via npx. Salesforce's hosted MCP servers are a separate product.
7 How do I limit what the AI can do in my org?
Restrict --orgs to specific aliases instead of ALLOW_ALL_ORGS, enable only the toolsets you need, and leave out --allow-non-ga-tools if you don't want tools such as delete_org.
8 Can I turn off telemetry?
Yes. Telemetry is on by default, and adding --no-telemetry to args turns it off.
Videos
Tutorials, guides, and showcases related to Salesforce MCP Server — by salesforcecli. The player loads when you press play.
Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In