home / mcp / salesforce mcp server
Provides natural language access to Salesforce data and metadata via an MCP server.
Configuration
View docs{
"mcpServers": {
"jeresalguero30-mcp-server-salesforce": {
"command": "npx",
"args": [
"-y",
"@tsmztech/mcp-server-salesforce"
],
"env": {
"SALESFORCE_TOKEN": "your_security_token",
"SALESFORCE_PASSWORD": "your_password",
"SALESFORCE_USERNAME": "your_username",
"SALESFORCE_CLIENT_ID": "abcd1234...",
"SALESFORCE_INSTANCE_URL": "org_url",
"SALESFORCE_CLIENT_SECRET": "abcd1234...",
"SALESFORCE_CONNECTION_TYPE": "User_Password"
}
}
}
}You can connect Claude to Salesforce through a dedicated MCP (Model Context Protocol) server, letting you query, modify, and manage Salesforce data and metadata using natural language. This server translates your commands into Salesforce actions, helping you work with objects, records, Apex code, and more without writing SOQL or DML by hand.
With this MCP server you can perform end-to-end Salesforce tasks using plain language. Ask it to search for objects, describe schemas, query records with relationships, insert or update data, manage Apex code and triggers, or adjust field permissions. The server understands SOSL-style searches across objects, supports aggregate queries, and provides clear Salesforce-specific error feedback so you know exactly what needs fixing.
Typical usage patterns include asking for a comprehensive schema of an object, running complex data queries across related objects, creating or updating custom objects and fields, and reading or modifying Apex classes and triggers. You can also enable and review debug logs for troubleshooting, and use field-level security controls to manage who can see or edit specific fields.
Prerequisites: make sure you have Node.js and npm installed on your machine.
Install the MCP server package globally so you can run the MCP server from anywhere.
npm install -g @tsmztech/mcp-server-salesforceConfigure your Claude Desktop client to load the Salesforce MCP server. You will run the MCP server using a local command and provide Salesforce authentication details so Claude can access your Salesforce instance.
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["-y", "@tsmztech/mcp-server-salesforce"],
"env": {
"SALESFORCE_CONNECTION_TYPE": "User_Password",
"SALESFORCE_USERNAME": "your_username",
"SALESFORCE_PASSWORD": "your_password",
"SALESFORCE_TOKEN": "your_security_token",
"SALESFORCE_INSTANCE_URL": "org_url" // Optional. Default value: https://login.salesforce.com
}
}
}
}If you prefer OAuth 2.0 Client Credentials, use these settings in Claude Desktop instead. You will need the client credentials and the exact Salesforce instance URL.
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["-y", "@tsmztech/mcp-server-salesforce"],
"env": {
"SALESFORCE_CONNECTION_TYPE": "OAuth_2.0_Client_Credentials",
"SALESFORCE_CLIENT_ID": "your_client_id",
"SALESFORCE_CLIENT_SECRET": "your_client_secret",
"SALESFORCE_INSTANCE_URL": "https://your-domain.my.salesforce.com" // REQUIRED: exact instance URL
}
}
}
}If you want to run an HTTP endpoint for local testing, you can start a dedicated HTTP server as shown in the setup flow. After you build, run the local server with this command.
node start-http.cjsOnce the HTTP server is running, you can send requests to the local endpoint to query Salesforce data. This enables quick, scriptable interactions during development and testing.
Your Salesforce connection details are stored in the environment for the MCP server session. Treat these credentials as secret and limit their exposure. Use appropriate Salesforce security settings and profiles to control access to data and operations.
Search for standard and custom Salesforce objects by partial name matches across standard and custom objects.
Retrieve detailed object schema including fields, relationships, picklist values, and metadata.
Query Salesforce records with support for parent-child and child-parent relationships and complex WHERE conditions.
Execute aggregate queries with GROUP BY, COUNT, SUM, AVG, and HAVING clauses.
Insert, update, delete, and upsert records, including using external IDs.
Create and modify custom Salesforce objects and configure sharing settings.
Manage custom fields, including adding relationships and picklists, with default Field Level Security for admins.
Manage Field Level Security for profiles, including bulk updates and views.
SOSL-based search across multiple objects with field snippets.
Read Apex classes and metadata, with wildcards in name patterns.
Create and update Apex classes and set API versions.
Read Apex triggers and metadata with wildcard name matching.
Create or update Apex triggers for specific objects and events.
Execute anonymous Apex code and review debug logs.
Manage debug logs for Salesforce users and configure log levels.