Salesforce MCP server
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
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": [
"-y",
"@salesforce/mcp",
"--orgs",
"DEFAULT_TARGET_ORG",
"--toolsets",
"orgs,metadata,data,users"
]
}
}
}claude mcp add salesforce -- npx -y @salesforce/mcp --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,data,usersAvailable tools
| Tool | Description |
|---|---|
| get_username | Determines the appropriate username or alias for Salesforce operations, handling default orgs and Dev Hubs. |
| resume_tool_operation | Resumes a long-running operation that wasn't completed by another tool. |
| run_soql_query | Runs a SOQL query against a Salesforce org. |
| deploy_metadata | Deploys metadata from your DX project to an org. |
| retrieve_metadata | Retrieves metadata from your org to your DX project. |
| create_org_snapshot | Creates a scratch org snapshot. |
| create_scratch_org | Creates a scratch org. |
| delete_org | Deletes a locally-authorized Salesforce scratch org or sandbox. |
| list_all_orgs | Lists all configured Salesforce orgs, with optional connection status checking. |
| open_org | Opens an org in a browser. |
| assign_permission_set | Assigns a permission set to the user or on behalf of another user. |
| run_agent_test | Executes agent tests in your org. |
| run_apex_test | Executes Apex tests in your org. |
| create-custom-rule | Creates a custom XPath-based PMD rule from a provided Apex code sample. |
| describe_code_analyzer_rule | Gets the description of a Code Analyzer rule. |
| generate_xpath_prompt | Builds the prompt that guides XPath authoring from AST context for custom PMD rules. |
| list_code_analyzer_rules | Selects Code Analyzer rules based on a number of criteria. |
| query_code_analyzer_results | Queries a Code Analyzer results JSON file and returns filtered violations. |
| run_code_analyzer | Performs static analysis against code for best practices, security, and performance issues. |
| check_devops_center_commit_status | Checks the current status of a work item committed to DevOps Center. |
| checkout_devops_center_work_item | Checks out the branch associated with a selected work item by name. |
| commit_devops_center_work_item | Commits SFDX project changes and registers the commit SHA in DevOps Center. |
| create_devops_center_pull_request | Commits local changes to a DevOps Center work item's feature branch. |
| detect_devops_center_merge_conflict | Detects merge conflicts for a selected work item or source branch. |
| list_devops_center_projects | Lists all DevOps Center projects in a specific org. |
| list_devops_center_work_items | Lists all the work items for a specific DevOps Center project. |
| create_devops_center_work_item | Creates a new DevOps Center work item in the selected project. |
| update_devops_center_work_item_status | Sets a work item's status to In Progress or Ready to Promote. |
| promote_devops_center_work_item | Promotes an approved work item to the next stage in the DevOps Center pipeline. |
| resolve_devops_center_deployment_failure | Diagnoses and resolves deployment failures. |
| resolve_devops_center_merge_conflict | Applies a selected resolution method to a merge conflict. |
| enrich_metadata | Enriches metadata from your org in your DX project. |
| create_aura_blueprint_draft | Creates a PRD blueprint for Aura component migration to LWC. |
| enhance_aura_blueprint_draft | Enhances a draft PRD with expert Aura analysis and unknown resolution. |
| orchestrate_aura_migration | Orchestrates the complete Aura-to-LWC migration workflow end to end. |
| transition_prd_to_lwc | Provides migration bridge guidance for creating LWC components from Aura specifications. |
| create_lwc_component_from_prd | Creates complete LWC components from PRD specifications with best practices. |
| create_lwc_jest_tests | Generates Jest test suites for LWC components with coverage and mocking. |
| review_lwc_jest_tests | Reviews and validates Jest test implementations for LWC components. |
| create_lightning_type | Provides guidance for creating Custom Lightning Types for Salesforce apps and components. |
| explore_slds_blueprints | Retrieves SLDS blueprint specifications by name, category, component, CSS class, or styling hook. |
| guide_design_general | Provides SLDS guidelines and best practices for LWC accessibility, responsive design, and usage. |
| guide_component_accessibility | Provides accessibility guidelines and testing instructions for LWC components. |
| guide_lwc_best_practices | Offers LWC development best practices and coding standards guidance. |
| guide_lwc_development | Provides LWC development workflow and implementation guidelines. |
| guide_lwc_rtl_support | Provides right-to-left internationalization support and RTL development guidance. |
| guide_lws_security | Provides security analysis per product and Lightning Web Security guidelines. |
| guide_slds_blueprints | Provides comprehensive SLDS blueprints guidelines and a complete index by category. |
| guide_utam_generation | Provides UI Test Automation Model (UTAM) page object generation guidelines and best practices. |
| lwc-doc-error | Retrieves information and static guidance for resolving LWC error messages by error code. |
| reference_lwc_compilation_error | References LWC compilation errors against a knowledge base of patterns, causes, and fixes. |
| guide_slds_styling | Retrieves SLDS styling hooks guidance and reference documentation. |
| explore_slds_styling | Searches and explores SLDS styling hooks with exact, fuzzy, prefix, and wildcard matching. |
| guide_lbc_usage | Provides an index of available Lightning Base Components with short descriptions. |
| explore_lbc_components | Returns full API documentation for a list of Lightning Base Component names. |
| create_lds_graphql_mutation_query | Provides guidance for creating GraphQL mutation queries for Lightning Data Service. |
| create_lds_graphql_read_query | Creates GraphQL read queries for Lightning Data Service. |
| explore_lds_uiapi | Explores and documents Lightning Design System UI API capabilities. |
| fetch_lds_graphql_schema | Fetches the GraphQL schema structure for Lightning Data Service. |
| guide_lds_data_consistency | Provides data consistency patterns and best practices for LDS components. |
| guide_lds_development | Provides LDS development guidelines and component integration guidance. |
| guide_lds_graphql | Provides LDS GraphQL usage patterns and guidelines. |
| guide_lds_referential_integrity | Provides referential integrity patterns for LDS data management. |
| orchestrate_lds_data_requirements | Provides step-by-step guidance for clarifying LDS data requirements into PRD-ready specs. |
| test_lds_graphql_query | Tests a GraphQL query against a connected org and returns the result. |
| guide_figma_to_lwc_conversion | Converts Figma designs to LWC component specifications. |
| guide_lo_migration | Provides guidance to convert a Lightning Out (beta) app into a Lightning Out 2.0 app. |
| run_lwc_accessibility_jest_tests | Provides accessibility testing utilities and Jest integration for LWC components. |
| verify_aura_migration_completeness | Provides an Aura-to-LWC migration completeness checklist and validation. |
| orchestrate_lwc_component_creation | Provides guidance for the entire Aura-to-LWC migration process. |
| orchestrate_lwc_component_optimization | Provides performance optimization and best practices for LWC components. |
| orchestrate_lwc_component_testing | Provides a comprehensive testing workflow and test generation guidance. |
| orchestrate_lwc_slds2_uplift | Provides migration guidance for upgrading to SLDS 2. |
| validate_and_optimize | Returns a validation runbook to run accessibility, security, and best-practice validators and score results. |
| score_issues | Computes a readiness score and quality grade from SARIF issues. |
| scan_apex_class_for_antipatterns | Analyzes Apex class files for performance antipatterns and recommends fixes. |
| create_mobile_lwc_app_review | Provides TypeScript API documentation for the LWC App Review Service. |
| create_mobile_lwc_ar_space_capture | Provides TypeScript API documentation for LWC AR Space Capture. |
| create_mobile_lwc_barcode_scanner | Provides TypeScript API documentation for the LWC Barcode Scanner. |
| create_mobile_lwc_biometrics | Provides TypeScript API documentation for the LWC Biometrics Service. |
| create_mobile_lwc_calendar | Provides TypeScript API documentation for the LWC Calendar Service. |
| create_mobile_lwc_contacts | Provides TypeScript API documentation for the LWC Contacts Service. |
| create_mobile_lwc_document_scanner | Provides TypeScript API documentation for the LWC Document Scanner. |
| create_mobile_lwc_geofencing | Provides TypeScript API documentation for the LWC Geofencing Service. |
| create_mobile_lwc_location | Provides TypeScript API documentation for the LWC Location Service. |
| create_mobile_lwc_nfc | Provides TypeScript API documentation for the LWC NFC Service. |
| create_mobile_lwc_payments | Provides TypeScript API documentation for the LWC Payments Service. |
| get_mobile_lwc_offline_analysis | Analyzes LWC components for mobile offline compatibility and performance issues. |
| get_mobile_lwc_offline_guidance | Provides 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.