mcp
MCP Server for Interacting with Salesforce Orgs
Feedback
Report bugs and issues here.
For feature requests and other related topics, start a Discussion here.
Overview of the Salesforce DX MCP Server (Developer Preview)
The Salesforce DX MCP Server is a specialized Model Context Protocol (MCP) implementation designed to facilitate seamless interaction between large language models (LLMs) and Salesforce orgs. This MCP server provides a robust set of tools and capabilities that enable LLMs to read, manage, and operate Salesforce resources securely.
Key Features:
- Direct interaction with Salesforce orgs through LLM-driven tools.
- Secure access using TypeScript libraries (not shelling out to the
sfSalesforce CLI). - Improved security by avoiding the exposure of secrets in plain text.
- Granular access control with org allowlisting.
- Modular tool architecture for easy extensibility.
NOTE: The Salesforce DX MCP Server is available as a developer preview. The feature isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don't implement functionality developed with these commands or tools. As we continue to enhance and refine the implementation, the available functionality and tools may evolve. We welcome feedback and contributions to help shape the future of this project.
Security Features
The Salesforce DX MCP Server was designed with security as a top priority.
Uses TypeScript libraries directly
- Greatly decreases the size of the MCP Server.
- Significantly reduces the risk of remote code execution (RCE).
No secrets needed in configuration
- Eliminates the risk of plain text secret exposure.
- Accesses pre-existing (encrypted) auth files on the user's machine.
- Implements allowlisting for auth info key/values to prevent sensitive data exposure.
No secrets exposed via MCP tools
- Prevents other tools from accessing unencrypted tokens.
- Tools pass usernames around instead of tokens.
Granular access control
- MCP Server can access auth info for only orgs that have been explicitly allowlisted.
- Users specify allowed orgs when starting the server.
Agentforce for Developers Includes the Salesforce DX MCP Server
Agentforce for Developers is an AI-powered Salesforce developer tool that's available as an easy-to-install Visual Studio Code (VS Code) extension. It includes Dev Agent (developer preview), an intelligent coding partner that provides information and, most importantly, can take action. Through agentic chat powered by MCP, Dev Agent can execute commands and perform complex workflows automatically, right from within VS Code.
The Salesforce DX MCP server is pre-configured in Agentforce for Developers, so you can start using the DX MCP tools immediately after you install the extension in VS Code.
See Set Up Agentforce for Developers and Chat with Dev Agent (Dev Preview) for more information.
Get Started Using VS Code as the Client
Want to jump in and see what all the fuss is about? Read on!
This example uses Visual Studio Code (VS Code) as the MCP client. After you configure it with the Salesforce DX MCP Server, you then use GitHub Copilot and natural language to easily execute typical Salesforce DX development tasks, such as listing your authorized orgs, viewing org records, and deploying or retrieving metadata.
But you're not limited to using only VS Code and Copilot as the MCP client! As already mentioned, you can use Agentforce for Developers, which is pre-configured with the DX MCP server. Or you can configure many other clients to use the Salesforce DX MCP Server, such as Cursor, Cline, Claude Desktop, Zed, Windsurf, and more.
Before You Begin
For the best getting-started experience, make sure that you have a Salesforce DX environment set up on your computer. In particular:
- Install Salesforce CLI on your computer.
- Install VS Code on your computer.
- Create a Salesforce DX project and open it in VS Code. You can also clone an example repo, such as dreamhouse-lwc, which is a ready-to-use DX project that contains a simple Salesforce application, with metadata and test data.
- Authorize at least one Salesforce org to use with your DX project. You can also create a scratch org.
Let's Do It
Create a
.vscode/mcp.jsonfile at the root of your DX project and add this JSON:{ "servers": { "Salesforce DX": { "type": "stdio", "command": "npx", "args": ["-y", "@salesforce/mcp", "--orgs", "DEFAULT_TARGET_ORG", "--toolsets", "all"] } } }You can also configure the MCP server globally by editing the VS Code settings.json file and adding a similar JSON snippet but contained in an
mcp:serverssection.The
--orgsflag is required and specifies the authorized orgs you're allowing the MCP server to access. The--toolsetsand--toolsflags are used to specify which tools the server will start with. See Configure the DX MCP Server for the available values for these flags.Open VS Code, go to View -> Command Palette and enter MCP: List Servers.
TIP: You can also get to the command palette by pressing press Ctrl+Shift+P (Windows or Linux) or Command-Shift-P (macOS).
Click
Salesforce DX, then Start Server.Check the Output tab for the server status.
Run Chat: Open Chat (Agent) from the command palette to start a new GitHub Copilot chat session.
Be sure your Copilot chat window is in
Agentmode; if you're inAskorEditmode, use the little drop-down to switch.In the GitHub Copilot chat window, use natural language to explain what you want to do. The MCP server determines which configured tool to use, and then shows it to you along with other information. Click Continue to run the tool and see the results of your request.
Try out these examples:
- List all my orgs.
- Which are my active scratch orgs?
- Show me all the accounts in the org with alias my-org.
- Deploy everything in my project to the org with alias my-org.
- Do you see any performance or security issues with the Apex code in the
MyApexClass.clsfile? - I see that my Apex code violates the pmd:ApexCRUDViolation rule; can you give me more information about this rule?
To stop, restart, or view the MCP server configuration, run the MCP: List Servers command, click
Salesforce DX, then click the appropriate option.
Installing via Smithery
To install salesforce-mcp-kodey automatically via Smithery:
npx -y @smithery/cli install @kodey-ai/salesforce-mcp-kodey