apex_execute
Executes an Apex REST request
Query a Salesforce org with SOQL or SOSL, check an object's real field list before writing the query, and create, update or delete records singly or in bulk.
LABSCO SUMMARY
run_soql_query returns CSV by default and its guidance pushes named fields and a LIMIT, get_record returns every field and says as much, and get_object_fields exists so the schema is fetched once instead of guessed at across retries. Below the typed tools sit tooling_execute, apex_execute and restful, which will reach anything the authenticated profile can — useful, and the reason this belongs on an org where that profile is scoped deliberately. The bulk tools take whole record lists, so a wrong filter is wrong at scale.
A server over a Salesforce org's REST, Tooling and Apex endpoints — queries, record CRUD, bulk operations and a raw REST escape hatch — in 14 tools.
A Salesforce org this machine can authenticate to, and uv with a Python available since the package runs under it. The profile behind that authentication is the boundary — the Apex and raw REST tools reach whatever it can. MIT.
One command plus credentials — uvx --from mcp-salesforce-connector salesforce, then supply credentials
USE CASES
Read the object's real field list first — names, types and whether each is updateable — then write a SOQL query that asks for only those fields and returns CSV.
A SOSL search spans objects at once and its RETURNING clause keeps the response narrow; the record itself is then fetched by id when you know which one it was.
Query the affected records to see the damage, correct them as one bulk update, and bulk delete the rows that should never have been created. Each bulk call takes the whole list at once.
List what objects exist, then go through the Tooling API for metadata work, Apex REST for custom endpoints, or the direct REST call for anything else the org exposes.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
apex_executeExecutes an Apex REST request
bulk_create_recordsCreates multiple records of a specified SObject type in bulk.
bulk_delete_recordsDeletes multiple records of a specified SObject type in bulk, given their IDs.
bulk_update_recordsUpdates multiple records of a specified SObject type in bulk. Each record must have an 'Id' field.
create_recordCreates a new record
delete_recordDeletes a record
get_object_fieldsRetrieves field names and types for a Salesforce object. Use this to discover available fields before writing SOQL queries.
Output is CSV format: name,label,type,updateable
get_recordRetrieves a specific record by ID. Returns all fields - prefer SOQL with specific fields for token efficiency.
list_sobjectsRetrieves a list of all available Salesforce SObjects (standard and custom).
restfulMakes a direct REST API call to Salesforce
run_soql_queryExecutes a SOQL query against Salesforce.
TOKEN OPTIMIZATION GUIDELINES:
Example efficient query: SELECT Id, Name FROM Account WHERE IsActive = true LIMIT 20
run_sosl_searchExecutes a SOSL search against Salesforce.
TOKEN OPTIMIZATION: Use RETURNING clause to limit fields and objects. Example: FIND {searchterm} RETURNING Account(Id, Name), Contact(Id, Name) LIMIT 10
tooling_executeExecutes a Tooling API request
update_recordUpdates an existing record
BEFORE YOU INSTALL
14 tools when we connected.
The documented client runs the server on your machine.
CONTEXT COST
Rated by the size of the 14 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
uvx --from mcp-salesforce-connector salesforce{
"mcpServers": {
"salesforce": {
"command": "uvx",
"args": [
"--from",
"mcp-salesforce-connector",
"salesforce"
]
}
}
}Set one sign-in method in the env block of this entry: SALESFORCE_ACCESS_TOKEN and SALESFORCE_INSTANCE_URL (OAuth, recommended); SALESFORCE_CLIENT_ID and SALESFORCE_CLIENT_SECRET (client credentials); or SALESFORCE_USERNAME, SALESFORCE_PASSWORD and SALESFORCE_SECURITY_TOKEN (legacy). With none of them set, the server uses your Salesforce CLI default org. Set SALESFORCE_DOMAIN to test to reach a sandbox.