Supercharge Your Salesforce Implementation: Setting Up Salesforce DX MCP with Claude Code in IntelliJ + IC2

July 11, 2025 (6d ago)

Supercharge Your Salesforce Implementation: Setting Up Salesforce DX MCP with Claude Code in IntelliJ + IC2

Last week, with the release of Salesforce DX MCP (Model Context Protocol), I tried it with Claude Code and the results were amazing. Having an AI assistant that understands my Salesforce org, executes SFDX commands intelligently, and works seamlessly with my IntelliJ + Illuminated Cloud 2 setup has transformed my workflow.

In this guide, I’ll walk you through exactly how to set up this powerful combination with step-by-step instructions and practical use cases.

What is Salesforce DX MCP and Why Should You Care?

Before we dive into the setup, let’s understand what we’re dealing with. Model Context Protocol (MCP) is an open standard that solves the fragmentation problem in AI tool integrations. Think of it as “USB-C for AI agents”—a universal standard that allows different AI systems to communicate with various services seamlessly.

Salesforce DX MCP is Salesforce’s implementation of this protocol, specifically designed for Salesforce development workflows.

Before Salesforce DX MCP:

With Salesforce DX MCP:

Prerequisites

Before we start, you’ll need:

IDE

AI Agent

Note: This process also works with other editors like Cursor, VS Code, or any MCP-compatible IDE

Creating an SFDX Project in IntelliJ + Illuminated Cloud 2

Step 1: Create New SFDX Project in IntelliJ

  1. Open IntelliJ IDEA and create a new project:
File → New → Project → Illuminated Cloud
  1. Configure the Project Type:
  2. Select “Salesforce DX” as the project type
  3. Choose your project location
  4. Name your project (e.g., “my-sfdx-mcp-project”)
  5. Set Up Org Connection:
  6. Click the “New Connection” button (pencil icon)
  7. In the Connections modal, click “Create Connection” (plug icon)
  8. Select your organization type (I’m choosing Production for my developer edition)
  9. This will redirect to your browser to enter your credentials
  10. Initialize the Project:
  11. Click “Next” → “Finish”
  12. Wait for IntelliJ to download and index your metadata

Step 2: Verify SFDX Project Structure

Your project should now have this structure:

my-sfdx-mcp-project/
├── sfdx-project.json
├── force-app/
│   └── main/
│       └── default/
│           ├── classes/
│           ├── objects/
│           ├── lwc/
│           └── triggers/
├── config/
└── .sfdx/

Setting Up Claude Code on Mac: Step-by-Step Guide

Now for the exciting part—setting up Claude Code to work with our SFDX project.

Prerequisites Check

First, ensure you have Node.js installed (Claude Code requires Node.js 18+). Open the terminal in IntelliJ and run:

# Check if Node.js is installed and version
node --version
npm --version

If you don’t have Node.js or have an older version:

  1. Download and install Node.js from nodejs.org
  2. Choose the LTS version (recommended for most users)
  3. Run the installer and follow the setup wizard
  4. Restart your terminal and verify installation:
node --version  # Should show v18.x.x or higher
npm --version   # Should show 9.x.x or higher

Step 1: Install Claude Code

# Install Claude Code globally
npm install -g @anthropic/claude-code

# Verify installation
claude --version

Step 2: Authentication Setup

Claude Code is now included with your Claude Pro subscription ($20/month), making the setup much simpler:

  1. Run Claude Code for the first time:
claude
  1. This will open your default browser automatically
  2. Sign in with your Claude Pro account
  3. Grant the necessary permissions
  4. Return to your terminal—you should see a success message

Note: Claude Code requires an active Claude Pro subscription.

Step 3: Test Claude Code Installation

Open the IntelliJ terminal and test Claude Code:

# In IntelliJ terminal (already in your project directory)
claude

# You should see the Claude Code interface
# Best practice: Always run /init first to create claude.md file for better context
> /init

# This creates a claude.md file that helps Claude understand your project structure,
# dependencies, and purpose - leading to much better suggestions and responses
# Now try basic commands:
> explain the project structure

Setting Up Salesforce DX MCP Server

This is where the magic happens—connecting Claude Code to your Salesforce orgs through MCP.

Step 1: Install Salesforce DX MCP Server

# Install the official Salesforce DX MCP server
npm install -g @salesforce/mcp

# Verify installation
npx @salesforce/mcp --help

Step 3: Configure MCP Server for Claude Code

Create an MCP configuration file for Claude Code:

# Create Claude Code config directory if it doesn't exist
mkdir -p ~/.config/claude-code

# Create MCP configuration
cat > ~/.config/claude-code/mcp.json << 'EOF'
{
  "servers": {
    "salesforce": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@salesforce/mcp",
        "--orgs",
        "DEFAULT_TARGET_ORG",
        "--toolsets",
        "all"
      ]
    }
  }
}
EOF

Alternative: You can also add Salesforce DX MCP by asking Claude Code to:

Add Salesforce DX MCP to Claude Code npm install -g @salesforce/mcp

Testing Your Configuration

Let’s verify everything is working correctly.

Step 1: Basic MCP Connection Test

# In IntelliJ terminal, start Claude Code
claude

# Best practice: Run /init first for better project context
> /init

# Test MCP connection
> list all custom objects in my org

Step 2: Advanced Configuration Test

Try these commands to ensure full functionality:

# In Claude Code interface:

# Test org access
> show me the schema for Account object

# Test metadata operations
> what apex classes do I have in this org?

# Test SOQL capabilities
> query the last 5 opportunities created

# Test deployment capabilities
> check the deployment status of my recent changes

Common Use Cases and Practical Examples

Now that everything is set up, let’s explore some powerful use cases.

Use Case 1: Intelligent Code Review

# In Claude Code:
> analyze this apex class for best practices and suggest improvements

# Follow up with:
> check if this class has adequate test coverage
> suggest test methods for this class

Use Case 2: Automated Deployment with Context

# Deploy with intelligent analysis
> deploy my recent changes to my developer org and run related tests

# Check deployment status
> what's the status of my last deployment?

Use Case 3: Schema Analysis and Documentation

# Generate documentation
> create documentation for all custom objects in this org

# Analyze relationships
> show me the relationship diagram for Opportunity and related objects

Use Case 4: Bulk Data Operations

# Query and analyze data
> find all accounts without opportunities in the last 6 months

# Data cleanup suggestions
> identify duplicate contacts and suggest merge strategies

Advanced Configuration Tips

Best Practice: Always Initialize Project Context

Before working with any SFDX project in Claude Code, run:

> /init

This creates a claude.md file that provides Claude with essential project context, leading to much more accurate suggestions and better understanding of your codebase.

Tip 1: Environment-Specific Tool Configuration

You can customize which MCP tools are available based on your environment:

# For production - only enable safe, read-only tools
npx @salesforce/mcp --orgs production --toolsets query,metadata

# For sandbox - enable all tools for full development capabilities
npx @salesforce/mcp --orgs sandbox --toolsets all

Tip 2: Multi-Environment MCP Configuration

# Configure different toolsets for different environments
cat > ~/.claude/settings.local.json << 'EOF'
{
  "servers": {
    "salesforce-prod": {
      "command": "npx",
      "args": ["-y", "@salesforce/mcp", "--orgs", "production", "--toolsets", "query,metadata"]
    },
    "salesforce-sandbox": {
      "command": "npx", 
      "args": ["-y", "@salesforce/mcp", "--orgs", "sandbox", "--toolsets", "all"]
    }
  }
}
EOF

Conclusion

Setting up Salesforce DX MCP with Claude Code has revolutionized my development workflow. The ability to have an AI assistant that truly understands both my codebase and my Salesforce org creates possibilities I never imagined.

The initial setup might seem complex, but the productivity gains are immediate and substantial. Give it a try, and let me know in the comments how it transforms your Salesforce implementation experience!


What’s Next? I’ll continue exploring Salesforce DX MCP and share more insights from my experience. Stay tuned!


** #SalesforceDX #MCP #ClaudeCode #SalesforceAI #SalesforceDevelopment #IntelliJ #IlluminatedCloud #ModelContextProtocol #SalesforceImplementation #AIAgent #SFDX #Agentforce