MCP-Salesforce
MCP Salesforce connector
claude mcp add --transport stdio smn2gnt-mcp-salesforce uvx --from mcp-salesforce-connector salesforce \ --env SALESFORCE_DOMAIN="SALESFORCE_DOMAIN" \ --env SALESFORCE_ACCESS_TOKEN="SALESFORCE_ACCESS_TOKEN" \ --env SALESFORCE_INSTANCE_URL="SALESFORCE_INSTANCE_URL"
How to use
This MCP server provides a Salesforce integration for LLM workflows. It exposes capabilities to run Salesforce SOQL queries and SOSL searches, retrieve object metadata (fields, labels, types), and perform CRUD operations on Salesforce records. It also supports advanced interactions via Salesforce Tooling API, Apex REST requests, and direct REST API calls to Salesforce. To use it, configure the MCP server in your Claude Desktop setup so the MCP server runner (uvx) starts the mcp-salesforce-connector module and exposes Salesforce access through the MCP protocol. The server supports three authentication methods: OAuth (recommended) by supplying SALESFORCE_ACCESS_TOKEN and SALESFORCE_INSTANCE_URL; Salesforce CLI-based authentication by using the active org (with an optional SALESFORCE_CLI_TARGET_ORG); and a legacy username/password approach using SALESFORCE_USERNAME, SALESFORCE_PASSWORD, and SALESFORCE_SECURITY_TOKEN if the token-based method isn’t available. The optional SALESFORCE_DOMAIN can route to a sandbox (set to test) or production environment depending on your setup. Use this to empower LLMs to query data, explore metadata, and perform transactional operations within Salesforce as part of your prompt-driven workflows.
How to install
Prerequisites:
- Python and the uv/uvx tool installed in your environment.
- Access to a Salesforce org and credentials for one of the supported authentication methods.
- (Optional) Salesforce CLI installed if you plan to rely on CLI-based authentication.
Step 1: Install uvx (if not already installed)
- Follow the uvx installation instructions for your platform. This typically involves installing a Python distribution and then installing uvx globally.
Step 2: Prepare environment variables
- Decide which authentication method you will use and set the corresponding environment variables. Example for OAuth:
- SALESFORCE_ACCESS_TOKEN="<your_access_token>"
- SALESFORCE_INSTANCE_URL="https://yourInstance.salesforce.com"
- (Optional) SALESFORCE_DOMAIN="test" to target a sandbox
- If using Salesforce CLI default org:
- Ensure you have the Salesforce CLI authenticated in your workspace
- Optionally set SALESFORCE_CLI_TARGET_ORG to target a specific org
- If using Username/Password (legacy):
- SALESFORCE_USERNAME, SALESFORCE_PASSWORD, SALESFORCE_SECURITY_TOKEN
Step 3: Configure the MCP server entry
- Add or update claude_desktop_config.json with the following under mcpServers:
{ "mcpServers": { "salesforce": { "command": "uvx", "args": [ "--from", "mcp-salesforce-connector", "salesforce" ], "env": { "SALESFORCE_ACCESS_TOKEN": "SALESFORCE_ACCESS_TOKEN", "SALESFORCE_INSTANCE_URL": "SALESFORCE_INSTANCE_URL", "SALESFORCE_DOMAIN": "SALESFORCE_DOMAIN" } } } }
Step 4: Run the MCP server
- Start the MCP server via your standard workflow (e.g., through Claude Desktop which reads claude_desktop_config.json).
- Verify the server initializes and is ready to handle MCP requests for Salesforce operations.
Step 5: Validate connectivity
- Use a test prompt to perform a simple SOQL query or a metadata fetch to ensure the integration is functioning as expected.
Additional notes
Tips and common considerations:
- Prefer OAuth by providing SALESFORCE_ACCESS_TOKEN and SALESFORCE_INSTANCE_URL for stable long-term authentication.
- If you switch between environments (prod vs sandbox), set SALESFORCE_DOMAIN to test when connecting to sandboxes.
- When relying on Salesforce CLI authentication, ensure the active org is correctly set in the workspace and optionally specify SALESFORCE_CLI_TARGET_ORG to lock to a particular org.
- For REST API calls or Tooling API requests, be mindful of permission sets and user permissions in the connected Salesforce org.
- If you encounter connectivity issues, verify network access to the Salesforce instance URL and confirm the access token is not expired; refresh tokens as needed if using OAuth flows.
- The MCP server supports a range of Salesforce operations (SOQL, SOSL, metadata, CRUD, Tooling API, Apex REST) which can be invoked through the MCP interface in prompts; design prompts to target the specific APIs and ensure proper field references and object names.
Related MCP Servers
web-eval-agent
An MCP server that autonomously evaluates web applications.
dedalus -python
A simple and performant Model Context Protocol framework for Python.
mkinf
mkinf SDK to interact with mkinf hub MCP servers
mcp -salesforce
Salesforce MCP Server
fhir
FHIR MCP Server – helping you expose any FHIR Server or API as a MCP Server.
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.