Salesforce DX MCP Server

How Salesforce's local DX MCP Server supports metadata retrieval, testing and DevOps workflows, and the controls we put around it.

Type
Solution
Topic
MCP
Reading time
5 min
Updated
Author
GeekMidst Team
Reviewed by
Site owner
Banner for the GeekMidst solution “Salesforce DX MCP Server”, covering The business use case and What Salesforce offers

Developers already use AI coding assistants; the Salesforce DX MCP Server lets those assistants retrieve metadata, run tests and work with DevOps Center through tools rather than guesswork. It runs on the developer's machine with the developer's authorised orgs, which is powerful and needs firm limits. This page explains what Salesforce provides and how we would set it up.

The business use case

  • Metadata retrieval: pull the components a change touches so the assistant works from the real org, not from memory.
  • Documentation and code analysis: explain existing Apex, LWC or Flow metadata and flag issues.
  • Testing: run Apex and agent tests while iterating.
  • DevOps workflows: prepare commits and promotions with a person approving each step.

What Salesforce offers

  • Publisher: Salesforce (salesforcecli organisation), open source under Apache-2.0, npm package @salesforce/mcp.
  • Runs locally: launched with npx as a local process; it uses orgs already authorised with the Salesforce CLI (org login web).
  • The --orgs flag is required: DEFAULT_TARGET_ORG, DEFAULT_TARGET_DEV_HUB, ALLOW_ALL_ORGS or a specific alias.
  • Toolsets: core (always on), orgs, metadata, data, testing, users, code-analysis, lwc-experts, aura-experts, mobile, mobile-core, devops, experts-validation, enrichment, scale-products, and all (60+ tools).
  • Non-GA tools such as create_scratch_org and delete_org need --allow-non-ga-tools.

Status

Salesforce called it a Developer Preview on 23 June 2025, and the Spring '26 (API 66.0) Developer Guide labels it "Salesforce DX MCP Server and Tools (Beta)". The current 264.0 page shows no Beta, Pilot or Developer Preview label and tracks maturity per tool (GA or NON-GA). We found no GA announcement for the whole server, so whole-server GA is status not confirmed.

Vendor server first

The server is Salesforce's, and we use it as published. We would only propose a GeekMidst wrapper for gaps, such as a pipeline step that requires a recorded approval before a deploy, and none exists today. The settings below are a proposed design; we validate the APIs, edition and permissions for each implementation.

Proposed tool policy

Tool or toolsetPurposeRead/writeApproval needed
retrieve_metadataPull components from a sandbox into the local projectReads the org, writes local filesNo
run_soql_queryQuery sandbox data while debuggingReadNo; sandbox only
code-analysis toolsetAnalyse code for issuesReadNo
run_apex_test, run_agent_testRun tests in a sandboxExecutes in the orgNo in a sandbox; never against production
deploy_metadataDeploy to an orgWriteYes, a named reviewer, and never to production from the AI client
assign_permission_setChange user accessWriteYes, admin approval
DevOps Center commit and promoteMove work through the pipelineWriteYes, release manager
create_scratch_org (non-GA)Create a scratch orgWriteDeveloper's choice; non-GA flag off by default
delete_org (non-GA)Delete an orgWrite, destructiveNot enabled

Authentication and access control

The server uses the developer's Salesforce CLI authorisations, so whatever orgs that CLI can reach, the AI client can potentially reach. Our rules:

  • Name one org. Pass --orgs with a specific sandbox or scratch org alias; do not use ALLOW_ALL_ORGS.
  • No production credentials in an AI client without controls. Do not authorise production in the CLI profile the assistant uses; production changes go through your pipeline and its approvals.
  • Enable only needed toolsets, for example metadata, testing and code-analysis, rather than all.
  • Leave --allow-non-ga-tools off except in a throwaway scratch environment.
  • Secrets: Salesforce notes that the CLI no longer prints secrets, and the SF_TEMP_SHOW_SECRETS workaround ends on 28 October 2026. Do not work around it.

The server runs as a local process (its repository does not name the transport), and the MCP specification says local stdio servers take credentials from the environment rather than an OAuth flow, so the developer machine itself is the trust boundary.

Approvals for write actions

Deploys, permission changes and DevOps Center promotions need a named person's approval. Simplest: the AI prepares the change locally, and the deploy runs from your pipeline after review. See Salesforce deployment strategies.

Privacy, limits and auditability

Sandboxes can hold copies of production data; use masked or seeded data where you can, and check with your legal adviser on the rules that apply to you. API limits of the target org still apply; check Salesforce's limits. Org-side activity is attributed to the authorised user; keep pipeline logs for every deploy.

Errors, environments and testing

A failed deploy or test returns an error to the assistant. Treat it as information, not permission to retry with broader settings. Pilot with two or three developers on scratch orgs, review what the assistant attempted, then widen. Release patterns are in CI/CD and release management.

Licensing and dependencies

The server is open source under Apache-2.0; the orgs, DevOps Center and any Agentforce testing features follow your Salesforce licences. Winter '27 materials refer to DevOps Center as "Lifecycle Center (formerly DevOps Center)".

Available today vs proposed

ItemStatus
Salesforce DX MCP ServerPer-tool GA or NON-GA; whole-server GA not confirmed
GeekMidst toolset and approval policyProposed design

Questions we hear

Is the Salesforce DX MCP Server generally available?
Salesforce tracks maturity per tool, GA or NON-GA. We found no GA announcement for the whole server, so we treat whole-server GA as not confirmed.
Can it deploy to production?
It can deploy to any org the CLI has authorised and the --orgs flag allows. Our rule is that production is never authorised for the AI client; production deploys go through your pipeline.
What does --allow-non-ga-tools do?
It enables tools Salesforce marks NON-GA, such as create_scratch_org and delete_org. We keep it off outside throwaway environments.
Do we need the Salesforce CLI?
Yes. The server uses orgs already authorised with the Salesforce CLI.

Set up AI-assisted Salesforce development safely

Tell us how your team builds and releases today. We can configure toolsets, org access and approvals for a pilot.

Book a consultation →

Tell us what you are trying to fix.

Share your Salesforce setup, goals and constraints. A practitioner reads every message and replies with questions, first thoughts or an honest view of whether you need outside help at all.

Talk to a Salesforce Expert
Book a Consultation