home / mcp / salesforce mcp server

Salesforce MCP Server

An MCP server that enables Claude to query, modify, and manage Salesforce data and metadata using natural language.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "simonl77-mcp-server-salesforce": {
      "command": "npx",
      "args": [
        "-y",
        "@tsmztech/mcp-server-salesforce"
      ],
      "env": {
        "SALESFORCE_TOKEN": "your_token",
        "SALESFORCE_PASSWORD": "your_password",
        "SALESFORCE_USERNAME": "[email protected]",
        "SALESFORCE_CLIENT_ID": "your_client_id",
        "SALESFORCE_INSTANCE_URL": "https://your-domain.my.salesforce.com",
        "SALESFORCE_CLIENT_SECRET": "your_client_secret",
        "SALESFORCE_CONNECTION_TYPE": "Salesforce_CLI"
      }
    }
  }
}

You can run a Salesforce MCP Server that lets Claude interact with Salesforce data and metadata using natural language. It supports querying, creating, updating, and managing Salesforce objects and records across multiple orgs, and works with Claude Desktop for easy local use.

How to use

You use the MCP server by launching it locally (via an MCP client) or running it through your development workflow, then asking Claude to perform actions against Salesforce. Common use cases include searching for objects, inspecting object schemas, querying records with relationships, performing data manipulation (insert, update, delete, upsert), running SOSL or aggregate queries, and managing Apex code and debug logs. Start by ensuring your MCP server is running, then instruct Claude with natural language prompts like: “Show me the fields on the Account object,” or “Update the status of the Lead opportunity.” The server translates your requests into Salesforce API calls and returns results with Salesforce-specific details when errors occur.

How to install

Prerequisites: you need Node.js and npm installed on your machine.

Install the MCP server globally with npm.

Steps to install and run the Salesforce MCP Server

# Install the MCP server globally
npm install -g @tsmztech/mcp-server-salesforce

# Start the server locally through your MCP client (using stdio/CLI flow)
npx -y @tsmztech/mcp-server-salesforce
```} ,{

Setup for Claude Desktop

If you use Claude Desktop, you can configure the Salesforce MCP server in Claude Desktop with pre-bundled or manual settings. You can configure the server to use Salesforce CLI authentication, Username/Password authentication, or OAuth 2.0 Client Credentials.

For Claude Desktop: Salesforce CLI authentication

{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": ["-y", "@tsmztech/mcp-server-salesforce"],
      "env": {
        "SALESFORCE_CONNECTION_TYPE": "Salesforce_CLI"
      }
    }
  }
}

For Claude Desktop: Username/Password authentication

{
  "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
      }
    }
  }
}

For Claude Desktop: OAuth 2.0 Client Credentials

{
  "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: Must be your exact Salesforce instance URL
      }
    }
  }
}

Available tools

salesforce_search_objects

Search for standard and custom Salesforce objects by partial name matches, covering both standard and custom objects.

salesforce_describe_object

Get detailed schema information for an object, including fields, relationships, and picklist values.

salesforce_query_records

Query records with support for parent-child and child-parent relationships and complex filters.

salesforce_aggregate_query

Execute aggregate queries with GROUP BY, HAVING, and date/time grouping.

salesforce_dml_records

Insert, update, delete, or upsert records, including using external IDs for upserts.

salesforce_manage_object

Create or modify custom objects and their properties, including sharing settings.

salesforce_manage_field

Add or modify custom fields and relationships, with default Field Level Security for System Administrator.

salesforce_manage_field_permissions

Manage Field Level Security for profiles, including granting or revoking access.

salesforce_search_all

SOSL-based search across multiple objects with field snippets.

salesforce_read_apex

Read Apex classes and related metadata, with wildcard support in name patterns.

salesforce_write_apex

Create or update Apex classes with API version control.

salesforce_read_apex_trigger

Read Apex triggers and their metadata with pattern matching.

salesforce_write_apex_trigger

Create or update Apex triggers for specified objects and events.

salesforce_execute_anonymous

Execute anonymous Apex code and view debug logs and results.

salesforce_manage_debug_logs

Enable, disable, and view debug logs and set log levels for users.