Salesforce — Claude Code MCP server: what it does, how to install
Connects coding assistants to Salesforce CRM to search accounts, edit leads, and record opportunities directly from stdio hosts.
claude mcp add --env SALESFORCE_CLIENT_ID=<SALESFORCE_CLIENT_ID> --env SALESFORCE_CLIENT_SECRET=<SALESFORCE_CLIENT_SECRET> --env SALESFORCE_SANDBOX=<SALESFORCE_SANDBOX> --env SALESFORCE_ACCESS_TOKEN=<SALESFORCE_ACCESS_TOKEN> --env SALESFORCE_INSTANCE_URL=<SALESFORCE_INSTANCE_URL> --transport stdio salesforce -- npx -y @mindstone/mcp-server-salesforceWhat Salesforce does
The package exposes 37 tools connecting local MCP clients to the Salesforce API. Assistants can retrieve organization IDs, modify customer contacts, log sales opportunities, track tasks, and query custom CRM objects. All write operations remain visible in the host interface.
Running the server requires Node.js 20 or newer alongside npm. Authentication operates either through an OAuth flow with a local callback or via a static access token paired with your instance URL. Without a configured Salesforce Connected App, interactive OAuth login will fail immediately.
What it helps with
- locate account records by name and retrieve CRM identifiers
- create new sales opportunities tied to specific accounts
- convert incoming leads into active accounts and contacts
- schedule follow-up tasks linked to existing opportunities
Example prompts for the agent
- Find Acme Corp in Salesforce, create a Q3 expansion opportunity for 75000, and add a follow-up task
- List open leads and update the contact status for the newest entry
How to install Salesforce
Platform CLI
claude mcp add --env SALESFORCE_CLIENT_ID=<SALESFORCE_CLIENT_ID> --env SALESFORCE_CLIENT_SECRET=<SALESFORCE_CLIENT_SECRET> --env SALESFORCE_SANDBOX=<SALESFORCE_SANDBOX> --env SALESFORCE_ACCESS_TOKEN=<SALESFORCE_ACCESS_TOKEN> --env SALESFORCE_INSTANCE_URL=<SALESFORCE_INSTANCE_URL> --transport stdio salesforce -- npx -y @mindstone/mcp-server-salesforceReplace <…> with your own values. 3 more environment variables are in the server README
Platform CLI
codex mcp add salesforce --env SALESFORCE_CLIENT_ID=<SALESFORCE_CLIENT_ID> --env SALESFORCE_CLIENT_SECRET=<SALESFORCE_CLIENT_SECRET> --env SALESFORCE_SANDBOX=<SALESFORCE_SANDBOX> --env SALESFORCE_ACCESS_TOKEN=<SALESFORCE_ACCESS_TOKEN> --env SALESFORCE_INSTANCE_URL=<SALESFORCE_INSTANCE_URL> -- npx -y @mindstone/mcp-server-salesforceReplace <…> with your own values. 3 more environment variables are in the server README
Config file
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-salesforce"
],
"env": {
"SALESFORCE_CLIENT_ID": "<SALESFORCE_CLIENT_ID>",
"SALESFORCE_CLIENT_SECRET": "<SALESFORCE_CLIENT_SECRET>",
"SALESFORCE_SANDBOX": "<SALESFORCE_SANDBOX>",
"SALESFORCE_ACCESS_TOKEN": "<SALESFORCE_ACCESS_TOKEN>",
"SALESFORCE_INSTANCE_URL": "<SALESFORCE_INSTANCE_URL>"
}
}
}
}Replace <…> with your own values. 3 more environment variables are in the server README
Config file
{
"servers": {
"salesforce": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-salesforce"
],
"env": {
"SALESFORCE_CLIENT_ID": "<SALESFORCE_CLIENT_ID>",
"SALESFORCE_CLIENT_SECRET": "<SALESFORCE_CLIENT_SECRET>",
"SALESFORCE_SANDBOX": "<SALESFORCE_SANDBOX>",
"SALESFORCE_ACCESS_TOKEN": "<SALESFORCE_ACCESS_TOKEN>",
"SALESFORCE_INSTANCE_URL": "<SALESFORCE_INSTANCE_URL>"
}
}
}
}Replace <…> with your own values. 3 more environment variables are in the server README
Platform CLI
gemini mcp add -e SALESFORCE_CLIENT_ID=<SALESFORCE_CLIENT_ID> -e SALESFORCE_CLIENT_SECRET=<SALESFORCE_CLIENT_SECRET> -e SALESFORCE_SANDBOX=<SALESFORCE_SANDBOX> -e SALESFORCE_ACCESS_TOKEN=<SALESFORCE_ACCESS_TOKEN> -e SALESFORCE_INSTANCE_URL=<SALESFORCE_INSTANCE_URL> salesforce npx -y @mindstone/mcp-server-salesforceReplace <…> with your own values. 3 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Salesforce
How to install Salesforce in Claude Code?
Run `claude mcp add mcp-server-salesforce -e SALESFORCE_CLIENT_ID=<SALESFORCE_CLIENT_ID> -e SALESFORCE_CLIENT_SECRET=<SALESFORCE_CLIENT_SECRET> -e SALESFORCE_ACCESS_TOKEN=<SALESFORCE_ACCESS_TOKEN> -- npx -y @mindstone/mcp-server-salesforce` in your terminal.
What does the Salesforce MCP server do?
It lets your local assistant read and write Salesforce data, covering accounts, leads, deals, tasks, reports, and custom objects.
What credentials are required to connect?
You need Node.js 20+, npm, and either a Salesforce Connected App setup for OAuth or an active access token plus your instance URL.