home / mcp / salesforce mcp server

Salesforce MCP Server

Provides natural language access to Salesforce data and metadata via an MCP server.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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-salesforce

Additional setup and usage notes

Configure 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
      }
    }
  }
}

Running a local HTTP server (optional for testing)

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.cjs

Example usage with the HTTP endpoint

Once 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.

Security and permissions

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.

Available tools

salesforce_search_objects

Search for standard and custom Salesforce objects by partial name matches across standard and custom objects.

salesforce_describe_object

Retrieve detailed object schema including fields, relationships, picklist values, and metadata.

salesforce_query_records

Query Salesforce records with support for parent-child and child-parent relationships and complex WHERE conditions.

salesforce_aggregate_query

Execute aggregate queries with GROUP BY, COUNT, SUM, AVG, and HAVING clauses.

salesforce_dml_records

Insert, update, delete, and upsert records, including using external IDs.

salesforce_manage_object

Create and modify custom Salesforce objects and configure sharing settings.

salesforce_manage_field

Manage custom fields, including adding relationships and picklists, with default Field Level Security for admins.

salesforce_manage_field_permissions

Manage Field Level Security for profiles, including bulk updates and views.

salesforce_search_all

SOSL-based search across multiple objects with field snippets.

salesforce_read_apex

Read Apex classes and metadata, with wildcards in name patterns.

salesforce_write_apex

Create and update Apex classes and set API versions.

salesforce_read_apex_trigger

Read Apex triggers and metadata with wildcard name matching.

salesforce_write_apex_trigger

Create or update Apex triggers for specific objects and events.

salesforce_execute_anonymous

Execute anonymous Apex code and review debug logs.

salesforce_manage_debug_logs

Manage debug logs for Salesforce users and configure log levels.