
Salesforce DX MCP Server
OfficialSalesforce's official DX server: run SOQL, deploy and retrieve metadata, run Apex tests and manage orgs from your agent.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npx -y @salesforce/mcp --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,data,usersPaste 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_usernameResolve the right username/alias for an operation, handling default orgs and Dev Hubs
resume_tool_operationResume a long-running operation started by another tool
run_soql_queryRun a SOQL query against a Salesforce org
deploy_metadataDeploy metadata from your DX project to an org
retrieve_metadataRetrieve metadata from an org into your DX project
list_all_orgsList all locally-configured orgs, optionally checking connection status
create_scratch_orgCreate a scratch org (NON-GA)
create_org_snapshotCreate a scratch org snapshot (NON-GA)
delete_orgDelete a locally-authorized scratch org or sandbox (NON-GA)
open_orgOpen an org in the browser (NON-GA)
run_apex_testExecute Apex tests in an org
run_agent_testExecute Agentforce agent tests in an org
assign_permission_setAssign a permission set to a user
run_code_analyzerRun Salesforce Code Analyzer static analysis for best practices, security, and performance issues
query_code_analyzer_resultsFilter and summarize a Code Analyzer results file by severity, tag, engine, rule, or file
list_code_analyzer_rulesList Code Analyzer rules matching given criteria
describe_code_analyzer_ruleGet the description of a specific Code Analyzer rule
create-custom-ruleCreate a custom XPath-based PMD rule from an Apex sample (NON-GA)
generate_xpath_promptBuild the AST-context prompt used when authoring custom XPath rules (NON-GA)
list_devops_center_projectsList DevOps Center projects in an org
list_devops_center_work_itemsList work items for a DevOps Center project
create_devops_center_work_itemCreate a new DevOps Center work item
checkout_devops_center_work_itemCheck out the branch for a work item
commit_devops_center_work_itemCommit project changes and register the SHA in DevOps Center
check_devops_center_commit_statusCheck the commit status of a work item
create_devops_center_pull_requestCommit local changes to a work item's feature branch
update_devops_center_work_item_statusSet a work item to In Progress or Ready to Promote
promote_devops_center_work_itemPromote an approved work item to the next pipeline stage
detect_devops_center_merge_conflictDetect merge conflicts for a work item or source branch
resolve_devops_center_merge_conflictApply a chosen resolution method to a merge conflict
resolve_devops_center_deployment_failureDiagnose and resolve deployment failures
enrich_metadataEnrich metadata components in your DX project (NON-GA)
scan_apex_class_for_antipatternsAnalyze Apex classes for performance antipatterns with fix recommendations
validate_and_optimizeReturn a validation runbook that runs accessibility/security/best-practice validators and produces SARIF issues
score_issuesCompute a 0-100 readiness score and quality grade from SARIF issues
create_lwc_component_from_prdCreate complete LWC components from PRD specifications
create_lwc_jest_testsGenerate Jest test suites for LWC components
review_lwc_jest_testsReview and validate LWC Jest test implementations
create_lightning_typeGuidance for creating Custom Lightning Types
guide_lwc_developmentLWC development workflow and implementation guidelines
guide_lwc_best_practicesLWC coding standards and best practices
guide_component_accessibilityAccessibility guidelines and testing instructions for LWC
guide_design_generalSLDS design guidance for LWC with responsive and accessibility patterns
guide_lwc_rtl_supportRight-to-left internationalization guidance
guide_lws_securityLightning Web Security analysis guidance
guide_slds_blueprintsSLDS blueprints guidelines and full blueprint index (NON-GA)
explore_slds_blueprintsRetrieve SLDS blueprint specs by name, category, component, class, or styling hook (NON-GA)
guide_slds_stylingSLDS styling-hooks guidance and reference (NON-GA)
explore_slds_stylingSearch SLDS styling hooks with exact, fuzzy, prefix, and wildcard matching (NON-GA)
guide_utam_generationUTAM page-object generation guidelines (NON-GA)
guide_lbc_usageIndex of Lightning Base Components with use-case descriptions
explore_lbc_componentsFull API docs for named Lightning Base Components
lwc-doc-errorLook up LWC error messages with resolution guidance by error code
reference_lwc_compilation_errorMatch LWC compilation errors against documented patterns, causes, and fixes
orchestrate_lds_data_requirementsStep-by-step analysis of LDS data requirements into PRD-ready specs
guide_lds_developmentLightning Data Service development guidelines
guide_lds_graphqlLDS GraphQL usage patterns
guide_lds_data_consistencyData-consistency patterns for LDS components
guide_lds_referential_integrityReferential-integrity patterns for LDS data
create_lds_graphql_read_queryCreate GraphQL read queries for LDS
create_lds_graphql_mutation_queryGuidance for GraphQL mutation queries
fetch_lds_graphql_schemaFetch the GraphQL schema structure for LDS
test_lds_graphql_queryTest a GraphQL query against a connected org (sub-tool of the query creators)
explore_lds_uiapiExplore Lightning UI API capabilities
guide_figma_to_lwc_conversionConvert Figma designs to LWC component specifications
guide_lo_migrationConvert a Lightning Out (beta) app to Lightning Out 2.0
run_lwc_accessibility_jest_testsAccessibility testing utilities and Jest integration for LWC
verify_aura_migration_completenessAura-to-LWC migration completeness checklist
orchestrate_lwc_component_creationEnd-to-end guidance for LWC component creation
orchestrate_lwc_component_optimizationPerformance optimization workflow for LWC components
orchestrate_lwc_component_testingComprehensive LWC testing workflow and test generation
orchestrate_lwc_slds2_upliftMigration guidance for upgrading to SLDS 2 (NON-GA)
create_aura_blueprint_draftCreate a PRD blueprint for Aura-to-LWC migration from Aura component files
enhance_aura_blueprint_draftEnhance a draft migration PRD with expert analysis and dependency resolution
orchestrate_aura_migrationOrchestrate the complete Aura-to-LWC migration workflow
transition_prd_to_lwcTurn an enhanced PRD into concrete LWC implementation guidance
create_mobile_lwc_barcode_scannerTypeScript API docs and guidance for the LWC Barcode Scanner service
create_mobile_lwc_biometricsGuidance for implementing biometric authentication in LWC
create_mobile_lwc_locationGuidance for LWC Location Service integration
create_mobile_lwc_contactsGuidance for LWC Contacts Service integration
create_mobile_lwc_calendarGuidance for LWC Calendar Service integration
create_mobile_lwc_nfcGuidance for LWC NFC Service integration
create_mobile_lwc_paymentsGuidance for LWC Payments Service integration
create_mobile_lwc_geofencingGuidance for LWC Geofencing Service integration
create_mobile_lwc_document_scannerGuidance for LWC Document Scanner integration
create_mobile_lwc_ar_space_captureGuidance for LWC AR Space Capture integration
create_mobile_lwc_app_reviewGuidance for the LWC App Review Service
get_mobile_lwc_offline_analysisAnalyze LWC components for mobile-offline compatibility issues
get_mobile_lwc_offline_guidanceStructured 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
- 1Authorize an org locally: `sf org login web` (or the VS Code "SFDX: Authorize an Org" command)
- 2Add the config to your client (`.mcp.json` for Claude Code, `.vscode/mcp.json` for VS Code) with `--orgs` and `--toolsets`
- 3Pick minimal toolsets for your work — e.g. `orgs,data,metadata,testing` — instead of `all`
- 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).
Up-to-date, version-specific library documentation injected into your coding agent.
Pack any local or remote repository into one AI-ready file your agent can grep and read incrementally.
Compare Salesforce DX MCP Server with: