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.
Features
A Salesforce connector MCP Server.
2026-11-17
星數
—
工具
—
可用率
—
Object and Field Management: Create and modify custom objects and fields using natural language
Smart Object Search: Find Salesforce objects using partial name matches
Detailed Schema Information: Get comprehensive field and relationship details for any object
Flexible Data Queries: Query records with relationship support and complex filters
Data Manipulation: Insert, update, delete, and upsert records with ease
Cross-Object Search: Search across multiple objects using SOSL
Apex Code Management: Read, create, and update Apex classes and triggers
Intuitive Error Handling: Clear feedback with Salesforce-specific error details
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).
Installation
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). 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:
Example: "Enable debug logs for [email protected]" or "Retrieve recent logs for an admin user"
Setup
Salesforce Authentication
You can connect to Salesforce using one of three authentication methods:
1. Username/Password Authentication (Default)
Set up your Salesforce credentials
Get your security token (Reset from Salesforce Settings)
2. OAuth 2.0 Client Credentials Flow
Create a Connected App in Salesforce
Enable OAuth settings and select "Client Credentials Flow"
Set appropriate scopes (typically "api" is sufficient)
Save the Client ID and Client Secret
Important: Note your instance URL (e.g., https://your-domain.my.salesforce.com) as it's required for authentication
3. Salesforce CLI Authentication (Recommended for local/dev) (contribution by @andrea9293)
Install and authenticate Salesforce CLI (sf).
Make sure your org is authenticated and accessible via sf org display --json in the root of your Salesforce project.
The server will automatically retrieve the access token and instance url using the CLI.
Optional: Salesforce API Version
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:
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.
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.
Running with Docker
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.
"Find all objects related to Accounts"
"Show me objects that handle customer service"
"What objects are available for order management?"
Getting Schema Information
"What fields are available in the Account object?"
"Show me the picklist values for Case Status"
"Describe the relationship fields in Opportunity"
Querying Records
"Get all Accounts created this month"
"Show me high-priority Cases with their related Contacts"
"Find all Opportunities over $100k"
Aggregate Queries
"Count opportunities by stage"
"Show me the total revenue by account"
"Find accounts with more than 10 opportunities"
"Calculate average deal size by sales rep and quarter"
"Get the number of cases by priority and status"
Managing Custom Objects
"Create a Customer Feedback object"
"Add a Rating field to the Feedback object"
"Update sharing settings for the Service Request object"
Examples with Field Level Security:
# Default - grants access to System Administrator automatically
"Create a Status picklist field on Custom_Object__c"
# Custom profiles - grants access to specified profiles
"Create a Revenue currency field on Account and grant access to Sales User and Marketing User profiles"
Managing Field Permissions
"Grant System Administrator access to Custom_Field__c on Account"
"Give read-only access to Rating__c field for Sales User profile"
"View which profiles have access to the Custom_Field__c"
"Revoke field access for specific profiles"
Searching Across Objects
"Search for 'cloud' in Accounts and Opportunities"
"Find mentions of 'network issue' in Cases and Knowledge Articles"
"Search for customer name across all relevant objects"
Managing Apex Code
"Show me all Apex classes with 'Controller' in the name"
"Get the full code for the AccountService class"
"Create a new Apex utility class for handling date operations"
"Update the LeadConverter class to add a new method"
Managing Apex Triggers
"List all triggers for the Account object"
"Show me the code for the ContactTrigger"
"Create a new trigger for the Opportunity object"
"Update the Case trigger to handle after delete events"
Executing Anonymous Apex Code
"Execute Apex code to calculate account metrics"
"Run a script to update related records"
"Execute a batch job to process large datasets"
Managing Debug Logs
"Enable debug logs for [email protected]"
"Retrieve recent logs for an admin user"
"Disable debug logs for a specific user"
"Configure log level to DEBUG for a user"
Development
Building from source
# Clone the repository
git clone https://github.com/tsmztech/mcp-server-salesforce.git
# Navigate to directory
cd mcp-server-salesforce
# Install dependencies
npm install
# Build the project
npm run build
Contributing
Contributions are welcome! Feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Issues and Support
If you encounter any issues or need support, please file an issue on the GitHub repository.