Salesforce MCP Server
Salesforce MCP Server enables AI assistants to interact with Salesforce orgs via the Salesforce CLI, offering tools for Apex, SOQL/SOSL, metadata, deployments, testing, record operations, bulk data, and org management.
Org management: list connected orgs (masked), login/logout, get/set/clear default org, display user info.
Apex & testing: execute anonymous Apex, run Apex tests, get test results/coverage, list/fetch debug logs.
Data querying & CRUD: query records (SOQL), query to file, search records (SOSL), create/update/delete records via REST API.
Bulk API 2.0: insert, update, upsert, soft-delete, hard-delete large record sets; check job status, retrieve results, abort jobs.
Metadata & schema: list objects, describe objects, list metadata types/components, generate Apex classes/triggers/LWC/Aura components/custom tabs.
Deploy & packages: deploy metadata, install/uninstall packages, assign permission sets/licenses.
Code analysis: run code analyzer, list rules, run scanner (PMD, ESLint, etc.), run data flow analysis (Graph Engine).
Resources: browse server permissions, org metadata, objects, object schemas, org limits.
Prompts: guided workflows for SOQL building, Apex review, org health check, deploy checklist, debug Apex.
Security & permissions: READ_ONLY mode, ALLOWED_ORGS restriction, org identifier masking, client browser mode for authenticated URLs.
Allows AI assistants to interact with Salesforce organizations, providing tools to execute Apex code, query data, describe objects, and manage Salesforce org connections through the Salesforce CLI.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Salesforce MCP Server show me the top 10 accounts by revenue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Salesforce MCP Server
What is it
Salesforce MCP Server is a Model Context Protocol (MCP) server that enables AI assistants to interact with Salesforce organizations. It provides a set of tools that allow AI models to execute Apex code, query data, describe objects, and manage Salesforce org connections through the Salesforce CLI.
NPM Package: @advanced-communities/salesforce-mcp-server
Installation
Prerequisites
At least one authenticated Salesforce org
Option 1: NPM Installation (Recommended)
The easiest way to install Salesforce MCP Server is directly from NPM using npx:
npx @advanced-communities/salesforce-mcp-serverThis command will:
Download the latest version from NPM
Run the server directly without manual installation
Automatically handle all dependencies
Benefits of NPM Installation:
✅ No manual building required
✅ Always get the latest stable version
✅ Automatic dependency management
✅ Easy updates with
npm update✅ No need to clone the repository
Option 2: MCP Bundle (MCPB) - One-Click Installation
For a fully managed installation experience:
Download the latest
salesforce-mcp-server.mcpbfile from the releases pageDouble-click the
.mcpbfile to installThe extension will be automatically configured in your AI client
All dependencies will be managed automatically
Option 3: Manual Installation - Build from source
For development or customization:
Clone the repository:
git clone https://github.com/advancedcommunities/salesforce-mcp-server.gitNavigate to the directory:
cd salesforce-mcp-serverInstall and build:
npm install && npm run buildThe server will be available at
build/index.js
Add MCP Configuration to your client
To be able to run the MCP Server – you need a client. The client can be any AI app which supports the MCP protocol, such as:
Use it with Claude Desktop
Install Claude Desktop from Anthropic.
Open it up and authenticate to Claude.
Edit your config file at:
Mac:
~/Library/Application\ Support/Claude/claude_desktop_config.jsonWindows:
C:\\Users\\YOUR_USERNAME\\AppData\\Roaming\\Claude\\claude_desktop_config.json
If you can't find the file. Open Claude Desktop, open the Settings menu, go to the Developer section and click Edit Config inside the servers section. Open and edit this file using the instructions below.
Add the following to your config file under the
"mcpServers"key:{ "mcpServers": { "salesforce-mcp-server": { "command": "npx", "args": ["@advanced-communities/salesforce-mcp-server"] } } }With environment variables (optional):
{ "mcpServers": { "salesforce-mcp-server": { "command": "npx", "args": ["@advanced-communities/salesforce-mcp-server"], "env": { "READ_ONLY": "true", "ALLOWED_ORGS": "dev,qa,staging" } } } }Restart Claude Desktop (quit & re-open the app). Now you are able to use the MCP in the Claude Desktop.
Use it with Claude Code
Install Claude Code.
Open it up and authenticate to Claude by runnung the
claudecommand in your terminal.Execute one of the following commands in your terminal:
Basic installation (local scope - default):
claude mcp add salesforce-mcp-server npx @advanced-communities/salesforce-mcp-serverUser scope installation (recommended for global access):
claude mcp add --scope user salesforce-mcp-server npx @advanced-communities/salesforce-mcp-serverWith environment variables:
# Read-only mode (local scope) claude mcp add salesforce-mcp-server npx @advanced-communities/salesforce-mcp-server -e READ_ONLY=true # Read-only mode (user scope) claude mcp add --scope user salesforce-mcp-server npx @advanced-communities/salesforce-mcp-server -e READ_ONLY=true # Restrict to specific orgs (user scope) claude mcp add --scope user salesforce-mcp-server npx @advanced-communities/salesforce-mcp-server -e ALLOWED_ORGS=dev,qa,staging # Both restrictions (user scope) claude mcp add --scope user salesforce-mcp-server npx @advanced-communities/salesforce-mcp-server -e READ_ONLY=true -e ALLOWED_ORGS=production # Open orgs and records in the client's built-in browser (user scope) claude mcp add --scope user salesforce-mcp-server npx @advanced-communities/salesforce-mcp-server -e USE_CLIENT_BROWSER=trueNote: By default, Claude Code installs MCP servers in local scope (current directory). Use
--scope userto install globally for all projects.
Use it with Codex CLI
The Codex CLI can be configured to leverage MCP servers by defining an mcp_servers section in ~/.codex/config.toml.
It is intended to mirror how tools such as Claude and Cursor define mcpServers in their respective JSON config files,
though the Codex format is slightly different since it uses TOML rather than JSON, e.g.:
[mcp_servers.salesforce-mcp-server]
command = "npx"
args = ["@advanced-communities/salesforce-mcp-server"]
# Optional: Add environment variables
[mcp_servers.salesforce-mcp-server.env]
READ_ONLY = "true"
ALLOWED_ORGS = "dev,qa,staging"
USE_CLIENT_BROWSER = "true"Use it with VS Code
In VS Code, open the Command Palette by pressing
Command + Shift + PorCtrl + Shift + P.Type "MCP Add", select the
MCP: Add Serveroption.Select
Command(stdio)option.Put the
npx @advanced-communities/salesforce-mcp-serverinto the command input.For MCP Server Id put
salesforce-mcp-server.Choose either
GlobalorWorkspaceinstallation option.(Optional) To add environment variables, manually edit the VS Code settings:
Open settings.json (
Preferences: Open Settings (JSON))Add environment variables to your MCP server configuration:
"mcp.servers": { "salesforce-mcp-server": { "command": "npx", "args": ["@advanced-communities/salesforce-mcp-server"], "env": { "READ_ONLY": "true", "ALLOWED_ORGS": "dev,qa" } } }
Use it with Cursor
Install Cursor
Open it up and create your account and connect to a model provider
Open
Cursor->Settings->Cursor Settings->McpAdd new global MCP ServerThis will drop you into an editor of the JSON config. Fill in a value for the key
salesforce-mcp-server:{ "mcpServers": { "salesforce-mcp-server": { "command": "npx", "args": ["@advanced-communities/salesforce-mcp-server"] } } }With environment variables (optional):
{ "mcpServers": { "salesforce-mcp-server": { "command": "npx", "args": ["@advanced-communities/salesforce-mcp-server"], "env": { "READ_ONLY": "true", "ALLOWED_ORGS": "production,staging" } } } }If there are any existing keys under mcpServer, don't delete them. Add salesforce-mcp-server to the end.
Save the file. Go back to the
Cursor Settingstab. You should see salesforce-mcp-server listed and the dot should go green.Open
Composerview and toggle fromnormaltoagent(small text on bottom of input)You can now use tools
Related MCP server: Salesforce MCP Server
Configuration
The server supports the following environment variables for access control:
READ_ONLY=true- Prevents execution of Apex code (anonymous execution and tests)ALLOWED_ORGS=ALL- Allow access to all orgs (default)ALLOWED_ORGS=org1,org2,org3- Restrict access to specific org aliasesUSE_CLIENT_BROWSER=true- Hand org and record URLs to the AI client's built-in browser instead of launching your desktop browser (default:false)
When ALLOWED_ORGS is set, the list_connected_salesforce_orgs tool will only show orgs that match the allowed list.
Org Identifier Masking
Org identifiers are always masked before they reach the AI client; there is nothing to configure. list_connected_salesforce_orgs returns:
Usernames partially masked, e.g.
jane.doe@example.combecomesja***@ex***.com(sandbox suffixes such as.uatare kept as the last label)Org IDs with only the
00Dprefix and last 4 characters visible, e.g.00D***********dEAAInstance URLs with the scheme and Salesforce domain suffix kept and the My Domain part masked, e.g.
https://acme.my.salesforce.combecomeshttps://ac***.my.salesforce.com. Sandbox My Domains mask the company and sandbox names separately, e.g.https://acme--uat.sandbox.my.salesforce.combecomeshttps://ac***--ua***.sandbox.my.salesforce.com. Suffixes such as.develop.my.salesforce.com,.scratch.my.salesforce.comand.lightning.force.comare kept; for unknown hosts only the leftmost label is masked. Paths and query strings are dropped.A
notefield reminding the assistant to use aliases astargetOrg, since masked usernames cannot be used to target an org
Aliases, isDevHub and apiVersion are not masked. Production/sandbox/scratch categorization is done on the raw values before masking.
The default org is reported by alias only. get_default_org, the defaultOrg field of get_server_permissions and the salesforce://permissions resource return the alias of the CLI's target-org, even when it's configured as a username (the org's first alias is used). If the default org has no alias, they return a masked username and get_default_org asks you to set an alias. Usernames, org IDs and instance URLs of the default org are never returned. Tools still run against the real default org.
When a tool runs against the default org, the targetOrg it echoes back (in text and structured output), its access-denied message and the prompts' text use the same alias-only form, never the raw username.
Other places identifiers are masked:
login_into_org,logout,open(desktop browser mode) anddisplay_usermask the username, org ID and instance/login URLs in the CLI result.openin desktop mode also drops the path and login token from the returned URL, since the browser is already open. In client browser mode,openandopen_recordstill return the real pre-authenticated URL, because the client's browser needs it.The
salesforce://org/{alias}/metadataresource and theorg_health_checkprompt return masked usernames, org IDs and instance URLs.Usernames listed in
ALLOWED_ORGSare masked in the tool'spermissionMessage, in the server description, in access-denied messages, and in theallowedOrgsvalue returned byget_server_permissionsand thesalesforce://permissionsresource.Error messages from
list_connected_salesforce_orgsand MCP log notifications (for example the CLI commands the server runs) are scrubbed of usernames, org IDs and URLs.Resource alias completions suggest aliases only.
Orgs without an alias can't be targeted by the assistant, so set one first:
sf alias set myOrg=user@example.comUse Client's Built-in Browser
Some AI clients ship their own browser. Set USE_CLIENT_BROWSER=true to keep Salesforce inside that browser instead of popping open your desktop one. Verified with the Claude Cowork and ChatGPT desktop apps; it also works with any client that has a browser tool attached, such as the Chrome DevTools or Playwright MCP servers.
{
"mcpServers": {
"salesforce-mcp-server": {
"command": "npx",
"args": ["@advanced-communities/salesforce-mcp-server"],
"env": {
"USE_CLIENT_BROWSER": "true"
}
}
}
}In MCPB installs the same option appears as the Use Client's Built-in Browser checkbox in the extension settings.
What changes when it is enabled:
openandopen_recordno longer launch a browser. They return a pre-authenticated Salesforce URL (generated withsf org open --url-only) together withopenInClientBrowser: true, so the assistant can navigate to it with its own browser tool.The server advertises the mode in its MCP
instructions, which clients surface to the assistant, so it knows to open the returned URL rather than print it.openandopen_recordacceptforceSystemBrowser: trueto launch your desktop browser for that one call.Passing
browserorprivateModetoopencounts as asking for your desktop browser, so the org opens there even while the mode is active — neither option means anything to the client's browser.login_into_orgis unaffected — the Salesforce CLI OAuth flow always uses your desktop browser.
The returned URL contains a single-use Salesforce login token minted by Salesforce (/services/oauth2/singleaccess) and valid for up to one minute. It logs whoever opens it into the org as you, so treat it like a credential: it is meant for the client's browser tool, not for chat logs or third parties.
Open one link before asking for the next. Salesforce caches the token for the life of that minute, so URLs generated back to back can carry the same token with different destinations, and navigating several in quick succession may drop the browser on a login page instead of the record you asked for. Once the first link has signed the browser in, that session carries the login — ordinary Salesforce URLs work from then on without a token.
Client browser mode is reported by the get_server_permissions tool and the salesforce://permissions resource as useClientBrowser.
Default Org
All tools that interact with a Salesforce org accept an optional targetOrg parameter. When targetOrg is not provided, the server automatically resolves the default org from your Salesforce CLI configuration.
To set a default org:
sf config set target-org <alias-or-username>To check which org is currently set as default:
sf config get target-orgWhen a default org is configured, you can use any tool without specifying targetOrg — the server will use the default automatically. If no targetOrg is provided and no default org is configured, the tool will return an error asking you to either provide targetOrg or set a default.
You can check the current default org via the get_server_permissions tool, which includes its alias in its response.
Permission Examples
Read-only access to all orgs:
{
"mcpServers": {
"salesforce-mcp-server": {
"command": "npx",
"args": ["@advanced-communities/salesforce-mcp-server"],
"env": {
"READ_ONLY": "true"
}
}
}
}Full access to specific orgs only:
{
"mcpServers": {
"salesforce-mcp-server": {
"command": "npx",
"args": ["@advanced-communities/salesforce-mcp-server"],
"env": {
"ALLOWED_ORGS": "dev,qa,staging"
}
}
}
}Read-only access to specific orgs:
{
"mcpServers": {
"salesforce-mcp-server": {
"command": "npx",
"args": ["@advanced-communities/salesforce-mcp-server"],
"env": {
"READ_ONLY": "true",
"ALLOWED_ORGS": "production,prod-backup"
}
}
}
}You can check the current permission settings using the get_server_permissions tool.
How to use it
Once the SF MCP Server is configured in your AI client, you can interact with Salesforce using natural language. The AI assistant will have access to 47 powerful tools, 5 guided workflow prompts, 5 browsable resource types, and structured logging with progress reporting:
Available Tools
1. List Connected Salesforce Orgs
View all Salesforce orgs currently authenticated with the Salesforce CLI. Usernames, org IDs and instance URLs are masked (see Org Identifier Masking).
Example prompts:
"Show me all connected Salesforce orgs"
"List my available Salesforce organizations"
"Which Salesforce orgs can I access?"
2. List Objects in an Org
Retrieve all standard and custom objects available in a specific Salesforce org.
Example prompts:
"List all custom objects in my dev org"
"Show me all objects in the production org"
"What custom objects exist in sandbox1?"
3. Describe an Object
Get detailed metadata about a specific Salesforce object, including fields, relationships, and properties.
Example prompts:
"Describe the Account object in my org"
"Show me all fields on the Custom_Object__c in dev org"
"What are the relationships on the Contact object?"
4. Execute Apex Code
Run anonymous Apex code directly in a Salesforce org and see the debug output.
Example prompts:
"Execute this Apex in my dev org: System.debug('Hello World');"
"Run a query in Apex to count all Accounts"
"Execute Apex code to create a test Account record"
5. Query Records
Execute SOQL queries and retrieve results in JSON format.
Example prompts:
"Query the first 10 Accounts from my org"
"Find all Contacts with email domain '@example.com'"
"Get Opportunities closed this month with amount over $10,000"
"Query all Case records created today"
6. Query Records to File
Execute SOQL queries and save results to CSV or JSON files.
Example prompts:
"Export all Leads to a CSV file"
"Save all Opportunities from Q4 2024 to a JSON file"
"Create a CSV export of Accounts with their related Contacts"
7. Run Apex Tests
Execute Apex test classes with various options including test level and code coverage.
Example prompts:
"Run all tests in my dev org"
"Execute the AccountTriggerTest class with code coverage"
"Run all local tests excluding managed packages"
8. Get Apex Test Results
Retrieve results from a previous asynchronous Apex test run.
Example prompts:
"Get the results of test run ID 707xx0000000001"
"Show me the code coverage from the last test run"
9. Get Apex Code Coverage
Get code coverage information for a Salesforce org.
Example prompts:
"What's the overall code coverage in my org?"
"Show code coverage from the latest test run"
10. Generate Apex Class
Generate metadata source files for a new Apex class.
Example prompts:
"Generate a new Apex class called AccountHelper"
"Create an Apex controller class named MyCustomController"
"Generate a batch class called DataCleanupBatch in the classes directory"
11. Generate Apex Trigger
Generate metadata source files for a new Apex trigger.
Example prompts:
"Generate a trigger called AccountTrigger for the Account object"
"Create a before insert trigger for the Contact object"
"Generate an after update trigger for MyCustomObject__c"
12. List Apex Logs
Fetch and list Apex debug logs from the org.
Example prompts:
"Show me all Apex debug logs in my dev org"
"List the recent debug logs from production"
"Get the IDs of debug logs in sandbox"
13. Get Apex Log
Fetch specific Apex debug logs or recent logs from the org.
Example prompts:
"Get the debug log with ID 07L...."
"Show me the last 5 debug logs from my org"
"Fetch the most recent debug log from production"
14. Login to Salesforce Org
Authenticate and login to a Salesforce org via web browser.
Example prompts:
"Login to a new production org with alias 'prod'"
"Connect to a sandbox with alias 'dev-sandbox'"
15. Get Server Permissions
Check current server permission settings.
Example prompts:
"Show me the current server permissions"
"What orgs am I allowed to access?"
16. Run Code Analyzer
Analyze your code with configurable rules to ensure good coding practices.
Example prompts:
"Run code analyzer on all Apex classes"
"Analyze my Lightning Web Components for security issues"
"Check PMD rules on the force-app directory"
17. List Code Analyzer Rules
List available rules for code analysis.
Example prompts:
"Show me all available code analyzer rules"
"List security-related code analysis rules"
"What ESLint rules are available?"
18. Scanner Run
Scan a codebase with various security and quality rules using multiple engines.
Example prompts:
"Scan all Apex files for security vulnerabilities"
"Run PMD and ESLint scanners on my codebase"
"Check for retire-js vulnerabilities in my JavaScript files"
"Scan with high severity threshold and save results to CSV"
19. Scanner Run DFA
Run Salesforce Graph Engine for data flow analysis to identify complex security issues.
Example prompts:
"Run data flow analysis on my Apex controllers"
"Check for SOQL injection vulnerabilities using Graph Engine"
"Perform path-based security analysis on all Apex classes"
"Run DFA with pilot rules enabled"
20. Assign Permission Set
Assign permission sets to one or more org users.
Example prompts:
"Assign the DreamHouse permission set to the admin user in my dev org"
"Grant CloudHouse and AppBuilder permission sets to user@example.com"
"Assign multiple permission sets to a list of users in sandbox"
21. Assign Permission Set License
Assign permission set licenses to org users.
Example prompts:
"Assign the Sales Cloud license to user@example.com"
"Grant Service Cloud permission set license to multiple users"
"Assign Platform Event license to the admin user"
22. Display User
Display information about a Salesforce user including profile, org ID, and access details.
Example prompts:
"Show me information about the admin user in my org"
"Display user details for user@example.com"
"Get the profile and access token for the current user"
23. List Metadata
List metadata components and properties of a specified type.
Example prompts:
"List all CustomObject components in my org"
"Show me all Dashboard components in the Sales folder"
"Get all EmailTemplate metadata with API version 60.0"
"List Layout components and save to a file"
24. List Metadata Types
Display details about all metadata types enabled for your org.
Example prompts:
"Show me all available metadata types in my org"
"List metadata types for package.xml creation"
"Get all enabled metadata types with API version 60.0"
"Display metadata types and save to file for reference"
25. Logout
Log out of a Salesforce org, removing stored authentication.
Example prompts:
"Logout from my dev org"
"Remove authentication for sandbox1"
"Logout from all connected orgs"
26. Open
Open a Salesforce org in your browser. With USE_CLIENT_BROWSER=true it returns a pre-authenticated URL for the client's built-in browser instead; pass forceSystemBrowser: true to launch your desktop browser anyway.
Example prompts:
"Open my dev org in Chrome"
"Open the Lightning Experience page in my sandbox"
"Open my org in private/incognito mode"
"Open a Visualforce page /apex/MyPage in production"
"Open my FlexiPage in Lightning App Builder"
"Open my dev org in my own browser, not yours"
27. Open Record
Open a specific Salesforce record in the browser. With USE_CLIENT_BROWSER=true it returns a pre-authenticated URL for the client's built-in browser instead; pass forceSystemBrowser: true to launch your desktop browser anyway.
Example prompts:
"Open record 001XX0000XXXXX in my dev org"
"Navigate to Account record 001... in production"
"Show me the Contact record 003... in the browser"
28. Create Record
Create a new record in a Salesforce org using the REST API.
Example prompts:
"Create a new Account with Name 'Acme Corp' and Type 'Customer'"
"Insert a Contact record with FirstName 'John' and LastName 'Doe'"
"Create a Case with Subject 'Technical Issue' and Priority 'High'"
"Add a new Lead with Company 'Tech Startup' and Email 'lead@example.com'"
29. Update Record
Update an existing record in a Salesforce org using the REST API.
Example prompts:
"Update Account 001XX... to set BillingCity to 'San Francisco'"
"Change the Status of Opportunity 006XX... to 'Closed Won'"
"Update Contact 003XX... with Phone '(555) 123-4567'"
"Modify Case 500XX... to set Priority to 'Critical'"
30. Delete Record
Delete a record from a Salesforce org using the REST API.
Example prompts:
"Delete the Account record 001XX..."
"Remove Contact 003XX... from the org"
"Delete Lead record 00QXX..."
"Remove the test Case record 500XX..."
31. Package Install
Install or upgrade a package version in a Salesforce org.
Example prompts:
"Install package 04tXXXXXXXXXXXXXX in my dev org"
"Upgrade the package with ID 04t... in production with 10 minute wait time"
"Install a protected package with key 'mykey123' in sandbox"
"Install package and compile only package Apex code"
"Upgrade unlocked package and deprecate removed components"
32. Package Uninstall
Uninstall a second-generation package from a Salesforce org.
Example prompts:
"Uninstall package 04tXXXXXXXXXXXXXX from my dev org"
"Remove the package with alias 'old_package' from production"
"Uninstall package and wait 5 minutes for completion"
"Remove package with spaces in alias from sandbox"
33. Schema Generate Tab
Generate metadata source files for a new custom tab on a custom object.
Example prompts:
"Create a tab for MyObject__c with icon 54 in the tabs directory"
"Generate a custom tab for Invoice__c object with icon 25"
"Add a navigation tab for Customer__c with icon 75 in force-app/main/default/tabs"
"Create a tab for Product__c custom object with default icon"
34. Search Records
Execute SOSL text-based searches across multiple objects. This is the primary tool for finding records that mention or contain specific text across your Salesforce org.
Example prompts:
"Search for 'Anna Jones' in all Name fields"
"Find records containing 'Acme' across all objects"
"Search for phone number '415-555-1234' in Contact and Lead"
"Find all records mentioning our competitor 'Acme Corp' across Accounts, Opportunities, and Cases"
"Execute SOSL: FIND {Smith} IN ALL FIELDS RETURNING Contact, Lead"
35. Generate Lightning Component
Generate Lightning Web Components (LWC) or Aura components with configurable templates and output directories.
Example prompts:
"Generate a Lightning Web Component called AccountList"
"Create an Aura component named ContactForm in the components directory"
"Generate an LWC with analyticsDashboard template called SalesMetrics"
"Create a Lightning component MyCustomView with default template"
36. Deploy Metadata to Org
Deploy metadata components to a Salesforce org with various configuration options including test execution.
Example prompts:
"Deploy all metadata from force-app directory to my dev org"
"Validate deployment to production with all tests but don't save (dry run)"
"Deploy specific Apex classes matching 'Account*' pattern to sandbox"
"Deploy using package.xml manifest with RunLocalTests"
"Deploy metadata and run specific test classes: TestClass1, TestClass2"
37. Get Default Org
Get the alias of the current default target org configured in the Salesforce CLI. This is the org used automatically when no targetOrg is specified. Only the alias is returned; if the default org has no alias, a masked username is returned with a prompt to set one (sf alias set <alias>=<username>).
Example prompts:
"What is my default Salesforce org?"
"Show me the current default target org"
"Which org am I connected to by default?"
38. Set Default Org
Set the default target org for the Salesforce CLI. Once set, all tools will use this org when no targetOrg is specified.
Example prompts:
"Set my default org to dev-sandbox"
"Change the default target org to production"
"Make 'staging' my default Salesforce org"
39. Clear Default Org
Clear the default target org from the Salesforce CLI configuration. After clearing, all tools will require an explicit targetOrg parameter.
Example prompts:
"Clear the default Salesforce org"
"Remove the default target org setting"
"Unset my default org"
40-47. Bulk API 2.0 Tools
Bulk API 2.0 tools run large DML jobs asynchronously through the existing org connection. Each tool starts a job, waits up to wait seconds (default 30, max 45), and returns the jobId, state, processed and failed counts, and up to 10 sample failures. If the job is still running, call bulk_job_status with the jobId. Input is one of inline records (max 2000 rows, 10 MB serialized), a csvPath to a UTF-8 CSV file on the server's disk (max 150 MB), or csvContent, the raw CSV text with its header row (max 10 MB). Use records for small inline sets, csvPath for a file already on the server's disk, and csvContent when the file cannot be read from the server's machine, for example when it was uploaded into a sandboxed client such as Claude Cowork (the client passes the file's text, and the server never sees the file's path). Exactly one of the three is allowed. Delete tools take ids in place of records.
bulk_insert_records: insert records. Do not includeId.bulk_update_records: update records byId. InlineIdvalues are format-checked before the job is created;Idvalues in a CSV are not, and a malformed one fails only its own row. Updates above 500 rows ask the user to confirm when the client can prompt; a failed or declined prompt blocks the update. Without prompt support the update runs.bulk_upsert_records: insert or update on an external ID field (externalIdField, a field on the object itself). Upserts above 500 rows follow the same confirmation rule as updates.bulk_delete_records: soft delete byidsor a CSV with anIdcolumn. If the client can show a confirmation prompt, the user is asked and declining blocks the delete. If it cannot (for example Claude Cowork, which has its own tool approval), passconfirm: "DELETE <sobject>"and approve the call in the client; without the exact string the delete is refused.bulk_hard_delete_records: permanent delete. Requiresconfirm: "HARD DELETE <sobject>"in every client, and also asks the user to confirm when the client can prompt. Needs the Bulk API Hard Delete permission.bulk_job_status: read-only check of a job.bulk_job_results: writessuccessful-results.csv,failed-results.csvandunprocessed-records.csvto~/salesforce-bulk-results/<jobId>/(your home directory), or tooutputDirif given. The result folder itself must not be a symbolic link, for the default folder as well as a custom one; symbolic links in parent folders are not checked. A customoutputDirmust be an absolute path and must not already contain these files. The default folder is overwritten on re-run.bulk_job_abort: aborts a job that has not finished. Jobs are never deleted by these tools.
Set READ_ONLY=true to block all Bulk API writes, including bulk_job_abort. bulk_job_status and bulk_job_results still work, because bulk_job_results only writes local files. Upload and create failures return the jobId and abort the job when the upload did not complete.
Async pattern: start tools wait for up to wait seconds. If the job is still running, the response includes the jobId and state. Poll with bulk_job_status until the state is JobComplete, Failed or Aborted, then call bulk_job_results for full success, failure and unprocessed CSVs. Jobs are never deleted by these tools.
Path policy: csvPath must be absolute, end in .csv, point to an existing regular file (symlinks are followed, so the target is what counts), be at most 150 MB, and be UTF-8 with a header row and at least one data row (a header-only or blank-line-only file is refused). There is no folder restriction: any .csv the server process can read can be uploaded to the connected org, so an MCP client can send any local CSV it can name. outputDir must be absolute, must not be a symbolic link or a non-directory, and is created if missing; there is no folder restriction either, so result folders can be written anywhere the server process can write. Only the final folder is checked for symbolic links, not its parents. csvContent is not a path, so the path policy does not apply to it; it is checked only for size, header, required columns and line endings.
CSV rules (csvPath and csvContent): header names must not have leading or trailing spaces, because Bulk API reads them as written. Every line break must use the same ending as the header row (all LF or all CRLF), so a mixed file is refused before upload. Quotes count only at the start of a cell, so a stray quote inside a value is ordinary text.
Limits and gotchas:
Inline
recordsare capped at 2000 rows and 10 MB of serialized CSV.csvContentis capped at 10 MB of text (UTF-8 bytes, including the header row), and the text is sent in the tool call, so usecsvPathfor larger volumes (max 150 MB per file). Current org limits are available from theorg_limitsresource.Null values are written as
#N/A, which clears the field on the Salesforce side. Keys missing from a record are left as empty cells, which do not change existing values on update.Nested objects are flattened to dotted relationship headers, for example
Account.ExternalId__c. Records from SOQL results have theirattributesmetadata dropped.Updates must include
Idon every row, and upserts must include the external ID field. Inserts and upserts should not includeId; the tools do not strip it, and Salesforce rejects or reports those rows.Hard delete needs the 'Bulk API Hard Delete' system permission on the running user (usually granted through a profile or permission set, and by default only to System Administrators). Without it, the tool returns a permission error.
Records are processed in batches and rows are not rolled back. A job can report partial success, so always check
failed-results.csvbefore retrying.
Available Resources
The server exposes MCP Resources that clients can browse and include in conversations for contextual data about your Salesforce orgs.
# | Resource | URI | Description |
1 | Server Permissions |
| Current server permission settings (read-only mode, allowed orgs, default org) |
2 | Org Metadata |
| Org metadata summary with available metadata types |
3 | Org Objects |
| List of all standard and custom SObjects in the org |
4 | Object Schema |
| Detailed schema for a specific SObject (fields, relationships, record types) |
5 | Org Limits |
| API limits and usage (daily API calls, storage, governor limits) |
Resources support autocomplete for org aliases and object names. Template resources (2-5) respect the ALLOWED_ORGS permission setting.
Available Prompts
The server provides MCP Prompts — templated workflows that appear as slash commands in clients like Claude Desktop. They fetch live org data and guide the AI through common Salesforce tasks.
# | Prompt | Arguments | Description |
1 |
|
| Describe an SObject and interactively build a SOQL query step by step |
2 |
|
| Fetch an Apex class from the org and perform a structured code review |
3 |
|
| Fetch org info, API limits, and test coverage to assess org health |
4 |
|
| Generate a pre-deployment readiness checklist with live org data |
5 |
|
| Fetch and analyze an Apex debug log for errors and performance issues |
All prompts respect the ALLOWED_ORGS permission setting and use the default org when targetOrg is not provided.
Practical Examples
Example 1: Data Analysis
User: "I need to analyze our customer data. First, show me what custom objects we have in the production org."
AI: [Lists all custom objects]
User: "Great! Now query all Customer__c records created this year and export them to CSV."
AI: [Executes query and creates CSV file]Example 2: Debugging
User: "I'm having issues with a trigger. Can you execute this Apex to test it:
List<Account> accs = [SELECT Id, Name FROM Account LIMIT 5];
for(Account a : accs) {
System.debug('Account: ' + a.Name);
}"
AI: [Executes the code and shows debug logs]Example 3: Schema Documentation
User: "I need to document our data model. Can you describe the Order__c object including all its fields and relationships?"
AI: [Provides detailed object metadata]Logging
The server emits structured MCP log messages (notifications/message) with typed severity levels and named loggers. Clients that support the MCP logging capability will receive these messages automatically.
Logger names: salesforce, cli, permissions
Log levels used:
debug— CLI command execution detailsinfo— Server startup and general statuswarning— Permission denialserror— Command failures and connection errorscritical— Authentication/auth-info failures
Clients can set a minimum log level via the logging/setLevel request to filter out lower-severity messages.
Progress Reporting
Long-running tools report real-time progress via MCP progress notifications (notifications/progress). Clients that include a progressToken in _meta when calling a tool will receive progress updates with step messages.
Tools with progress reporting:
deploy_start— Resolving target org → Validating permissions → Deploying metadatarun_apex_tests— Resolving target org → Validating permissions → Running Apex testsscanner_run— Validating permissions → Running scanscanner_run_dfa— Validating permissions → Running data flow analysisrun_code_analyzer— Validating permissions → Running code analysisquery_records_to_file— Resolving target org → Validating permissions → Exporting records to file
Progress is reported as fire-and-forget notifications and will never interrupt tool execution. Clients that don't provide a progress token will not receive any notifications.
Elicitation (User Confirmation)
Destructive operations request user confirmation via MCP elicitation before proceeding. When a client supports elicitation, the server will prompt the user with a confirmation dialog before executing the operation.
Tools that request confirmation:
delete_record— Confirms before permanently deleting a Salesforce recordpackage_uninstall— Confirms before uninstalling a package from the orglogout— Confirms before logging out of a specific org or all orgsdeploy_start— Confirms before deploying metadata (skipped for dry-run/validation-only deployments)
Elicitation degrades gracefully: if the client does not support elicitation, or the server has not been initialized, operations proceed without confirmation. This ensures backward compatibility with all MCP clients.
Completions (Argument Auto-Complete)
Prompt arguments and resource URI variables support auto-completion via the MCP Completions API. When a client sends a completion/complete request, the server returns matching suggestions.
Prompt argument completions:
targetOrg— All 5 prompts auto-complete with connected org aliases filtered byALLOWED_ORGSobjectName(soql_builder) — Auto-completes with SObject API names from the resolved target org
Resource URI completions:
{alias}— All template resources auto-complete with connected org aliases{name}(org_object_schema) — Auto-completes with SObject names from the resolved org
Completions are powered by the SDK's completable() wrapper and require no additional client configuration.
Server Title & Icon
The server provides a human-readable title ("Salesforce MCP Server") and an embedded icon in its metadata. Clients that support the MCP Implementation metadata (SDK 1.25+) will display the server name and icon in their UI. Tool-level icons are not currently supported by the MCP SDK.
Structured Tool Output
The following tools support MCP structured output (outputSchema + structuredContent) for programmatic result parsing:
query_records— returns{ targetOrg, records }sobject_list— returns{ targetOrg, sobjects }sobject_describe— returns{ targetOrg, name, label, fields, childRelationships, recordTypeInfos, ... }list_connected_salesforce_orgs— returns{ devHubOrgs, production, sandboxes, scratchOrgs, totalOrgs, permissionMessage?, note }(usernames, org IDs and instance URLs always masked)get_apex_test_results— returns{ targetOrg, summary, tests, codecoverage }
Clients that support the MCP outputSchema capability will receive validated structured data in addition to the text content. All tool schemas are advertised with the JSON Schema 2020-12 dialect so that clients validating outputSchema with a 2020-12-only validator accept them.
Tips for Best Results
Specify the Target Org: Always mention which org you want to work with (e.g., "in my dev org", "using production")
Be Specific with Queries: Provide field names and conditions for SOQL queries
Good: "Query Account records with Type = 'Customer' and show Id, Name, and CreatedDate"
Less specific: "Get some Accounts"
Object Names: You can use either user-friendly names or API names - the AI assistant will use the describe tools to find the correct API names
Both work: "Query Custom Object records" or "Query Custom_Object__c records"
The assistant will automatically resolve field names too
Apex Code Formatting: When providing Apex code, you can use code blocks or inline code
File Exports: Specify the format (CSV or JSON) when exporting query results
Troubleshooting
"No orgs found": Make sure you have authenticated orgs using sf org login
"Object not found": Verify the object exists and you're using the correct API name
"Query error": Check your SOQL syntax and field names
"Apex execution failed": Review the debug logs for specific error messages
"Tool ... has an invalid outputSchema: JSON Schema declares an unsupported dialect": Update to the latest server version — tool schemas are now published as JSON Schema 2020-12 instead of draft-07
Security Considerations
The server executes commands with the permissions of the authenticated Salesforce user
While client browser mode is enabled,
openandopen_recordreturn URLs that contain a one-time Salesforce login token — whoever opens one first is logged in as you, so keep them out of shared logs and ticketsBe cautious when executing DML operations in production orgs
Review Apex code before execution, especially in production environments
Consider using sandbox orgs for testing and development
Building MCP Bundle (MCPB) Locally
If you want to build the MCP Bundle file yourself:
Clone the repository and navigate to the
salesforce-mcp-serverdirectoryInstall dependencies:
npm installBuild the MCPB file:
npm run build:mcpbThe
.mcpbfile will be created in thedist/directoryShare this file with others for easy one-click installation
For more details about MCP Bundles, see MCPB.md
Available Tools
47 toolsapex_get_logBRead-onlyIdempotent
Fetch the specified log or given number of most recent logs from the org.
Inputs: input (required).
apex_log_listBRead-onlyIdempotent
Fetch the list of apex debug logs returning the logs with their IDs.
Inputs: input (required).
assign_permission_setCDestructive
Assign a permission set to one or more org users. To specify an alias for the --target-org or --on-behalf-of flags, use the CLI username alias, such as the one you set with the 'alias set' command. Don't use the value of the Alias field of the User Salesforce object for the org user. To assign multiple permission sets, specify multiple names in the permissionSetNames array. Enclose names that contain spaces in the array elements. The same syntax applies to onBehalfOf array for specifying multiple users.
Inputs: input (required).
assign_permission_set_licenseBDestructive
Assign a permission set license to one or more org users. To specify an alias for the --target-org or --on-behalf-of flags, use the CLI username alias, such as the one you set with the 'alias set' command. Don't use the value of the Alias field of the User Salesforce object for the org user. To assign multiple permission set licenses, specify multiple names in the licenseNames array. Enclose names that contain spaces in the array elements. The same syntax applies to onBehalfOf array for specifying multiple users.
Inputs: input (required).
bulk_delete_recordsADestructiveIdempotent
Soft-delete many records with the Bulk API 2.0 (moves them to the Recycle Bin). Provide exactly one of 'ids' (max 2000 Salesforce record Ids), 'csvPath' (a CSV file on the server's machine with an 'Id' column) or 'csvContent' (raw CSV text with an 'Id' column, for files the server cannot read). If the client can show a confirmation prompt, the user is asked and declining blocks the delete. If it cannot, pass confirm: 'DELETE ' (for example 'DELETE Account') and the user's approval of this call in the client is the remaining gate. Returns the jobId, state, processed and failed counts. Use bulk_hard_delete_records to permanently delete.
Inputs: input (required).
bulk_hard_delete_recordsADestructiveIdempotent
PERMANENTLY delete many records with the Bulk API 2.0 hardDelete operation. Records bypass the Recycle Bin and cannot be restored. Requires the 'Bulk API Hard Delete' permission on the user. Provide exactly one of 'ids', 'csvPath' or 'csvContent' (CSV with an 'Id' column), and the exact 'confirm' string 'HARD DELETE ' (for example 'HARD DELETE Account'). If the client can show a confirmation prompt, the user is also asked and declining blocks the delete. Otherwise the typed 'confirm' string and the user's approval of this call in the client are the gates.
Inputs: input (required).
bulk_insert_recordsA
Insert many records with the Bulk API 2.0 (asynchronous, for large volumes). Provide exactly one of 'records' (inline JSON objects, max 2000), 'csvPath' (a CSV file on the server's machine) or 'csvContent' (raw CSV text with its header row, for files the server cannot read, such as uploads into a sandboxed client; max 10 MB). Returns the jobId, state, processed and failed counts, and up to 10 sample failures when the job finishes within 'wait' seconds. Use bulk_job_results for full result files. Do not include Id values for inserts. Null values are written as #N/A, which clears a field.
Inputs: input (required).
bulk_job_abortADestructiveIdempotent
Abort a Bulk API 2.0 job that has not finished (Open, UploadComplete or InProgress). Records already processed are not rolled back. Jobs are never deleted by these tools.
Inputs: input (required).
bulk_job_resultsAIdempotent
Write the successful, failed and unprocessed records of a finished Bulk API 2.0 job to CSV files and return their paths and row counts. Files go to /salesforce-bulk-results// unless outputDir is given. The result folder itself must not be a symbolic link (default or custom); symbolic links in parent folders are not checked. A custom outputDir must be an absolute path and must not already contain these files. Read-only in the org; writes local CSV files.
Inputs: input (required).
bulk_job_statusARead-onlyIdempotent
Check the state and record counts of a Bulk API 2.0 job created by a bulk_* tool. Use it after a start call returned a non-final state. Read-only.
Inputs: input (required).
bulk_update_recordsADestructiveIdempotent
Update many existing records by Id with the Bulk API 2.0. Each record (or each CSV row) must include 'Id'; only the provided fields are changed. Provide exactly one of 'records', 'csvPath' or 'csvContent'. Inline Ids are format-checked before the job is created; Ids in CSV text are not, and a malformed one fails only its own row. Null values are written as #N/A, which clears a field. Updates above 500 rows ask the user to confirm when the client supports confirmation. Returns the jobId, state, processed and failed counts, and sample failures when the job finishes within 'wait' seconds.
Inputs: input (required).
bulk_upsert_recordsADestructiveIdempotent
Insert or update many records with the Bulk API 2.0, matching existing records on an external ID field. Each record (or CSV row) must include the externalIdField value; do not include Id. Provide exactly one of 'records', 'csvPath' or 'csvContent'. Upserts above 500 rows ask the user to confirm when the client supports confirmation. Returns the jobId, state, processed and failed counts, and sample failures when the job finishes within 'wait' seconds.
Inputs: input (required).
clear_default_orgADestructiveIdempotent
Clear the default target org from the Salesforce CLI configuration. After clearing, all tools will require an explicit targetOrg parameter until a new default is set.
Inputs: no named parameters.
create_recordBDestructive
Create a new record in a Salesforce org using the REST API. Returns the ID of the created record on success. Input must be a JSON object with keys: sObject (string), recordJson (string), and optionally targetOrg (string).
Inputs: input (required).
delete_recordADestructive
Delete a record from a Salesforce org using the REST API. Permanently removes the specified record. Input must be a JSON object with keys: sObject (string), recordId (string), and optionally targetOrg (string).
Inputs: input (required).
deploy_startCDestructive
Deploy metadata to Salesforce org with test execution options.
Inputs: input (required).
display_userBRead-onlyIdempotent
Display information about a Salesforce user. Output includes the profile name, org ID, access token, instance URL, login URL, and alias if applicable. The username, org ID, instance URL and login URL are masked for privacy. The displayed alias is local and different from the Alias field of the User sObject record of the new user, which you set in the Setup UI.
Inputs: input (required).
execute_anonymous_apexBDestructive
Execute Apex code in a Salesforce Org. This command allows you to run Apex code directly against a specified Salesforce Org. The code is executed in the context of the Org, and the results are returned in JSON format. You can use this command to test Apex code snippets, run batch jobs, or perform other Apex-related tasks. You can review the debug logs of the execution to see the results of the code execution.
Inputs: input (required).
generate_classCDestructive
Generates the Apex *.cls file and associated metadata file. These files must contained in a parent directory called "classes" in your package directory. Either run this command existing directory of this name, or use the --output-dir flag to generate one or point to an existing one.
Inputs: input (required).
generate_componentCDestructive
Generate Lightning Web Components (LWC) or Aura components with customizable templates and output directories
Inputs: input (required).
generate_triggerBDestructive
Generates the Apex trigger *.trigger file and associated metadata file. These files must be contained in a parent directory called "triggers" in your package directory. Either run this command from an existing directory of this name, or use the --output-dir flag to generate one or point to an existing one. If you don't specify the --sobject flag, the .trigger file contains the generic placeholder SOBJECT; replace it with the Salesforce object you want to generate a trigger for. If you don't specify --event, "before insert" is used.
Inputs: input (required).
get_apex_code_coverageARead-onlyIdempotent
Get code coverage information for a Salesforce Org. This command allows you to retrieve org-wide coverage percentage or coverage details from a specific test run. Use this to monitor and ensure your code meets the 75% coverage requirement.
Inputs: input (required).
get_apex_test_resultsARead-only
Retrieve results from a previous asynchronous Apex test run. Use this command with a test run ID to get detailed test results including pass/fail status, error messages, stack traces, and optionally code coverage information.
Inputs: input (required). Returns: tests, summary, targetOrg, codecoverage
get_default_orgARead-onlyIdempotent
Get the current default target org configured in the Salesforce CLI. Returns only the org's alias, which is used as the default when no targetOrg is specified in other tool calls. If the default org has no alias, a masked username is returned with a hint asking the user to set an alias; usernames, org IDs and instance URLs are never returned.
Inputs: no named parameters.
get_server_permissionsCRead-onlyIdempotent
Get current server permission settings
Inputs: no named parameters.
list_code_analyzer_rulesARead-onlyIdempotent
List available code analysis rules with details. Use to determine rules for code-analyzer run command.
Inputs: input (required).
list_connected_salesforce_orgsARead-onlyIdempotent
List connected Salesforce Orgs. This command retrieves a list of all Salesforce Orgs that are currently connected to the Salesforce CLI. The results are returned in JSON format, providing details about each Org, including its alias, username, and other metadata. Use this command to see which Salesforce Orgs you have access to and can interact with using the Salesforce CLI. Usernames, org IDs and instance URLs in the result are masked for privacy; refer to orgs by alias when passing targetOrg to other tools.
Inputs: no named parameters. Returns: note, sandboxes, totalOrgs, devHubOrgs, +3 more
list_metadataARead-onlyIdempotent
List the metadata components and properties of a specified type. Use this command to identify individual components in your manifest file or if you want a high-level view of particular metadata types in your org. For example, you can use this command to return a list of names of all the CustomObject or Layout components in your org, then use this information in a retrieve command that returns a subset of these components. The username that you use to connect to the org must have the Modify All Data or Modify Metadata Through Metadata API Functions permission.
Inputs: input (required).
list_metadata_typesARead-onlyIdempotent
Display details about the metadata types that are enabled for your org. The information includes Apex classes and triggers, custom objects, custom fields on standard objects, tab sets that define an app, and many other metadata types. Use this information to identify the syntax needed for a element in a manifest file (package.xml). The username that you use to connect to the org must have the Modify All Data or Modify Metadata Through Metadata API Functions permission.
Inputs: input (required).
login_into_orgADestructive
Authenticate and login to a Salesforce org via web browser. This command opens a browser window for OAuth authentication flow, allowing you to securely connect to a Salesforce org. After successful authentication, the org credentials are stored locally by the Salesforce CLI for future use. Use isProduction=true for production/developer orgs (login.salesforce.com) or isProduction=false for sandboxes/scratch orgs (test.salesforce.com). The alias parameter creates a convenient shorthand name for accessing this org in subsequent commands. IMPORTANT: This tool requires both 'alias' and 'isProduction' parameters to be provided before execution - do not proceed until all required parameters are supplied.
Inputs: input (required).
logoutADestructive
Log out of a Salesforce org. Use targetOrg to logout of a specific org, or set all to true to logout of all orgs. The logout is performed with --no-prompt flag to avoid confirmation prompts. Be careful! If you log out of a scratch org without having access to its password, you can't access the scratch org again, either through the CLI or the Salesforce UI.
Inputs: input (required).
openARead-onlyIdempotent
Open your Salesforce org in a browser. To open a specific page, specify the portion of the URL after 'https://mydomain.my.salesforce.com' as the path value. Use sourceFile to open ApexPage, FlexiPage, Flow, or Agent metadata from your local project in the associated Builder.
Inputs: input (required).
open_recordBRead-onlyIdempotent
Opens a Salesforce record in a browser.
Inputs: input (required).
package_installBDestructive
Install or upgrade a package version in a Salesforce org. Supports both package IDs (04t) and aliases with various configuration options.
Inputs: input (required).
package_uninstallCDestructive
Uninstall a second-generation package from the target org. Specify the package ID (starts with 04t) or alias for the package to uninstall.
Inputs: input (required).
query_recordsARead-onlyIdempotent
Query records from a SINGLE Salesforce object using structured field conditions. Use this for precise queries on ONE object with specific field criteria (e.g., Status = 'Open', Amount > 1000). NOT for text searches across multiple objects - use search_records for that. This executes SOQL queries with SELECT, WHERE, ORDER BY, and LIMIT clauses on a single SObject. The results are returned in JSON format. IMPORTANT: Always execute the sobject_list tool first to understand which objects are available in the org, and optionally execute sobject_describe for the specific SObject to understand its fields and structure before querying.
Inputs: input (required). Returns: records, targetOrg
query_records_to_fileARead-only
Query records from a Salesforce SObject and save to a file. This command allows you to execute a SOQL query against a specified Salesforce SObject in a given Org and save the results to a file. You can specify the SELECT clause (fields, functions like COUNT(), aggregations, etc.), an optional WHERE clause, and save the results in various formats. The results can be saved in CSV format by default, or in other formats if specified. IMPORTANT: Always execute the sobject_list tool first to understand which objects are available in the org, and optionally execute sobject_describe for the specific SObject to understand its fields and structure before querying.
Inputs: input (required).
run_apex_testsBDestructive
Run Apex tests in a Salesforce Org. This command allows you to execute unit tests with various options including test level, specific classes, suites, and code coverage collection. Tests can be run synchronously or asynchronously. Use this to validate your Apex code and ensure proper test coverage.
Inputs: input (required).
run_code_analyzerADestructive
Analyze code for quality and security issues. Run list_code_analyzer_rules first to select appropriate rules for ruleSelector parameter.
Inputs: input (required).
scanner_runCDestructive
Scan codebase with security and quality rules. Defaults to all rules if none specified.
Inputs: input (required).
scanner_run_dfaCDestructive
Run Graph Engine for Apex data flow analysis. Detects complex security issues like SOQL/SQL injection.
Inputs: input (required).
schema_generate_tabCDestructive
Generate metadata source files for a new custom tab on a custom object. Custom tabs display custom object data in Salesforce navigation.
Inputs: input (required).
search_recordsARead-only
Search for text across multiple Salesforce objects simultaneously. USE THIS TOOL when searching for records that mention, contain, or reference specific text (like company names, keywords, phrases) across different objects. This is the PRIMARY tool for text-based searches across your org - it's much more efficient than running multiple SOQL queries. Perfect for finding all records mentioning a competitor, customer name, or any text across Accounts, Opportunities, Cases, Contacts, etc. SOSL (Salesforce Object Search Language) performs full-text search across all searchable fields.
Inputs: input (required).
set_default_orgADestructiveIdempotent
Set the default target org for the Salesforce CLI. Once set, all tools will use this org by default when no targetOrg is specified. The value persists across sessions.
Inputs: input (required).
sobject_describeARead-onlyIdempotent
Describe a Salesforce SObject. This command retrieves detailed metadata about a specific Salesforce SObject, including its fields, relationships, and other properties. The results are returned in JSON format, providing a comprehensive view of the SObject's structure. Use this command to understand the schema of a specific SObject, which is especially useful when writing Apex code or SOQL queries that interact with that SObject. Always execute this tool before querying or manipulating records in the SObject to ensure you have the correct field names and types.
Inputs: input (required). Returns: name, label, custom, fields, +5 more
sobject_listARead-onlyIdempotent
List all standard and custom objects in a Salesforce Org. This command retrieves a list of all standard and custom objects available in the specified Salesforce Org. The results are returned in JSON format, providing details about each object, including its name, label, and other metadata. Use this command to explore the objects in your Salesforce Org and understand their structure and properties, especially if asked to work with specific objects in your Apex code or SOQL queries and you don't know their API names. Always execute this tool before writing Apex code or SOQL queries to ensure you have the correct object names.
Inputs: input (required). Returns: sobjects, targetOrg
update_recordBDestructiveIdempotent
Update an existing record in a Salesforce org using the REST API. Updates specified fields on the record. Input must be a JSON object with keys: sObject (string), recordId (string), recordJson (string), and optionally targetOrg (string).
Inputs: input (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 47 tools
Most tools target clearly distinct resources and actions, and descriptions include explicit cross-references (e.g., query_records defers to search_records; sobject_list advises running before queries). However, run_code_analyzer vs scanner_run/scanner_run_dfa overlap in code quality/security scanning, and the metadata listing tools (sobject_list, list_metadata, list_metadata_types) can be confused. These overlaps are mostly mitigated by detailed guidance, so the set is largely distinct.
Many tools follow a verb_noun pattern (create_record, run_apex_tests, list_metadata), but a substantial minority use noun_verb or noun_noun (sobject_list, apex_get_log, bulk_job_status, scanner_run, package_install, schema_generate_tab). This mix reduces predictability even though the names remain readable. The convention is inconsistent enough to matter.
47 tools is far above the typical well-scoped range and includes several fragmented utilities (multiple code analyzers, multiple metadata listers, separate default-org get/set/clear). While Salesforce is a broad domain, the count is heavy and over-fragmented, creating unnecessary selection overhead for agents.
The surface covers core workflows well: org auth, record CRUD, bulk insert/update/upsert/delete, SOQL/SOSL query, Apex execute/tests/logs, metadata list/deploy, package install/uninstall, permissions, and code analysis. Notable gaps remain, such as metadata retrieve (pull from org) and scratch org create/delete, plus no direct get-record-by-Id (though query covers it). These are workable gaps in an otherwise comprehensive surface.
Maintenance
Related MCP Connectors
Plan Salesforce deploys, open pull requests and trigger pipelines from your AI client.
Connect assistants to your workspace knowledge, skills, and work tools.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables secure interaction with Salesforce orgs through LLMs, providing tools for managing orgs, querying data, deploying metadata, running tests, and performing code analysis with granular access control and encrypted authentication.Apache 2.0
- AlicenseAqualityCmaintenanceEnables interaction with Salesforce orgs to perform operations like querying data with SOQL, managing records, and executing Apex code. It provides configurable access levels and support for both standard and Tooling APIs via natural language interfaces.11MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Salesforce organizations through project-based CLI integration, allowing execution of Apex, SOQL queries, object descriptions, and org management using local Salesforce DX project configurations.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Salesforce orgs through natural language commands, supporting org management, SOQL queries, metadata operations, testing, and more.1MIT