Skip to content

MCP server

Salesforce MCP server

Salesforce's official DX MCP server lets AI query data with SOQL, manage orgs and metadata, run tests and assign permission sets.

At a glance

Maintained by
Salesforce (Salesforce CLI team)
Tools exposed
9 listed below
Reviewed
September 24, 2026

Why it matters

What it does and why it matters

Salesforce is the CRM for many larger sales and service teams. The Salesforce DX MCP server, from the Salesforce CLI team, is built mainly for administrators and developers: it can run SOQL queries, list orgs, deploy and retrieve metadata, assign permission sets and run Apex and agent tests.

Salesforce also runs hosted MCP servers, generally available since April 2026, for working with records directly. Which one fits depends on whether the goal is building on Salesforce or working with its data.

The DX server runs locally with the Salesforce CLI and uses orgs you have authorized. Deploying metadata changes a live org, so we point it at sandboxes during development and keep production deployments in a reviewed pipeline.

Use cases

Best business use cases

Data questions

Answer questions with SOQL queries.

Admin and dev work

Deploy and retrieve metadata in sandboxes.

Testing

Run Apex and agent tests and summarize failures.

Access setup

Assign permission sets with review.

Account research

Pull account data for sales prep. See AI sales research.

Tools

Available tools

Tool names as published by the maintainer at review time. Versions change, so check the repository for the current list.

Read and write: Read and write: queries, metadata deploy and retrieve, users, tests and code analysis. Aimed at developers and admins.

  • run_soql_query

    Run a SOQL query against an org.

  • list_all_orgs

    List configured orgs, with optional connection check.

  • get_username

    Pick the right username or alias for an operation.

  • deploy_metadata

    Deploy metadata from a DX project to an org.

  • retrieve_metadata

    Retrieve metadata from an org to a DX project.

  • assign_permission_set

    Assign a permission set to a user.

  • run_apex_test

    Run Apex tests in an org.

  • run_agent_test

    Run agent tests in an org.

  • resume_tool_operation

    Resume a long-running operation.

Workflows

Example workflows

Test a change in a sandbox

  1. 1

    Connect a sandbox org.

  2. 2

    The assistant deploys the metadata change.

  3. 3

    It runs the Apex tests.

  4. 4

    It summarizes failures.

  5. 5

    A developer fixes and repeats.

Answer a data question

  1. 1

    Ask how many open cases each team has.

  2. 2

    The assistant writes a SOQL query.

  3. 3

    It runs it against the org.

  4. 4

    It returns a table.

  5. 5

    You ask follow-up questions.

Prompts

Example prompts

  • “How many open opportunities over $50,000 are in the negotiation stage?”

  • “Run the Apex tests in the sandbox and summarize any failures.”

  • “Retrieve the metadata for the Account page layout.”

Setup

Installation and configuration

Examples for Claude Desktop and Claude Code. Replace the placeholder values with your own keys, and store secrets outside version control.

Claude Desktop: claude_desktop_config.json

{
    "mcpServers": {
        "Salesforce DX": {
            "command": "npx",
            "args": [
                "-y",
                "@salesforce/mcp",
                "--orgs",
                "DEFAULT_TARGET_ORG",
                "--toolsets",
                "orgs,metadata,data,users",
                "--tools",
                "run_apex_test",
                "--allow-non-ga-tools"
            ]
        }
    }
}

Claude Code: terminal

claude mcp add salesforce -- npx -y @salesforce/mcp --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,data,users
  • Hosted server: https://api.salesforce.com/platform/mcp/v1/platform/sobject-all (hosted, unverified from primary docs).
  • Local server: npm: @salesforce/mcp.
  • Needs: Orgs already authorized in the Salesforce CLI; --orgs is required. Hosted servers use an External Client App with OAuth and PKCE..

Security

Security considerations

  • Right user, right access

    Connect with a user whose CRM role fits the task, not an admin.

  • Start read-only

    Begin with lookups. Add create and update actions one at a time.

  • Customer data

    Use sandboxes for development, and limit production access.

  • Audit changes

    Review records changed through the assistant, especially in the first weeks.

Related servers

Servers that pair well with it

HubSpot

HubSpot's official hosted MCP server lets AI search and manage CRM records, query CRM data and work with marketing emails, pages and posts.

Zendesk

A community MCP server that lets AI read Zendesk tickets, comments and attachments, create tickets and add comments.

Slack

Slack's own hosted MCP server lets AI search messages, read channels and threads, look up people, draft or send messages and create canvases.

Keep exploring

FAQ

Questions people ask us

Have a question that is not here? Ask us directly.

Start a project

Want this connected to your own systems? We build AI workflows with MCP.

Send a short brief. We reply with questions, a suggested plan and an estimate you can compare with other offers.

Your privacy choices

We use necessary storage to run this site. With your permission we also use Google Analytics to see which pages help people, and load maps from Google. You can change this at any time. Read the cookie policy.