Skip to content
Back to search

mcp-server-salesforce

Salesforce MCP Server

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/tsmztech/mcp-server-salesforce with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/tsmztech/mcp-server-salesforce'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/tsmztech--mcp-server-salesforce/badge.svg)](/listings/tsmztech--mcp-server-salesforce)

HTML

<a href="/listings/tsmztech--mcp-server-salesforce"><img src="/api/listings/tsmztech--mcp-server-salesforce/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Requirements

- **Node.js 22+** (jsforce 3.10.17 and later depend on undici 8, which needs Node 22; on Node 20 the server fails at startup). The server must run under Node — **bun is not supported**: jsforce's HTTP transport hangs under bun, so authentication appears to succeed but every Salesforce API call stalls until the MCP host times out (see [#118](https://github.com/tsmztech/mcp-server-salesforce/issues/118)). Use `npx`/`node` (not `bun x`) in your MCP client configuration.

Global Installation (npm)

npm install -g @tsmztech/mcp-server-salesforce

Claude Desktop Quick Installation

For easy setup with Claude Desktop, download the pre-configured extension:

1. Download [`salesforce-mcp-extension.dxt`](./claude-desktop/salesforce-mcp-extension.dxt) from the `claude-desktop/` folder 2. Open Claude Desktop → Settings → Extensions 3. Drag the `.dxt` file into the Extensions window 4. Configure your Salesforce credentials when prompted

For manual Claude Desktop configuration, see [Usage with Claude Desktop](#usage-with-claude-desktop) below.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 495 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Salesforce MCP Server
  2. [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/tsmztech/mcp-server-salesforce/badge)](https://securityscorecards.dev/viewer/?uri=github.com/tsmztech/mcp-server-salesforce)
  3. An MCP (Model Context Protocol) server implementation that integrates Claude with Salesforce, enabling natural language interactions with your Salesforce data and metadata. This server allows Claude to query, modify, and manage your Salesforce objects and records using everyday language.
  4. <a href="https://glama.ai/mcp/servers/kqeniawbr6">
  5. <img width="380" height="200" src="https://glama.ai/mcp/servers/kqeniawbr6/badge" alt="Salesforce Server MCP server" />
  6. </a>
  7. ## Features
  8. * **Object and Field Management**: Create and modify custom objects and fields using natural language
  9. * **Smart Object Search**: Find Salesforce objects using partial name matches
  10. * **Detailed Schema Information**: Get comprehensive field and relationship details for any object
  11. * **Flexible Data Queries**: Query records with relationship support and complex filters
  12. * **Data Manipulation**: Insert, update, delete, and upsert records with ease
  13. * **Cross-Object Search**: Search across multiple objects using SOSL
  14. * **Apex Code Management**: Read, create, and update Apex classes and triggers
  15. * **Intuitive Error Handling**: Clear feedback with Salesforce-specific error details
  16. * **Switchable Authentication**: Supports multiple orgs. Easily switch your active Salesforce org based on the default org configured in your VS Code workspace (use Salesforce_CLI authentication for this feature).
  17. ## Installation
  18. ### Requirements
  19. - **Node.js 22+** (jsforce 3.10.17 and later depend on undici 8, which needs Node 22; on Node 20 the server fails at startup). The server must run under Node — **bun is not supported**: jsforce's HTTP transport hangs under bun, so authentication appears to succeed but every Salesforce API call stalls until the MCP host times out (see [#118](https://github.com/tsmztech/mcp-server-salesforce/issues/118)). Use `npx`/`node` (not `bun x`) in your MCP client configuration.
  20. ### Global Installation (npm)
  21. ```bash
  22. npm install -g @tsmztech/mcp-server-salesforce
  23. ```
  24. ### Claude Desktop Quick Installation
  25. For easy setup with Claude Desktop, download the pre-configured extension:
  26. 1. Download [`salesforce-mcp-extension.dxt`](./claude-desktop/salesforce-mcp-extension.dxt) from the `claude-desktop/` folder
  27. 2. Open Claude Desktop → Settings → Extensions
  28. 3. Drag the `.dxt` file into the Extensions window
  29. 4. Configure your Salesforce credentials when prompted
  30. For manual Claude Desktop configuration, see [Usage with Claude Desktop](#usage-with-claude-desktop) below.
  31. ## Tools
  32. ### salesforce_search_objects
  33. Search for standard and custom objects:
  34. * Search by partial name matches
  35. * Finds both standard and custom objects
  36. * Example: "Find objects related to Account" will find Account, AccountHistory, etc.
  37. ### salesforce_describe_object
  38. Get detailed object schema information:
  39. * Field definitions and properties
  40. * Relationship details
  41. * Picklist values
  42. * Example: "Show me all fields in the Account object"
  43. ### salesforce_query_records
  44. Query records with relationship support:
  45. * Parent-to-child relationships
  46. * Child-to-parent relationships
  47. * Complex WHERE conditions
  48. * Example: "Get all Accounts with their related Contacts"
  49. * Note: For queries with GROUP BY or aggregate functions, use salesforce_aggregate_query
  50. ### salesforce_aggregate_query
  51. Execute aggregate queries with GROUP BY:
  52. * GROUP BY single or multiple fields
  53. * Aggregate functions: COUNT, COUNT_DISTINCT, SUM, AVG, MIN, MAX
  54. * HAVING clauses for filtering grouped results
  55. * Date/time grouping functions
  56. * Example: "Count opportunities by stage" or "Find accounts with more than 10 opportunities"
  57. ### salesforce_dml_records
  58. Perform data operations:
  59. * Insert new records
  60. * Update existing records
  61. * Delete records
  62. * Upsert using external IDs
  63. * Example: "Update status of multiple accounts"
  64. ### salesforce_manage_object
  65. Create and modify custom objects:
  66. * Create new custom objects
  67. * Update object properties
  68. * Configure sharing settings
  69. * Example: "Create a Customer Feedback object"
  70. ### salesforce_manage_field
  71. Manage object fields:
  72. * Add new custom fields
  73. * Modify field properties
  74. * Create relationships
  75. * Automatically grants Field Level Security to System Administrator by default
  76. * Use `grantAccessTo` parameter to specify different profiles
  77. * Example: "Add a Rating picklist field to Account"
  78. ### salesforce_manage_field_permissions
  79. Manage Field Level Security (Field Permissions):
  80. * Grant or revoke read/edit access to fields for specific profiles
  81. * View current field permissions
  82. * Bulk update permissions for multiple profiles
  83. * Useful for managing permissions after field creation or for existing fields
  84. * Example: "Grant System Administrator access to Custom_Field__c on Account"
  85. ### salesforce_search_all
  86. Search across multiple objects:
  87. * SOSL-based search
  88. * Multiple object support
  89. * Field snippets
  90. * Example: "Search for 'cloud' across Accounts and Opportunities"
  91. ### salesforce_read_apex
  92. Read Apex classes:
  93. * Get full source code of specific classes
  94. * List classes matching name patterns
  95. * View class metadata (API version, status, etc.)
  96. * Support for wildcards (* and ?) in name patterns
  97. * Example: "Show me the AccountController class" or "Find all classes matching Account*Cont*"
  98. ### salesforce_write_apex
  99. Create and update Apex classes:
  100. * Create new Apex classes
  101. * Update existing class implementations
  102. * Specify API versions
  103. * Example: "Create a new Apex class for handling account operations"
  104. ### salesforce_read_apex_trigger
  105. Read Apex triggers:
  106. * Get full source code of specific triggers
  107. * List triggers matching name patterns
  108. * View trigger metadata (API version, object, status, etc.)
  109. * Support for wildcards (* and ?) in name patterns
  110. * Example: "Show me the AccountTrigger" or "Find all triggers for Contact object"
  111. ### salesforce_write_apex_trigger
  112. Create and update Apex triggers:
  113. * Create new Apex triggers for specific objects
  114. * Update existing trigger implementations
  115. * Specify API versions and event operations
  116. * Example: "Create a new trigger for the Account object" or "Update the Lead trigger"
  117. ### salesforce_execute_anonymous
  118. Execute anonymous Apex code:
  119. * Run Apex code without creating a permanent class
  120. * View debug logs and execution results
  121. * Useful for data operations not directly supported by other tools
  122. * Example: "Execute Apex code to calculate account metrics" or "Run a script to update related records"
  123. ### salesforce_manage_debug_logs
  124. Manage debug logs for Salesforce users:
  125. * Enable debug logs for specific users
  126. * Disable active debug log configurations
  127. * Retrieve and view debug logs
  128. * Configure log levels (NONE, ERROR, WARN, INFO, DEBUG, FINE, FINER, FINEST)
  129. * Example: "Enable debug logs for user@example.com" or "Retrieve recent logs for an admin user"
  130. ## Setup
  131. ### Salesforce Authentication
  132. You can connect to Salesforce using one of three authentication methods:
  133. #### 1. Username/Password Authentication (Default)
  134. 1. Set up your Salesforce credentials
  135. 2. Get your security token (Reset from Salesforce Settings)
  136. #### 2. OAuth 2.0 Client Credentials Flow
  137. 1. Create a Connected App in Salesforce
  138. 2. Enable OAuth settings and select "Client Credentials Flow"
  139. 3. Set appropriate scopes (typically "api" is sufficient)
  140. 4. Save the Client ID and Client Secret
  141. 5. **Important**: Note your instance URL (e.g., `https://your-domain.my.salesforce.com`) as it's required for authentication
  142. #### 3. Salesforce CLI Authentication (Recommended for local/dev) (contribution by @andrea9293)
  143. 1. Install and authenticate Salesforce CLI (`sf`).
  144. 2. Make sure your org is authenticated and accessible via `sf org display --json` in the root of your Salesforce project.
  145. 3. The server will automatically retrieve the access token and instance url using the CLI.
  146. ### Optional: Salesforce API Version
  147. By default, the server uses the jsforce library's default Salesforce API version, which may be too old for newer standard objects (for example, `AccountPlan` requires API version 62.0+ and fails with `sObject type 'AccountPlan' is not supported`). Set the `SALESFORCE_API_VERSION` environment variable to pin a specific version with any authentication method:
  148. ```json
  149. "env": {
  150. "SALESFORCE_CONNECTION_TYPE": "...",
  151. "SALESFORCE_API_VERSION": "62.0"
  152. }
  153. ```
  154. The value must look like `"62.0"` (major version dot minor version).
  155. ### Usage with Claude Desktop
  156. Add to your `claude_desktop_config.json`:
  157. #### For Salesforce CLI Authentication:
  158. ```json
  159. {
  160. "mcpServers": {
  161. "salesforce": {
  162. "command": "npx",
  163. "args": ["-y", "@tsmztech/mcp-server-salesforce"],
  164. "env": {
  165. "SALESFORCE_CONNECTION_TYPE": "Salesforce_CLI"
  166. }
  167. }
  168. }
  169. }
  170. ```
  171. #### For Username/Password Authentication:
  172. ```json
  173. {
  174. "mcpServers": {
  175. "salesforce": {
  176. "command": "npx",
  177. "args": ["-y", "@tsmztech/mcp-server-salesforce"],
  178. "env": {
  179. "SALESFORCE_CONNECTION_TYPE": "User_Password",
  180. "SALESFORCE_USERNAME": "your_username",
  181. "SALESFORCE_PASSWORD": "your_password",
  182. "SALESFORCE_TOKEN": "your_security_token",
  183. "SALESFORCE_INSTANCE_URL": "org_url" // Optional. Default value: https://login.salesforce.com
  184. }
  185. }
  186. }
  187. }
  188. ```
  189. #### For OAuth 2.0 Client Credentials Flow:
  190. ```json
  191. {
  192. "mcpServers": {
  193. "salesforce": {
  194. "command": "npx",
  195. "args": ["-y", "@tsmztech/mcp-server-salesforce"],
  196. "env": {
  197. "SALESFORCE_CONNECTION_TYPE": "OAuth_2.0_Client_Credentials",
  198. "SALESFORCE_CLIENT_ID": "your_client_id",
  199. "SALESFORCE_CLIENT_SECRET": "your_client_secret",
  200. "SALESFORCE_INSTANCE_URL": "https://your-domain.my.salesforce.com" // REQUIRED: Must be your exact Salesforce instance URL
  201. }
  202. }
  203. }
  204. }
  205. ```
  206. > **Note**: For OAuth 2.0 Client Credentials Flow, the `SALESFORCE_INSTANCE_URL` must be your exact Salesforce instance URL (e.g., `https://your-domain.my.salesforce.com`). The token endpoint will be constructed as `<instance_url>/services/oauth2/token`.
  207. #### For Direct Access Token Authentication:
  208. ```json
  209. {
  210. "mcpServers": {
  211. "salesforce": {
  212. "command": "npx",
  213. "args": ["-y", "@tsmztech/mcp-server-salesforce"],
  214. "env": {
  215. "SALESFORCE_CONNECTION_TYPE": "Access_Token",
  216. "SALESFORCE_INSTANCE_URL": "https://your-domain.my.salesforce.com",
  217. "SALESFORCE_ACCESS_TOKEN": "your_access_token"
  218. }
  219. }
  220. }
  221. }
  222. ```
  223. > **Note**: Use `Access_Token` when the OAuth access token is provisioned by an external system (an SSO gateway, the SF CLI on another machine, a refresh-token-based proxy, etc.) and only the resulting access token + instance URL are available at runtime. The server skips the OAuth handshake and uses the provided token directly.
  224. ## Running with Docker
  225. You can run this MCP server inside a Docker container. Because the server communicates over `stdio` (standard input/output), the container is typically executed interactively by an MCP client using `docker run -i`.
  226. ### 1. Clone the Repo
  227. ```bash
  228. git clone https://github.com/tsmztech/mcp-server-salesforce.git
  229. ```
  230. ### 2. Navigate to directory
  231. ```bash
  232. cd mcp-server-salesforce
  233. ```
  234. ### 3. Build the Image
  235. ```bash
  236. docker build -t mcp-server-salesforce .
  237. ```
  238. ### 4. Authentication in Containers
  239. > [!NOTE]
  240. > The Salesforce CLI (`sf`) web-based OAuth login flow is unavailable inside headless Docker containers.
  241. >
  242. > When running containerized, use one of the supported environment-variable based authentication methods:
  243. >
  244. > - **Username & Password Authentication**
  245. > - `SALESFORCE_CONNECTION_TYPE=User_Password`
  246. > - `SALESFORCE_USERNAME`
  247. > - `SALESFORCE_PASSWORD`
  248. > - `SALESFORCE_TOKEN`
  249. >
  250. > - **OAuth 2.0 Client Credentials Flow**
  251. > - `SALESFORCE_CONNECTION_TYPE=OAuth_2.0_Client_Credentials`
  252. > - `SALESFORCE_CLIENT_ID`
  253. > - `SALESFORCE_CLIENT_SECRET`
  254. > - `SALESFORCE_INSTANCE_URL`
  255. >
  256. > - **Direct Access Token Authentication**
  257. > - `SALESFORCE_CONNECTION_TYPE=Access_Token`
  258. > - `SALESFORCE_ACCESS_TOKEN`
  259. > - `SALESFORCE_INSTANCE_URL`
  260. ### 5. MCP Client Configuration
  261. To register the containerized server with an MCP client (such as Claude Desktop), add the following configuration to your `claude_desktop_config.json`:
  262. ```json
  263. {
  264. "mcpServers": {
  265. "salesforce": {
  266. "command": "docker",
  267. "args": [
  268. "run",
  269. "-i",
  270. "--rm",
  271. "-e",
  272. "SALESFORCE_CONNECTION_TYPE=User_Password",
  273. "-e",
  274. "SALESFORCE_USERNAME=your_username",
  275. "-e",
  276. "SALESFORCE_PASSWORD=your_password",
  277. "-e",
  278. "SALESFORCE_TOKEN=your_security_token",
  279. "mcp-server-salesforce"
  280. ]
  281. }
  282. }
  283. }
  284. ```
  285. ### 6. Manual Testing
  286. You can test the containerized server directly from your terminal:
  287. ```bash
  288. docker run -i --rm \
  289. -e SALESFORCE_CONNECTION_TYPE="User_Password" \
  290. -e SALESFORCE_USERNAME="your_username" \
  291. -e SALESFORCE_PASSWORD="your_password" \
  292. -e SALESFORCE_TOKEN="your_security_token" \
  293. mcp-server-salesforce
  294. ```
  295. Once the container is running, you can send an MCP `initialize` JSON-RPC request through `stdin`:
  296. ```json
  297. {
  298. "jsonrpc": "2.0",
  299. "id": 1,
  300. "method": "initialize",
  301. "params": {
  302. "protocolVersion": "2024-11-05",
  303. "capabilities": {},
  304. "clientInfo": {
  305. "name": "test-client",
  306. "version": "1.0.0"
  307. }
  308. }
  309. }
  310. ```
  311. ## Example Usage
  312. ### Searching Objects
  313. ```
  314. "Find all objects related to Accounts"
  315. "Show me objects that handle customer service"
  316. "What objects are available for order management?"
  317. ```
  318. ### Getting Schema Information
  319. ```
  320. "What fields are available in the Account object?"
  321. "Show me the picklist values for Case Status"
  322. "Describe the relationship fields in Opportunity"
  323. ```
  324. ### Querying Records
  325. ```
  326. "Get all Accounts created this month"
  327. "Show me high-priority Cases with their related Contacts"
  328. "Find all Opportunities over $100k"
  329. ```
  330. ### Aggregate Queries
  331. ```
  332. "Count opportunities by stage"
  333. "Show me the total revenue by account"
  334. "Find accounts with more than 10 opportunities"
  335. "Calculate average deal size by sales rep and quarter"
  336. "Get the number of cases by priority and status"
  337. ```
  338. ### Managing Custom Objects
  339. ```
  340. "Create a Customer Feedback object"
  341. "Add a Rating field to the Feedback object"
  342. "Update sharing settings for the Service Request object"
  343. ```
  344. Examples with Field Level Security:
  345. ```
  346. # Default - grants access to System Administrator automatically
  347. "Create a Status picklist field on Custom_Object__c"
  348. # Custom profiles - grants access to specified profiles
  349. "Create a Revenue currency field on Account and grant access to Sales User and Marketing User profiles"
  350. ```
  351. ### Managing Field Permissions
  352. ```
  353. "Grant System Administrator access to Custom_Field__c on Account"
  354. "Give read-only access to Rating__c field for Sales User profile"
  355. "View which profiles have access to the Custom_Field__c"
  356. "Revoke field access for specific profiles"
  357. ```
  358. ### Searching Across Objects
  359. ```
  360. "Search for 'cloud' in Accounts and Opportunities"
  361. "Find mentions of 'network issue' in Cases and Knowledge Articles"
  362. "Search for customer name across all relevant objects"
  363. ```
  364. ### Managing Apex Code
  365. ```
  366. "Show me all Apex classes with 'Controller' in the name"
  367. "Get the full code for the AccountService class"
  368. "Create a new Apex utility class for handling date operations"
  369. "Update the LeadConverter class to add a new method"
  370. ```
  371. ### Managing Apex Triggers
  372. ```
  373. "List all triggers for the Account object"
  374. "Show me the code for the ContactTrigger"
  375. "Create a new trigger for the Opportunity object"
  376. "Update the Case trigger to handle after delete events"
  377. ```
  378. ### Executing Anonymous Apex Code
  379. ```
  380. "Execute Apex code to calculate account metrics"
  381. "Run a script to update related records"
  382. "Execute a batch job to process large datasets"
  383. ```
  384. ### Managing Debug Logs
  385. ```
  386. "Enable debug logs for user@example.com"
  387. "Retrieve recent logs for an admin user"
  388. "Disable debug logs for a specific user"
  389. "Configure log level to DEBUG for a user"
  390. ```
  391. ## Development
  392. ### Building from source
  393. ```bash
  394. # Clone the repository
  395. git clone https://github.com/tsmztech/mcp-server-salesforce.git
  396. # Navigate to directory
  397. cd mcp-server-salesforce
  398. # Install dependencies
  399. npm install
  400. # Build the project
  401. npm run build
  402. ```
  403. ## Contributing
  404. Contributions are welcome! Feel free to submit a Pull Request.
  405. ## License
  406. This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
  407. ## Issues and Support
  408. If you encounter any issues or need support, please file an issue on the [GitHub repository](https://github.com/tsmztech/mcp-server-salesforce/issues).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.