02) How to setup the Salesforce DX MCP Server for faster development - Coding-With-The-Force/Salesforce-Cursor-IDE-Claude-AI-Setup-Guide GitHub Wiki

What is a Model Context Protocol (MCP) Server?

I'm gonna simplify this quite a bit, but an MCP server is basically just a way to provide your AI assistants some additional refined context and/or access to the system (or systems) that you are working with.

In our case it makes it considerably easier to work with our Salesforce orgs. Without connecting the Salesforce SFDX MCP Server the quality and reliability of your AI agent's output will be considerably worse (and I mean by quite a bit).

If you want way more info on the ins and outs of MCP, you can get way more information here.


Setting up the Salesforce DX MCP Server in Cursor

To setup the Salesforce DX MCP Server with Cursor you just need to do the following:

  1. Navigate to File -> Preferences -> Cursor Settings -> Tools and Integrations
  2. Click the "New MCP Server" button

New MCP Server Image

  1. Copy and paste the JSON below into the mcp.json file
  2. Save the file and you're done!

MCP Configuration File JSON

{
  "mcpServers": {
    "salesforce": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@salesforce/mcp", "--orgs", "DEFAULT_TARGET_ORG", "--toolsets", "all"]
    }
  }
}

MCP JSON URL