MCP Directory

Salesforce DX MCP Server

Official

Salesforce's official DX server: run SOQL, deploy and retrieve metadata, run Apex tests and manage orgs from your agent.

Unverified
stdio (local)
OAuth
TypeScript

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
npx -y @salesforce/mcp --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,data,users

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

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

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • Node.js 18+ with npx
  • Salesforce CLI installed and at least one org authorized (`sf org login web`)
  • A Salesforce DX project for metadata deploy/retrieve workflows

About Salesforce DX MCP Server

The server is an npx-launched TypeScript process over stdio. Its defining design choice is toolsets: with 60+ tools available, you pass --toolsets (e.g. orgs,metadata,data,users) plus optional individual --tools, and only those register with the client. Salesforce explicitly recommends against --toolsets all because the full catalog overwhelms LLM context; an experimental --dynamic-tools flag loads tools progressively instead.

The org access model is the standout. Orgs must be authorized on your machine first (sf org login web or the VS Code authorize command), and the server only touches orgs matching your --orgs value — a default org, a Dev Hub, named aliases, or everything via ALLOW_ALL_ORGS (documented as use-with-caution). MCP config files never contain secrets.

Beyond the core DX loop, most of the catalog is expert guidance packs: ~37 lwc-experts tools (component generation, SLDS blueprints, Lightning Data Service GraphQL helpers), 13 mobile tools wrapping native-capability TypeScript APIs, Aura-to-LWC migration orchestration, and 12 DevOps Center tools. Many of these return curated documentation and workflows rather than calling org APIs — useful, but different in character from action tools like deploy_metadata.

Trade-offs: you need working Salesforce CLI auth before anything runs, several org-lifecycle tools are still NON-GA behind --allow-non-ga-tools, and the guidance-heavy toolsets can crowd context if you enable them indiscriminately. Start narrow.

Tools & capabilities (89)

get_username

Resolve the right username/alias for an operation, handling default orgs and Dev Hubs

resume_tool_operation

Resume a long-running operation started by another tool

run_soql_query

Run a SOQL query against a Salesforce org

deploy_metadata

Deploy metadata from your DX project to an org

retrieve_metadata

Retrieve metadata from an org into your DX project

list_all_orgs

List all locally-configured orgs, optionally checking connection status

create_scratch_org

Create a scratch org (NON-GA)

create_org_snapshot

Create a scratch org snapshot (NON-GA)

delete_org

Delete a locally-authorized scratch org or sandbox (NON-GA)

open_org

Open an org in the browser (NON-GA)

run_apex_test

Execute Apex tests in an org

run_agent_test

Execute Agentforce agent tests in an org

assign_permission_set

Assign a permission set to a user

run_code_analyzer

Run Salesforce Code Analyzer static analysis for best practices, security, and performance issues

query_code_analyzer_results

Filter and summarize a Code Analyzer results file by severity, tag, engine, rule, or file

list_code_analyzer_rules

List Code Analyzer rules matching given criteria

describe_code_analyzer_rule

Get the description of a specific Code Analyzer rule

create-custom-rule

Create a custom XPath-based PMD rule from an Apex sample (NON-GA)

generate_xpath_prompt

Build the AST-context prompt used when authoring custom XPath rules (NON-GA)

list_devops_center_projects

List DevOps Center projects in an org

list_devops_center_work_items

List work items for a DevOps Center project

create_devops_center_work_item

Create a new DevOps Center work item

checkout_devops_center_work_item

Check out the branch for a work item

commit_devops_center_work_item

Commit project changes and register the SHA in DevOps Center

check_devops_center_commit_status

Check the commit status of a work item

create_devops_center_pull_request

Commit local changes to a work item's feature branch

update_devops_center_work_item_status

Set a work item to In Progress or Ready to Promote

promote_devops_center_work_item

Promote an approved work item to the next pipeline stage

detect_devops_center_merge_conflict

Detect merge conflicts for a work item or source branch

resolve_devops_center_merge_conflict

Apply a chosen resolution method to a merge conflict

resolve_devops_center_deployment_failure

Diagnose and resolve deployment failures

enrich_metadata

Enrich metadata components in your DX project (NON-GA)

scan_apex_class_for_antipatterns

Analyze Apex classes for performance antipatterns with fix recommendations

validate_and_optimize

Return a validation runbook that runs accessibility/security/best-practice validators and produces SARIF issues

score_issues

Compute a 0-100 readiness score and quality grade from SARIF issues

create_lwc_component_from_prd

Create complete LWC components from PRD specifications

create_lwc_jest_tests

Generate Jest test suites for LWC components

review_lwc_jest_tests

Review and validate LWC Jest test implementations

create_lightning_type

Guidance for creating Custom Lightning Types

guide_lwc_development

LWC development workflow and implementation guidelines

guide_lwc_best_practices

LWC coding standards and best practices

guide_component_accessibility

Accessibility guidelines and testing instructions for LWC

guide_design_general

SLDS design guidance for LWC with responsive and accessibility patterns

guide_lwc_rtl_support

Right-to-left internationalization guidance

guide_lws_security

Lightning Web Security analysis guidance

guide_slds_blueprints

SLDS blueprints guidelines and full blueprint index (NON-GA)

explore_slds_blueprints

Retrieve SLDS blueprint specs by name, category, component, class, or styling hook (NON-GA)

guide_slds_styling

SLDS styling-hooks guidance and reference (NON-GA)

explore_slds_styling

Search SLDS styling hooks with exact, fuzzy, prefix, and wildcard matching (NON-GA)

guide_utam_generation

UTAM page-object generation guidelines (NON-GA)

guide_lbc_usage

Index of Lightning Base Components with use-case descriptions

explore_lbc_components

Full API docs for named Lightning Base Components

lwc-doc-error

Look up LWC error messages with resolution guidance by error code

reference_lwc_compilation_error

Match LWC compilation errors against documented patterns, causes, and fixes

orchestrate_lds_data_requirements

Step-by-step analysis of LDS data requirements into PRD-ready specs

guide_lds_development

Lightning Data Service development guidelines

guide_lds_graphql

LDS GraphQL usage patterns

guide_lds_data_consistency

Data-consistency patterns for LDS components

guide_lds_referential_integrity

Referential-integrity patterns for LDS data

create_lds_graphql_read_query

Create GraphQL read queries for LDS

create_lds_graphql_mutation_query

Guidance for GraphQL mutation queries

fetch_lds_graphql_schema

Fetch the GraphQL schema structure for LDS

test_lds_graphql_query

Test a GraphQL query against a connected org (sub-tool of the query creators)

explore_lds_uiapi

Explore Lightning UI API capabilities

guide_figma_to_lwc_conversion

Convert Figma designs to LWC component specifications

guide_lo_migration

Convert a Lightning Out (beta) app to Lightning Out 2.0

run_lwc_accessibility_jest_tests

Accessibility testing utilities and Jest integration for LWC

verify_aura_migration_completeness

Aura-to-LWC migration completeness checklist

orchestrate_lwc_component_creation

End-to-end guidance for LWC component creation

orchestrate_lwc_component_optimization

Performance optimization workflow for LWC components

orchestrate_lwc_component_testing

Comprehensive LWC testing workflow and test generation

orchestrate_lwc_slds2_uplift

Migration guidance for upgrading to SLDS 2 (NON-GA)

create_aura_blueprint_draft

Create a PRD blueprint for Aura-to-LWC migration from Aura component files

enhance_aura_blueprint_draft

Enhance a draft migration PRD with expert analysis and dependency resolution

orchestrate_aura_migration

Orchestrate the complete Aura-to-LWC migration workflow

transition_prd_to_lwc

Turn an enhanced PRD into concrete LWC implementation guidance

create_mobile_lwc_barcode_scanner

TypeScript API docs and guidance for the LWC Barcode Scanner service

create_mobile_lwc_biometrics

Guidance for implementing biometric authentication in LWC

create_mobile_lwc_location

Guidance for LWC Location Service integration

create_mobile_lwc_contacts

Guidance for LWC Contacts Service integration

create_mobile_lwc_calendar

Guidance for LWC Calendar Service integration

create_mobile_lwc_nfc

Guidance for LWC NFC Service integration

create_mobile_lwc_payments

Guidance for LWC Payments Service integration

create_mobile_lwc_geofencing

Guidance for LWC Geofencing Service integration

create_mobile_lwc_document_scanner

Guidance for LWC Document Scanner integration

create_mobile_lwc_ar_space_capture

Guidance for LWC AR Space Capture integration

create_mobile_lwc_app_review

Guidance for the LWC App Review Service

get_mobile_lwc_offline_analysis

Analyze LWC components for mobile-offline compatibility issues

get_mobile_lwc_offline_guidance

Structured review instructions for mobile-offline code violations

What this server can do

Salesforce DX MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Run SOQL against a sandbox and have the agent summarize or reshape the results
  • Deploy metadata changes from a DX project, then run the affected Apex tests — all in one conversation
  • Static-analysis review: run Code Analyzer on changed code and explain the violations
  • Migrate Aura components to LWC using the guided blueprint and migration tools

Quick setup

  1. 1Authorize an org locally: `sf org login web` (or the VS Code "SFDX: Authorize an Org" command)
  2. 2Add the config to your client (`.mcp.json` for Claude Code, `.vscode/mcp.json` for VS Code) with `--orgs` and `--toolsets`
  3. 3Pick minimal toolsets for your work — e.g. `orgs,data,metadata,testing` — instead of `all`
  4. 4Restart the client and smoke-test with "list my authorized orgs"

Security notes

No credentials live in the config — the server reuses orgs you've already authorized through the Salesforce CLI, restricted to the --orgs allowlist you set (avoid ALLOW_ALL_ORGS). Telemetry is on by default (--no-telemetry disables it), and pre-GA tools stay off unless you explicitly pass --allow-non-ga-tools.

Salesforce DX MCP Server FAQ

Is the Salesforce DX MCP Server safe to point at production orgs?

The access model is conservative — only locally pre-authorized orgs on your --orgs allowlist are reachable, and no secrets are stored in config. But tools like deploy_metadata and delete_org write to orgs, so the sane default is scratch orgs and sandboxes, with production access left off the allowlist.

Do I need the Salesforce CLI installed?

Effectively yes. The server piggybacks on Salesforce CLI authentication, so each org must be authorized with `sf org login web` (or the VS Code equivalent) before the MCP server can use it.

Which toolsets should I enable?

Start with `orgs,data,metadata,testing` for a typical dev loop and add `code-analysis` or `devops` when needed. Salesforce recommends against `all` — the 60+ tool catalog eats context. Individual tools can be cherry-picked with --tools.

Alternatives to Salesforce DX MCP Server

Compare all alternatives →

Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).

Featured
Verified
stdio (local)
No auth
TypeScript
12 tools
Updated 26 days agoRepo

Up-to-date, version-specific library documentation injected into your coding agent.

Verified
stdio (local)
API key
TypeScript
2 tools
Updated 1 month agoRepo

Pack any local or remote repository into one AI-ready file your agent can grep and read incrementally.

Unverified
stdio (local)
No auth
TypeScript
6 tools
Updated 5 hours agoRepo