Integrate Language Models with Salesforce Data
An MCP server for Salesforce - SOQL/SOSL queries, record CRUD, bulk operations, and Apex/Tooling API access from an LLM.
Why it matters
Enable language models to seamlessly interact with Salesforce data. This connector allows for SOQL queries, SOSL searches, and direct manipulation of Salesforce records, bridging the gap between AI and CRM information.
Outcomes
What it gets done
Execute SOQL queries and SOSL searches against Salesforce.
Retrieve, create, update, and delete Salesforce records.
Access Salesforce object metadata and execute Tooling API queries.
Connect to both production and sandbox Salesforce environments.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-salesforce-mcp | bash Capabilities
Tools your agent gets
Execute SOQL queries to retrieve data from Salesforce objects.
Execute SOSL searches to search across Salesforce objects.
Retrieve metadata for Salesforce objects including field names, labels, and types.
Retrieve a record from Salesforce by ID.
Create a new record in Salesforce.
Update an existing record in Salesforce.
Delete a record from Salesforce.
Execute queries using the Salesforce Tooling API.
Overview
Salesforce MCP Server
This MCP server exposes 14 Salesforce tools: SOQL/SOSL queries, object/field metadata, single-record and bulk CRUD, and advanced Tooling/Apex REST/raw REST API access, supporting four authentication methods. Use it when an LLM needs to query, search, or manage Salesforce data or metadata. Requires valid Salesforce credentials via OAuth, Client Credentials, Salesforce CLI, or legacy username/password.
What it does
An MCP server bridging LLMs to Salesforce, exposing 14 tools across five areas. Query and search: run_soql_query executes SOQL queries and run_sosl_search performs cross-object SOSL searches. Metadata: get_object_fields retrieves field metadata for a specific object and list_sobjects discovers all standard and custom objects. Single-record operations: get_record, create_record, update_record, and delete_record. Bulk operations: bulk_create_records, bulk_update_records which must include an Id field per record, and bulk_delete_records using a list of record IDs. Advanced API access: tooling_execute for Tooling API requests, apex_execute for Apex REST requests, and restful for direct REST API calls to Salesforce.
When to use - and when NOT to
Use it when an LLM needs to query, search, or manage Salesforce records and metadata - running reports via SOQL, searching across objects with SOSL, performing bulk data operations, or invoking custom Apex REST endpoints. It requires one of four supported authentication methods: OAuth using SALESFORCE_ACCESS_TOKEN and SALESFORCE_INSTANCE_URL, recommended; OAuth 2.0 Client Credentials using SALESFORCE_CLIENT_ID and SALESFORCE_CLIENT_SECRET for server-to-server integrations; the active Salesforce CLI default org, used automatically if no OAuth variables are set, optionally targeting a specific org via SALESFORCE_CLI_TARGET_ORG; or legacy username, password, and security-token authentication as a last resort. It is not usable without valid Salesforce credentials in one of these forms.
Capabilities
Bulk operations exist specifically to avoid one-tool-call-per-record overhead: bulk_create_records and bulk_delete_records both accept arrays, while bulk_update_records requires each record in the batch to carry its own Id field so Salesforce can match each update to the correct record. The three advanced-access tools (tooling_execute, apex_execute, restful) exist as escape hatches for anything the 11 higher-level record/query/metadata tools don't cover directly - custom Apex endpoints, Tooling API metadata operations, or arbitrary REST calls the connector doesn't wrap explicitly.
How to install
{
"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"
}
}
}
}
Add this to claude_desktop_config.json's mcpServers section. SALESFORCE_DOMAIN can be set to test to target a sandbox instead of production; it defaults to production if left unset.
Who it's for
Salesforce admins and developers who want an LLM to query, search, and manage Salesforce records - including bulk operations and custom Apex or Tooling API calls - directly from a chat interface instead of the Salesforce UI or writing custom integration code. Because the CLI-based authentication path falls back automatically whenever OAuth environment variables are absent, teams already working with the Salesforce CLI in a given workspace can connect this server with no extra credential setup beyond what sf org display already resolves.
Source README
MCP Salesforce Connector
A Model Context Protocol (MCP) server implementation for Salesforce integration, allowing LLMs to interact with Salesforce data through SOQL queries and SOSL searches.
Features
- Execute SOQL (Salesforce Object Query Language) queries
- Perform SOSL (Salesforce Object Search Language) searches
- Retrieve metadata for Salesforce objects, including field names, labels, and types
- List all available SObjects - Discover standard and custom objects
- Retrieve, create, update, and delete records
- Execute Tooling API requests
- Execute Apex REST requests
- Make direct REST API calls to Salesforce
Configuration
Model Context Protocol
To use this server with the Model Context Protocol, you need to configure it in your claude_desktop_config.json file. Add the following entry to the mcpServers section:
{
"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"
}
}
}
}
Available Tools
Query and Search Tools
run_soql_query- Execute SOQL queries against Salesforcerun_sosl_search- Perform SOSL searches across objects
Metadata Tools
get_object_fields- Retrieve field metadata for specific objectslist_sobjects- List all available SObjects (standard and custom)
Single Record Operations
get_record- Retrieve a specific record by IDcreate_record- Create a new recordupdate_record- Update an existing recorddelete_record- Delete a record
Bulk Operations
bulk_create_records- Create multiple records in a single operationbulk_update_records- Update multiple records (must include Id field)bulk_delete_records- Delete multiple records using record IDs
Advanced API Tools
tooling_execute- Execute Tooling API requestsapex_execute- Execute Apex REST requestsrestful- Make direct REST API calls to Salesforce
Note on Salesforce Authentication Methods
This server supports four authentication methods:
- OAuth (Recommended): Set
SALESFORCE_ACCESS_TOKENandSALESFORCE_INSTANCE_URLas environment variables. - Client Credentials: Set
SALESFORCE_CLIENT_IDandSALESFORCE_CLIENT_SECRETfor OAuth 2.0 Client Credentials flow. This is useful for server-to-server integrations. - Salesforce CLI (Default Org): If no OAuth env vars are set, the server will try to use the active Salesforce CLI default org from the current workspace (via
sf org display --jsonorsfdx force:org:display --json). Optionally setSALESFORCE_CLI_TARGET_ORGto target a specific org. - Username/Password (Legacy): If
SALESFORCE_ACCESS_TOKENandSALESFORCE_INSTANCE_URLare not set, the server will fall back to usingSALESFORCE_USERNAME,SALESFORCE_PASSWORD, andSALESFORCE_SECURITY_TOKEN.
Environment Configuration
SALESFORCE_DOMAIN(Optional): Set totestto connect to a Salesforce sandbox environment. If not set or left empty, the server will connect to the production environment.SALESFORCE_CLI_TARGET_ORG(Optional): When using the Salesforce CLI authentication method, set this to target a specific org alias or username instead of the default org.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.