The Salesforce Model Context Protocol (MCP) server allows you to interact with your Salesforce data and metadata using natural language. Whether you're a business user, developer, or administrator, you can chat with your Salesforce org to get insights, manage data, configure the platform, create or delete objects and fields, 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 the following 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"
}
}
}
}
Make sure to:
[REPO_CLONE_PATH]
with the local directory where you cloned the repositoryYOUR_SALESFORCE_USERNAME
: Your Salesforce usernameYOUR_SALESFORCE_PASSWORD
: Your Salesforce passwordYOUR_SALESFORCE_SECURITY_TOKEN
: Your Salesforce security tokenYou can interact with your Salesforce data in the following ways:
The MCP server supports the following Salesforce functions:
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 | Create a new Custom Tab | tab_api_name, label, motif, tab_type |
create_custom_app | Create a Lightning Custom Application | api_name, label, tabs |
create_report_folder | Create a Report Folder | folder_api_name, folder_label |
create_dashboard_folder | Create a Dashboard Folder | folder_api_name, folder_label |
create_lightning_page | Create an empty Lightning Page | label, description |
run_soql_query | Execute a SOQL query | query |
run_sosl_search | Execute a SOSL search | search |
get_object_fields | Get field information for an object | object_name |
create_record | Create a new record | object_name, data |
update_record | Update an existing record | object_name, record_id, data |
delete_record | Delete a record | object_name, record_id |
create_custom_metadata_type | Create a Custom Metadata Type | api_name, label, plural_name, fields |
describe_object_with_api | Get full object description | api_name |
Your Salesforce credentials are stored securely and are only used to establish the connection to your org. The service 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