Let your AI assistant query records, deploy metadata and run tests against your org — safely. A hands-on AI Projects Lab build.
You're mid-debug: a test class fails after a pull. The old loop — run tests in terminal, read the stack trace, open the class, query some records to check data, fix, redeploy — is five tools and twenty context switches. With the Salesforce DX MCP server, your AI assistant does that loop with you: "run ContactTriggerTest, show me the failure, and query the contacts it created" becomes one instruction.
For beginners: MCP (Model Context Protocol) is a standard that lets AI assistants call tools. The DX MCP server, open-sourced by Salesforce as @salesforce/mcp, exposes your familiar SFDX capabilities — org queries, deploys, test runs — as tools any MCP-capable assistant can use (Agentforce Vibes, Claude, Cursor, VS Code agent mode).
Requirements: Node.js 18+, Salesforce CLI authenticated to at least one org.
// MCP client config (e.g. .mcp.json in your project,
// or claude_desktop_config.json / VS Code settings)
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": [
"-y", "@salesforce/mcp",
"--orgs", "DEFAULT_TARGET_ORG",
"--toolsets", "all"
]
}
}
}
--orgs controls which authenticated orgs are exposed — e.g. DEFAULT_TARGET_ORG, a specific username, or an alias. The server can only touch orgs you list.--toolsets scopes capability: start narrower than all (e.g. data + testing) and widen when you trust the workflow.Account.OwnerId. The test data factory doesn't set an owner. Want me to look at the factory class?"The difference from copy-pasting into a chatbot: the assistant is working against your real org state, not its imagination.
Sources: Introducing MCP Support Across Salesforce · @salesforce/mcp on npm