# Salesforce DX MCP (MCP Server)

> Salesforce developer tools: deploy metadata, run SOQL and Apex tests

- Type: MCP server
- Publisher: Salesforce (official)
- Categories: Development, Sales & CRM
- Website: https://github.com/salesforcecli/mcp
- Source: https://github.com/salesforcecli/mcp
- Transport: stdio
- Launch command: npx -y @salesforce/mcp --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,data,users
- Sign-in: oauth
- GitHub stars: 483
- Listed: 2025-06-01

## About

The official Salesforce DX MCP server brings Salesforce CLI capabilities to AI coding assistants, including org management, metadata deploy and retrieve, SOQL queries, Apex tests, LWC development, and code analysis. Toolsets are enabled with flags and it uses orgs authorized in the Salesforce CLI.

## Install

1. **Add the server to Codex**

   Codex CLI:

   ```bash
   codex mcp add salesforce-dx -- npx -y @salesforce/mcp --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,data,users
   ```

   config.toml:

   ```toml
   [mcp_servers.salesforce-dx]
   command = "npx"
   args = ["-y", "@salesforce/mcp", "--orgs", "DEFAULT_TARGET_ORG", "--toolsets", "orgs,metadata,data,users"]
   ```

   Agents SDK:

   ```python
   from agents import Agent, Runner
   from agents.mcp import MCPServerStdio
   
   async with MCPServerStdio(
       name="Salesforce DX MCP",
       params={"command": "npx", "args": ["-y", "@salesforce/mcp", "--orgs", "DEFAULT_TARGET_ORG", "--toolsets", "orgs,metadata,data,users"]},
   ) as server:
       agent = Agent(name="Assistant", mcp_servers=[server])
       result = await Runner.run(agent, "Deploy the changes in force-app to my default org")
       print(result.final_output)
   ```

## Tools

- `run_soql_query`
- `deploy_metadata`
- `retrieve_metadata`
- `run_apex_test`
- `run_code_analyzer`
- `create_lwc_component_from_prd`

## Example prompts

- "Deploy the changes in force-app to my default org"
- "Run the Apex tests in AccountServiceTest"
- "Query the 10 most recently created Accounts with SOQL"
- "Scaffold an LWC component from this spec"

## Also available as

- app: [Salesforce](https://chatgptplugins.directory/apps/salesforce.md)

## Related

- [Chrome DevTools MCP](https://chatgptplugins.directory/mcp/chrome-devtools.md): Let coding agents control and debug a live Chrome browser
- [Playwright MCP](https://chatgptplugins.directory/mcp/playwright.md): Browser automation for agents via Playwright accessibility snapshots
- [GitHub](https://chatgptplugins.directory/mcp/github.md): Manage repos, issues, pull requests and Actions from your AI agent
- [Context7](https://chatgptplugins.directory/mcp/context7.md): Pull up-to-date, version-specific library docs into your coding agent
- [Supabase](https://chatgptplugins.directory/mcp/supabase.md): Manage Supabase databases, migrations, edge functions and logs
- [Stripe](https://chatgptplugins.directory/mcp/stripe.md): Query and act on your Stripe account and search Stripe docs from any agent

---
Source: https://chatgptplugins.directory/mcp/salesforce-dx · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
