Salesforce MCP server

OfficialSalesforce412Config last verified Jun 1, 2026

Salesforce's official DX MCP server: query org data with SOQL, deploy and retrieve metadata, manage orgs, run tests, and build LWC from your agent.

The Salesforce DX MCP Server is Salesforce's official, security-first integration that lets an AI agent operate against Salesforce orgs you have locally authorized with the Salesforce CLI. It is organized into toolsets you opt into with the --toolsets flag, so you expose only the tools you need and keep the LLM context small. Core tools resolve the right username and resume long-running operations; the data toolset runs SOQL queries; the metadata toolset deploys and retrieves metadata between your DX project and an org; the orgs toolset lists, opens, creates, snapshots, and deletes scratch orgs; the users toolset assigns permission sets; and the testing toolset runs Apex and agent tests.

Beyond org operations it ships deep developer-experience toolsets: Code Analyzer (run static analysis, list and describe rules, query results, author custom rules), DevOps Center (check out, commit, and promote work items, open pull requests, and resolve merge conflicts), and an extensive Lightning Web Components experts suite for component generation, Jest tests, SLDS and accessibility guidance, Lightning Data Service GraphQL, Figma-to-LWC conversion, and Aura-to-LWC migration. It runs locally over stdio via npx @salesforce/mcp; you must pass at least one authorized org to --orgs, and orgs are authorized out of band with the org login web CLI command rather than a token in the config.

Quick install

Copy-paste configs are provided for all 8 supported clients. Pick your client below.

Add to ~/.claude.json

~/.claude.json
json
{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": [
        "-y",
        "@salesforce/mcp",
        "--orgs",
        "DEFAULT_TARGET_ORG",
        "--toolsets",
        "orgs,metadata,data,users"
      ]
    }
  }
}
Or via CLI
bash
claude mcp add salesforce -- npx -y @salesforce/mcp --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,data,users

Available tools

ToolDescription
get_usernameDetermines the appropriate username or alias for Salesforce operations, handling default orgs and Dev Hubs.
resume_tool_operationResumes a long-running operation that wasn't completed by another tool.
run_soql_queryRuns a SOQL query against a Salesforce org.
deploy_metadataDeploys metadata from your DX project to an org.
retrieve_metadataRetrieves metadata from your org to your DX project.
create_org_snapshotCreates a scratch org snapshot.
create_scratch_orgCreates a scratch org.
delete_orgDeletes a locally-authorized Salesforce scratch org or sandbox.
list_all_orgsLists all configured Salesforce orgs, with optional connection status checking.
open_orgOpens an org in a browser.
assign_permission_setAssigns a permission set to the user or on behalf of another user.
run_agent_testExecutes agent tests in your org.
run_apex_testExecutes Apex tests in your org.
create-custom-ruleCreates a custom XPath-based PMD rule from a provided Apex code sample.
describe_code_analyzer_ruleGets the description of a Code Analyzer rule.
generate_xpath_promptBuilds the prompt that guides XPath authoring from AST context for custom PMD rules.
list_code_analyzer_rulesSelects Code Analyzer rules based on a number of criteria.
query_code_analyzer_resultsQueries a Code Analyzer results JSON file and returns filtered violations.
run_code_analyzerPerforms static analysis against code for best practices, security, and performance issues.
check_devops_center_commit_statusChecks the current status of a work item committed to DevOps Center.
checkout_devops_center_work_itemChecks out the branch associated with a selected work item by name.
commit_devops_center_work_itemCommits SFDX project changes and registers the commit SHA in DevOps Center.
create_devops_center_pull_requestCommits local changes to a DevOps Center work item's feature branch.
detect_devops_center_merge_conflictDetects merge conflicts for a selected work item or source branch.
list_devops_center_projectsLists all DevOps Center projects in a specific org.
list_devops_center_work_itemsLists all the work items for a specific DevOps Center project.
create_devops_center_work_itemCreates a new DevOps Center work item in the selected project.
update_devops_center_work_item_statusSets a work item's status to In Progress or Ready to Promote.
promote_devops_center_work_itemPromotes an approved work item to the next stage in the DevOps Center pipeline.
resolve_devops_center_deployment_failureDiagnoses and resolves deployment failures.
resolve_devops_center_merge_conflictApplies a selected resolution method to a merge conflict.
enrich_metadataEnriches metadata from your org in your DX project.
create_aura_blueprint_draftCreates a PRD blueprint for Aura component migration to LWC.
enhance_aura_blueprint_draftEnhances a draft PRD with expert Aura analysis and unknown resolution.
orchestrate_aura_migrationOrchestrates the complete Aura-to-LWC migration workflow end to end.
transition_prd_to_lwcProvides migration bridge guidance for creating LWC components from Aura specifications.
create_lwc_component_from_prdCreates complete LWC components from PRD specifications with best practices.
create_lwc_jest_testsGenerates Jest test suites for LWC components with coverage and mocking.
review_lwc_jest_testsReviews and validates Jest test implementations for LWC components.
create_lightning_typeProvides guidance for creating Custom Lightning Types for Salesforce apps and components.
explore_slds_blueprintsRetrieves SLDS blueprint specifications by name, category, component, CSS class, or styling hook.
guide_design_generalProvides SLDS guidelines and best practices for LWC accessibility, responsive design, and usage.
guide_component_accessibilityProvides accessibility guidelines and testing instructions for LWC components.
guide_lwc_best_practicesOffers LWC development best practices and coding standards guidance.
guide_lwc_developmentProvides LWC development workflow and implementation guidelines.
guide_lwc_rtl_supportProvides right-to-left internationalization support and RTL development guidance.
guide_lws_securityProvides security analysis per product and Lightning Web Security guidelines.
guide_slds_blueprintsProvides comprehensive SLDS blueprints guidelines and a complete index by category.
guide_utam_generationProvides UI Test Automation Model (UTAM) page object generation guidelines and best practices.
lwc-doc-errorRetrieves information and static guidance for resolving LWC error messages by error code.
reference_lwc_compilation_errorReferences LWC compilation errors against a knowledge base of patterns, causes, and fixes.
guide_slds_stylingRetrieves SLDS styling hooks guidance and reference documentation.
explore_slds_stylingSearches and explores SLDS styling hooks with exact, fuzzy, prefix, and wildcard matching.
guide_lbc_usageProvides an index of available Lightning Base Components with short descriptions.
explore_lbc_componentsReturns full API documentation for a list of Lightning Base Component names.
create_lds_graphql_mutation_queryProvides guidance for creating GraphQL mutation queries for Lightning Data Service.
create_lds_graphql_read_queryCreates GraphQL read queries for Lightning Data Service.
explore_lds_uiapiExplores and documents Lightning Design System UI API capabilities.
fetch_lds_graphql_schemaFetches the GraphQL schema structure for Lightning Data Service.
guide_lds_data_consistencyProvides data consistency patterns and best practices for LDS components.
guide_lds_developmentProvides LDS development guidelines and component integration guidance.
guide_lds_graphqlProvides LDS GraphQL usage patterns and guidelines.
guide_lds_referential_integrityProvides referential integrity patterns for LDS data management.
orchestrate_lds_data_requirementsProvides step-by-step guidance for clarifying LDS data requirements into PRD-ready specs.
test_lds_graphql_queryTests a GraphQL query against a connected org and returns the result.
guide_figma_to_lwc_conversionConverts Figma designs to LWC component specifications.
guide_lo_migrationProvides guidance to convert a Lightning Out (beta) app into a Lightning Out 2.0 app.
run_lwc_accessibility_jest_testsProvides accessibility testing utilities and Jest integration for LWC components.
verify_aura_migration_completenessProvides an Aura-to-LWC migration completeness checklist and validation.
orchestrate_lwc_component_creationProvides guidance for the entire Aura-to-LWC migration process.
orchestrate_lwc_component_optimizationProvides performance optimization and best practices for LWC components.
orchestrate_lwc_component_testingProvides a comprehensive testing workflow and test generation guidance.
orchestrate_lwc_slds2_upliftProvides migration guidance for upgrading to SLDS 2.
validate_and_optimizeReturns a validation runbook to run accessibility, security, and best-practice validators and score results.
score_issuesComputes a readiness score and quality grade from SARIF issues.
scan_apex_class_for_antipatternsAnalyzes Apex class files for performance antipatterns and recommends fixes.
create_mobile_lwc_app_reviewProvides TypeScript API documentation for the LWC App Review Service.
create_mobile_lwc_ar_space_captureProvides TypeScript API documentation for LWC AR Space Capture.
create_mobile_lwc_barcode_scannerProvides TypeScript API documentation for the LWC Barcode Scanner.
create_mobile_lwc_biometricsProvides TypeScript API documentation for the LWC Biometrics Service.
create_mobile_lwc_calendarProvides TypeScript API documentation for the LWC Calendar Service.
create_mobile_lwc_contactsProvides TypeScript API documentation for the LWC Contacts Service.
create_mobile_lwc_document_scannerProvides TypeScript API documentation for the LWC Document Scanner.
create_mobile_lwc_geofencingProvides TypeScript API documentation for the LWC Geofencing Service.
create_mobile_lwc_locationProvides TypeScript API documentation for the LWC Location Service.
create_mobile_lwc_nfcProvides TypeScript API documentation for the LWC NFC Service.
create_mobile_lwc_paymentsProvides TypeScript API documentation for the LWC Payments Service.
get_mobile_lwc_offline_analysisAnalyzes LWC components for mobile offline compatibility and performance issues.
get_mobile_lwc_offline_guidanceProvides review instructions to detect and remediate mobile offline code violations in LWC.

What you can do with it

Query and report on org data

The agent runs a SOQL query against an authorized org to answer a pipeline or data question, resolving the right username automatically and returning structured results without anyone opening Salesforce.

Deploy a change and run the tests

Ask the agent to deploy metadata from your DX project to a scratch org, run the relevant Apex tests, and report failures, closing the inner-loop development cycle from the editor.

FAQ

Is it free?
Yes. The DX MCP Server is free and open source under the salesforcecli organization; you only need a Salesforce org and the Salesforce CLI to authorize it locally.
Does it support remote/OAuth?
The DX MCP Server runs locally over stdio via npx and acts on orgs you authorize with the Salesforce CLI (org login web) rather than a token in the config. Salesforce also offers separate Hosted MCP Servers for OAuth-based access when you don't want to install the CLI.
Why do I need the --orgs flag?
Every tool acts against an org, so you must pass at least one authorized org to --orgs (for example DEFAULT_TARGET_ORG). The server only touches orgs you have explicitly authorized on your machine.
How do I keep the tool set manageable?
Use the --toolsets flag to enable only the groups you need (such as orgs, metadata, data, users); the server ships over 60 tools, so enabling all of them at once can overwhelm the model's context.
← Browse all crm servers