Newer Version Available
Salesforce DX MCP Server and Tools (Beta)
Let's see how this work with an example. Say you enter Deploy my metadata in your IDE's agentic chat window. The LLM sees that the DX MCP Server provides a deploy_metadata MCP tool, which sounds perfect! The LLM then calls that tool within the context of your local DX project. Success and error messages that result from the metadata deploy are then returned back to the LLM to determine the next steps. In sum, the MCP DX tools guide the LLM to accomplish your goals in the the most accurate, tested, and up-to-date way.
If the LLM didn't have the specific context for your prompt, it would still come up with a suggestion, and eventually even the correct one. But because the LLM might be relying on out-of-date training data, getting to the correct answer often involves inefficiencies, guesswork, and unpredictable behavior. MCP solves this problem.
The Salesforce DX MCP Server is a specialized Model Context Protocol (MCP) implementation designed to facilitate seamless interaction between LLMs and Salesforce orgs. See MCP Solutions for Developers in the Agentforce Developer Guide for general MCP information and descriptions of other Salesforce MCP Servers.
Key features of Salesforce DX MCP Server include:
- Direct interaction with Salesforce orgs through LLM-driven tools.
- Secure access using TypeScript libraries (not shelling out to Salesforce CLI).
- Improved security by avoiding the exposure of secrets in plain text.
- Granular access control with org allowlisting.
- Modular tool architecture for easy extensibility.
Salesforce DX MCP Server 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 Vibes Extension Includes the Salesforce DX MCP Server
Agentforce Vibes is an AI-powered Salesforce developer tool that's available as an easy-to-install Visual Studio Code (VS Code) extension. It includes Agentforce, an intelligent coding partner that provides information and, most importantly, can take action.
The Salesforce DX MCP Server is pre-configured in Agentforce Vibes, so you can start using the DX MCP tools immediately after you install the extension in VS Code.
See Set Up Agentforce Vibes and Build with Agentforce for more information.
Types of MCP Tools Included in Salesforce DX MCP Server
The Salesforce DX MCP Server includes many tools for working with different Salesforce features. To narrow the LLM context, the DX MCP Server groups the tools into toolsets based on functionality. You can then easily enable only those tools you want to use, rather than enable them all and overwhelm the LLM.
These are the high-level types of MCP tools included in the DX MCP Server:
- Core DX: Usual DX tools for working with orgs, deploying and retrieving metadata, and so on.
- Code Analysis: Run a static analysis of your code using Salesforce Code Analyzer.
- DevOps: Manage work items, resolve merge conflicts, and troubleshoot deployment problems within DevOps Center.
- Lightning Types: Create and enhance custom Lightning types to define complex data structures and build custom user interfaces for Agentforce, Prompt Builder, and other Salesforce applications. See the Lightning Types MCP Tool documentation.
- Lightning Web Components (LWC) and Aura: Help you design, build, test, and optimize LWC code and facilitate Aura migration to LWC.
- Mobile: Help LWC developers create Lightning web components that integrate with device-native features and adhere to Mobile Offline design patterns.
- Scale Products: Use ApexGuru to detect and fix Apex performance issues.
MCP Terminology
Here are the MCP-specific terms we use in this document.
- MCP Server - An MCP server lets users interact with a system (such as Salesforce) using an LLM and natural language instead of an API. MCP servers provide the LLM with tools, prompts, and resources that the LLM can use to perform specific tasks.
- MCP Tools - Executable functions that the LLM can call to perform actions.
- MCP Toolsets - Logical groups of MCP tools based on their functionality. For example, the Salesforce DX MCP Server has metadata and orgs toolsets.
- MCP Client - The interface (such as Agentforce) or IDE (such as Cursor) that can host an MCP server and act as an interface to the LLM. Also called MCP Host, although this document uses the term MCP client.