SyncGTM now works inside Claude and ChatGPT. Learn moreDonate to Nepal’s flood relief
SyncGTM logoSyncGTM logo
  • Platform

    • Waterfall Enrichment
    • Real-time signals
    • Integrations
    • Enrichment MCP

    Person Data

    • Work Email
    • Mobile Number
    • Personal Email
    • Experience
    • Verify Emails
    View all →

    Company

    • Techstack
    • Website Traffic
    • Revenue
    • Google Ads
    • LinkedIn Posts
    View all →

    Person signals

    • Job Change
    • Promotions
    • Leadership Change
    • LinkedIn Posts
    • WhatsApp Validation
    View all →

    Account signals

    • Headcount Growth
    • Job Openings
    • Techstack Change
    • Funding
    • Product Launched
    View all →
    • Sales
    • RevOps
    • Agency
    • Startups
    • GTM Engineers
    • CRM Enrichment
    • Account Research
    • Inbound Automation
    • Outbound Automation
    • Monitor Signals
  • Fractional GTMe
  • Pricing
  • Learn

    • Blog
    • Docs
    • Templates
    • Reports
    • Video Tutorials
    • Product Tour

    Resource

    • Affiliate
    • Free Tools
    • Credit Estimator
    • Compare Coverage
    • Agency Directory
    • Product Updates
    • Roadmap
    • Join community

    AI

    • GTM agents
    • GTM skills
  • Login
  • vsClay logoClay
  • Platform

    • Waterfall Enrichment
    • Real-time signals
    • Integrations
    • Enrichment MCP

    Person Data

    • Work Email
    • Mobile Number
    • Personal Email
    • Experience
    • Verify Emails
    • View all →

    Company

    • Techstack
    • Website Traffic
    • Revenue
    • Google Ads
    • LinkedIn Posts
    • View all →

    Person signals

    • Job Change
    • Promotions
    • Leadership Change
    • LinkedIn Posts
    • WhatsApp Validation
    • View all →

    Account signals

    • Headcount Growth
    • Job Openings
    • Techstack Change
    • Funding
    • Product Launched
    • View all →
    • Sales
    • RevOps
    • Agency
    • Startups
    • GTM Engineers
    • CRM Enrichment
    • Account Research
    • Inbound Automation
    • Outbound Automation
    • Monitor Signals
  • Fractional GTMe
  • Pricing
    • Blog
    • Docs
    • Templates
    • Reports
    • Video Tutorials
    • Product Tour

    Resource

    • Affiliate
    • Free Tools
    • Credit Estimator
    • Compare Coverage
    • Agency Directory
    • Product Updates
    • Roadmap
    • Join community

    AI

    • GTM agents
    • GTM skills
  • Login
  • vsClay logoClay
SyncGTM logo
support@syncgtm.com
Built withfrom&

Platform

  • Waterfall Enrichment
  • Real-time signals
  • Integrations
  • Enrichment MCP
  • Enrichment CLIsoon

Use Cases

  • CRM Enrichment
  • Account Research
  • Inbound Automation
  • Outbound Automation
  • Monitor Signals

Person Data

  • Work Email
  • Mobile Number
  • Personal Email
  • Experience
  • Verify Emails
  • View all →

Company Data

  • Techstack
  • Website Traffic
  • Job Listing
  • Google Ads
  • LinkedIn Posts
  • View all →

Person Signals

  • Job Change
  • Promotions
  • Leadership Change
  • LinkedIn Posts
  • WhatsApp Validation
  • View all →

Account Signals

  • Headcount Growth
  • Job Openings
  • Techstack Change
  • Funding
  • Product Launched
  • View all →

Solutions

  • Sales
  • Agency
  • RevOps
  • Startups
  • GTM Engineers
  • Fractional GTMe

Company

  • Contact
  • Affiliate
  • Sign Up
  • Login
  • Terms
  • Affiliate Terms
  • Privacy

Resources

  • Pricing
  • Credit Estimator
  • Templates
  • Blog
  • Video Tutorials
  • Slack Community
  • Docs
  • Agency Directory
  • Free Tools
  • Product Updates
  • Roadmap

Copyright ©2026 SyncGTM

Featured on SaaSBison
Claude Code Salesforce MCP setup guide — connect your Salesforce CRM to AI in 2026

In this Blog

  • TL;DR
  • What Is the Salesforce MCP Server?
  • Prerequisites
  • Install the Salesforce DX MCP Server
  • Authenticate and Authorize Your Org
  • Configure Claude Code (.mcp.json)
  • Toolsets and Permissions Explained
  • Hosted MCP Server with OAuth (Beta)
  • 5 Real GTM Automations You Can Run
  • Troubleshooting Common Errors
  • When to Use SyncGTM Instead
  • FAQ

Claude Code Salesforce MCP: Connect Your CRM to AI in 2026

Kushal Magar

By Kushal Magar · April 25, 2026 · 14 min read

Key Takeaway

The Salesforce MCP server lets Claude Code read and write your Salesforce org using natural language. Setup takes under 30 minutes — install the CLI, authorize your org, add .mcp.json, and Claude handles the rest. GTM teams get the most value from SOQL-based pipeline queries, bulk record updates, and metadata retrieval.

Your Salesforce org holds your pipeline, accounts, and contact history. Claude Code can reason over data and write code.

The Salesforce MCP server connects the two in under 30 minutes.

This guide covers the full setup — installing the DX MCP server, authenticating your org, and configuring Claude Code. It also covers when to reach for SyncGTM instead for enrichment-heavy workflows.

Most tutorials stop at “Claude can now talk to Salesforce.” This one shows five GTM automations your RevOps team can run today.


TL;DR

  • Salesforce MCP server connects Claude Code to your Salesforce org — query data, update records, deploy metadata, run tests
  • Two options: DX MCP server (local, via npx, free) and Hosted MCP server (cloud, OAuth, currently in beta)
  • Setup takes ~30 minutes — install Salesforce CLI, authorize org, create .mcp.json, start Claude Code
  • 60+ tools across 15 toolsets: metadata, data, users, testing, code analysis, DevOps Center, and more
  • Best for GTM teams: pipeline queries, bulk record updates, SOQL reporting, and opportunity stage automation
  • For enrichment workflows (adding emails, phone numbers, firmographics to Salesforce), SyncGTM is a better fit than the MCP server

What Is the Salesforce MCP Server?

The Salesforce MCP server is Salesforce's open-source implementation of Model Context Protocol — Anthropic's standard for connecting AI models to external tools. Published as @salesforce/mcp on npm.

Once connected, Claude operates under the same Salesforce permissions as the authenticated CLI user. Ask “What are the 10 largest open opportunities closing this quarter?” and Claude runs the SOQL query and formats the results.

This is not Agentforce. Agentforce is declarative, admin-configured, and built for non-developers.

The MCP server is for developers — full programmatic access from Claude Code, Cursor, VS Code Copilot, or any MCP-compatible client.

What Claude Code can do with the Salesforce MCP server

  • Run SOQL queries and return formatted results
  • Create, update, and delete Salesforce records
  • Retrieve and deploy metadata (Flows, fields, page layouts)
  • Run Apex tests and return pass/fail results
  • List and manage org users and permissions
  • Analyze code for security vulnerabilities
  • Interact with DevOps Center pipelines

Prerequisites

Before setup, confirm you have the following:

  • Node.js 18+ — the MCP server requires Node.js 18 or higher. Check with node --version
  • Salesforce CLI — install via npm install -g @salesforce/cli or the official installer
  • Claude Code — install via npm install -g @anthropic-ai/claude-code
  • Salesforce org access — Developer Edition, sandbox, or production. You need a user account with permission to run Salesforce CLI commands
  • npx — included with Node.js. No separate install needed

The MCP server inherits your CLI user's Salesforce profile and permission sets. If that user can't read Opportunity records, Claude can't either — match permissions to the operations you plan to run before setup.


Install the Salesforce DX MCP Server

The DX MCP server runs locally via npx — no global install required. The package is @salesforce/mcp, published by Salesforce on npm.

Step 1: Verify Node.js and Salesforce CLI

# Check Node.js version (must be 18+)
node --version

# Check Salesforce CLI
sf --version

# Install Salesforce CLI if missing
npm install -g @salesforce/cli

Step 2: Test the MCP server package directly

Run the package once to confirm it loads without errors. You will not use this command day-to-day — Claude Code handles launching the server — but it confirms the package is accessible.

npx -y @salesforce/mcp --help

A successful output lists available flags: --orgs, --toolsets, --tools, and others. If you see an error, confirm Node.js is 18+ and npx is in your PATH.


Authenticate and Authorize Your Org

The MCP server doesn't handle auth itself — it delegates to the Salesforce CLI, which stores org credentials locally. Same OAuth flow Salesforce developers use every day.

Authorize via web login

# Authorize a production org
sf org login web --alias my-prod-org

# Authorize a sandbox
sf org login web --instance-url https://test.salesforce.com --alias my-sandbox

# Confirm authorization worked
sf org list

The --alias flag sets a short name for the org. You reference this alias in your .mcp.json config.

Use consistent naming — one alias per environment (dev, sandbox, prod).

Set a default org (optional but recommended)

# Set a local default org for this project directory
sf config set target-org my-sandbox --global false

# Verify it was set
sf config get target-org

Setting a default lets you use DEFAULT_TARGET_ORG in your MCP config instead of hardcoding an alias — the safer pattern for shared repos, since each developer sets their own default locally.

Security note

Never pass Salesforce credentials as plaintext in your MCP config. The Salesforce CLI stores tokens encrypted in your system credential store.

If you need to rotate credentials, re-run sf org login web for the affected alias.


Configure Claude Code (.mcp.json)

Claude Code reads MCP server configuration from a .mcp.json file in your project root. Create this file with the following structure:

Minimal configuration (default org)

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

Configuration with specific toolsets

Use the --toolsets flag to enable only the tool categories you need. This keeps Claude's context window smaller and reduces the risk of unintended operations.

{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": [
        "-y",
        "@salesforce/mcp",
        "--orgs",
        "my-sandbox",
        "--toolsets",
        "data,metadata,users,orgs"
      ]
    }
  }
}

Multi-org configuration

To give Claude access to multiple orgs simultaneously, pass multiple aliases to the --orgs flag.

{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": [
        "-y",
        "@salesforce/mcp",
        "--orgs",
        "my-sandbox,my-prod-org",
        "--toolsets",
        "data,metadata"
      ]
    }
  }
}

Verify the connection

Start Claude Code from the same directory as your .mcp.json file, then ask:

claude

# Inside Claude Code, test with:
> List all Salesforce orgs you have access to
> Run a SOQL query: SELECT Id, Name, StageName, CloseDate FROM Opportunity WHERE StageName != 'Closed Won' AND StageName != 'Closed Lost' ORDER BY CloseDate ASC LIMIT 10

A successful response returns your open pipeline records. If you see a connection error, check the troubleshooting section below.


Toolsets and Permissions Explained

The Salesforce MCP server exposes 60+ tools organized into 15 toolsets. You choose which toolsets to enable in your --toolsets flag.

Enabling all toolsets at once fills Claude's context window unnecessarily — use only what your workflow requires.

ToolsetFlag valueWhat it enables
Data OperationsdataSOQL queries, record CRUD, bulk data operations
MetadatametadataRetrieve and deploy metadata, manage org settings
UsersusersList and manage org users, permission sets
OrgsorgsOrg info, limits, feature flags, scratch org management
TestingtestingRun Apex tests, return pass/fail with error details
Code Analysiscode-analyzerStatic analysis, security scanning, Apex best practices
DevOps Centerdevops-centerPipeline management, work item tracking, promotions

For GTM automation use cases, enable only data,metadata,users. This covers SOQL queries, record updates, and field management — everything a RevOps team needs — without exposing testing or deployment tools that could cause unintended changes.

Dynamic tool loading (reduces context usage)

{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": [
        "-y",
        "@salesforce/mcp",
        "--orgs",
        "DEFAULT_TARGET_ORG",
        "--toolsets",
        "data,metadata",
        "--dynamic-tools"
      ]
    }
  }
}

The --dynamic-tools flag loads tools on-demand instead of declaring all 60+ tools in Claude's context upfront. Recommended for long sessions.


Hosted MCP Server with OAuth (Beta)

The Hosted MCP server is Salesforce's cloud-managed alternative to running npx locally. Claude Code connects via OAuth 2.0 through the mcp-remote package as a proxy. As of April 2026, it's in beta.

When to use the Hosted server

  • Sharing Salesforce access across a team without per-machine CLI setup
  • CI/CD pipelines where local CLI credentials are not practical
  • Environments where installing Salesforce CLI is restricted

Hosted MCP configuration

{
  "mcpServers": {
    "salesforce-hosted": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.salesforce.com/sse"
      ]
    }
  }
}

On first connection, mcp-remote opens a browser for OAuth. Salesforce prompts you to select an org and approve three scopes: api, refresh_token, and sfap_api.

Required OAuth scopes

  • api — access Salesforce APIs on behalf of the user
  • refresh_token — maintain persistent sessions without re-authorizing
  • sfap_api — required for Agentforce and AI features

The DX server remains the more stable option for individual developers. Use the Hosted server once it reaches GA — beta limitations include slower response times and occasional endpoint downtime.


5 Real GTM Automations You Can Run

Here are five concrete workflows RevOps and sales engineers run with Claude Code connected to Salesforce — copy the prompts directly.

1. End-of-quarter pipeline report

Ask Claude to pull open opportunities closing this quarter, group by stage and owner, calculate weighted pipeline value, and flag deals with no activity in 14+ days. Paste the result straight into your leadership Slack channel.

Example prompt

“Query all open Opportunities closing before 2026-06-30. Group by StageName and OwnerId. Show total Amount per group, count of deals with no activity in 14+ days, and weighted pipeline using Probability. Format as a markdown table.”

2. Bulk opportunity stage update

After a strategy change, bulk-updating opportunity stages is tedious. Claude identifies the affected records, shows you the count and a sample, then executes the update — with your review before any write runs.

Example prompt

“Find all Opportunities where StageName is 'Proposal/Price Quote' and CloseDate is before 2026-03-01. Show me the count and a sample of 5 records. Then update StageName to 'Closed Lost' and set Description to 'Closed Lost: stale Q1 deal' for all of them.”

3. Custom field creation and metadata deployment

Add a custom field to the Opportunity object without touching Salesforce Setup. Claude drafts the metadata XML, validates it against your org's schema, and deploys it.

Example prompt

“Add a custom Number field called ICP_Score__c to the Opportunity object. Label: 'ICP Score'. Precision: 3, scale: 0, min 0, max 100. Deploy it to my sandbox org.”

This pairs directly with sign-up enrichment workflows that push ICP scores from external providers into Salesforce — the MCP server creates the field, SyncGTM populates it.

4. Account health check and re-engagement targeting

Find accounts that have gone dark — no open opportunities, no activity in 90 days, above your revenue threshold. Claude returns a prioritized list with account owner, last activity date, and a draft re-engagement message per industry.

Example prompt

“Find Accounts where Type is 'Customer', AnnualRevenue > 5000000, and LastActivityDate < 2026-01-25. Show Account Name, Owner, Industry, and LastActivityDate. Suggest one re-engagement message per account based on their Industry.”

5. Lead routing audit

Find unassigned leads, unconverted leads sitting 30+ days, and which rep has the highest backlog. Claude surfaces the distribution in a table and flags routing gaps.

Example prompt

“Query all unconverted Leads created before 2026-03-26. Group by OwnerId. Show count per owner, oldest lead date, and average CreatedDate. Flag any owner with more than 50 unworked leads.”

For more GTM automation ideas built on Claude Code, see how GTM teams use Claude Code and the top GTM MCPs that work with Claude Code in 2026.


Troubleshooting Common Errors

Error: “No org found for DEFAULT_TARGET_ORG”

Your Salesforce CLI has no default org configured. Run sf org list to see authorized orgs. Either set a default with sf config set target-org <alias> or replace DEFAULT_TARGET_ORG in your .mcp.json with a specific alias.

Error: “INSUFFICIENT_ACCESS_OR_READONLY”

The authenticated CLI user does not have permission to perform the requested operation in Salesforce. Check the user's profile and permission sets in Salesforce Setup. Ensure the profile has the required object and field-level access for your MCP queries.

Error: “MCP server failed to start”

Usually a Node.js version issue. Run node --version — it must be 18 or higher.

If you manage Node with nvm, run nvm use 20 before starting Claude Code. Confirm npx -y @salesforce/mcp --help returns output without errors.

Error: “Session expired” or token refresh failures

Salesforce OAuth tokens expire. Re-authorize the org with sf org login web --alias <alias>. If this happens frequently, check your org's session timeout setting in Salesforce Setup — it may be configured for a shorter duration than the default.

Enable debug logging

{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": [
        "-y",
        "@salesforce/mcp",
        "--orgs",
        "DEFAULT_TARGET_ORG",
        "--toolsets",
        "data,metadata",
        "--debug"
      ]
    }
  }
}

The --debug flag logs all MCP server activity to stderr. In Claude Code, server logs appear in the session output.

Copy the full error message when filing an issue on the GitHub repository.


When to Use SyncGTM Instead

The Salesforce MCP server is the right tool when you want Claude Code to read and modify data that already exists in Salesforce — pipeline queries, bulk updates, field creation, metadata deployment.

It's not designed for enriching records with external data. Adding emails, phone numbers, firmographics, or buying signals to Salesforce contacts requires a different tool.

TaskSalesforce MCPSyncGTM
SOQL pipeline queriesYesNo
Bulk record updatesYesPartial (via sync actions)
Metadata deploymentYesNo
Contact email enrichmentNoYes (50+ providers)
Phone number waterfallNoYes
Firmographic enrichmentNoYes
Buying signal detectionNoYes
ICP scoringNoYes
Automated outreach enrollmentNoYes

The two tools are complementary — use the MCP server for developer and RevOps engineering tasks, and SyncGTM to keep your Salesforce data enriched and action-ready.

For the full picture on Salesforce enrichment, see the best Salesforce enrichment tools in 2026. For broader Claude Code GTM workflows, see the best Claude Code GTM skills for revenue teams.


Your Salesforce Data Is Only as Good as What's In It

The MCP server queries what's already there. SyncGTM fills in what's missing — waterfall enrichment from 50+ providers, ICP scoring, and automatic Salesforce sync at $99/mo.

Enrich Your Salesforce Data Free

Frequently Asked Questions

Want Salesforce enrichment on autopilot?

SyncGTM enriches Salesforce contacts and accounts from 50+ providers — waterfall enrichment, ICP scoring, and automatic sync. No code required.

Share Article


Ask AI

Enrich Your Salesforce Data with SyncGTM

SyncGTM connects to Salesforce and auto-enriches every contact and account with firmographic data, phone numbers, emails, and buying signals — starting at $99/mo.