The Salesforce Model Context Protocol (MCP) server allows you to interact with your Salesforce data and metadata using natural language. This tool enables business users, developers, and administrators to chat with their Salesforce org to get insights, manage data, configure the platform, create objects, fields, and flows, and automate various tasks.
To install the server locally:
git clone https://github.com/salesforce-mcp/salesforce-mcp.git
cd salesforce-mcp
uv venv
uv pip install -e .
Then configure it in your claude_desktop_config.json
file by adding to the mcpServers
section:
{
"mcpServers": {
"salesforce": {
"command": "uv",
"args": [
"--directory",
"[REPO_CLONE_PATH]/salesforce-mcp/src",
"run",
"server.py"
],
"env": {
"USERNAME": "YOUR_SALESFORCE_USERNAME",
"PASSWORD": "YOUR_SALESFORCE_PASSWORD",
"SECURITY_TOKEN": "YOUR_SALESFORCE_SECURITY_TOKEN"
}
}
}
}
Replace [REPO_CLONE_PATH]
with your local directory path where you cloned the repository, and update the credentials with your own Salesforce login information.
Get insights by asking natural language questions like:
The AI will automatically translate your request into the appropriate Salesforce query.
Find information across all your Salesforce records with queries such as:
Explore available fields and objects by asking:
Create, update, and delete records using natural language:
Manage your Salesforce Object Manager:
Remove custom elements:
Set up new interface elements:
Tool Name | Description | Required Input Fields |
---|---|---|
create_object | Create a new object in Salesforce | name, plural_name, api_name |
create_object_with_fields | Create a new object with fields | name, plural_name, api_name, fields |
create_custom_field | Add fields to a custom object | name, plural_name, api_name, fields |
delete_object_fields | Delete fields in a custom object | api_name, fields |
create_tab | Creates a new Custom Tab | tab_api_name, label, motif, tab_type |
create_custom_app | Creates a new Lightning Custom Application | api_name, label, tabs |
create_report_folder | Creates a new Report Folder | folder_api_name, folder_label |
create_dashboard_folder | Creates a new Dashboard Folder | folder_api_name, folder_label |
create_lightning_page | Creates a new empty Lightning Page | label, description |
run_soql_query | Executes a SOQL query | query |
run_sosl_search | Executes a SOSL search | search |
get_object_fields | Retrieves field information | object_name |
create_record | Creates a new record | object_name, data |
update_record | Updates an existing record | object_name, record_id, data |
delete_record | Deletes a record | object_name, record_id |
create_custom_metadata_type | Creates a Custom Metadata Type | api_name, label, plural_name, fields |
describe_object_with_api | Describes a Salesforce object | api_name |
Your Salesforce credentials are stored securely and are only used to establish the connection to your org. The system never stores or shares your credentials with third parties.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "salesforce" '{"command":"uv","args":["--directory","[REPO_CLONE_PATH]/salesforce-mcp/src","run","server.py"],"env":{"USERNAME":"YOUR_SALESFORCE_USERNAME","PASSWORD":"YOUR_SALESFORCE_PASSWORD","SECURITY_TOKEN":"YOUR_SALESFORCE_SECURITY_TOKEN"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"salesforce": {
"command": "uv",
"args": [
"--directory",
"[REPO_CLONE_PATH]/salesforce-mcp/src",
"run",
"server.py"
],
"env": {
"USERNAME": "YOUR_SALESFORCE_USERNAME",
"PASSWORD": "YOUR_SALESFORCE_PASSWORD",
"SECURITY_TOKEN": "YOUR_SALESFORCE_SECURITY_TOKEN"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"salesforce": {
"command": "uv",
"args": [
"--directory",
"[REPO_CLONE_PATH]/salesforce-mcp/src",
"run",
"server.py"
],
"env": {
"USERNAME": "YOUR_SALESFORCE_USERNAME",
"PASSWORD": "YOUR_SALESFORCE_PASSWORD",
"SECURITY_TOKEN": "YOUR_SALESFORCE_SECURITY_TOKEN"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect