> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce AI connector

> Connect the Omni Agent to Salesforce's hosted MCP server to read and update Salesforce records.

The Salesforce connector gives the [Omni Agent](https://docs.omni.co/ai/chat.md) access to Salesforce's hosted MCP server. Each person signs in to Salesforce, and the agent can read and update records with that person's Salesforce permissions.

Salesforce doesn't let Omni register an app for you. You create an External Client App in Salesforce, and then add its consumer key to Omni.

## Requirements

* **Organization Admin** permissions in Omni
* **Permissions in Salesforce that allow you to**:
  * Turn on MCP servers
  * Create External Client Apps
* **For each person who wants to use the connector**, a Salesforce account

## Setup

### 1. Turn on the MCP server in Salesforce

1. Sign in to your Salesforce account.
2. In Salesforce **Setup**, search Quick Find for **MCP Servers**.
3. Turn on the server that you want the agent to use. For example, `platform/sobject-all` gives read and write access to records.

### 2. Create an External Client App

> [!NOTE]
>
> **Use an External Client App**. A classic Connected App doesn't work with Salesforce's MCP servers.

1. In **Setup**, navigate to **External Client App Manager**.
2. Click **New**.
3. Turn on OAuth, and set the following:
   * **Callback URL** - Copy and paste this URL:

     ```text theme={null}
     https://callbacks.omniapp.co/callback/mcp-client
     ```
   * **OAuth scopes** - Select `mcp_api` and `refresh_token`
   * **Require PKCE** - Set to **On**
   * **Issue JWT-based access tokens for named users** - Set to **On**
   * **Require secret for Web Server Flow** - Set to **Off**
   * **Require secret for Refresh Token Flow** - Set to **Off**
4. Save the app and copy the **Consumer Key**. This is the client ID.

Note that a new app can take up to 10 minutes to be ready.

### 3. Find your Salesforce MCP server URL

The format of your Salesforce MCP server URL varies depending on the type of org:

* For a **production org** - Use the following:

  ```text wrap theme={null}
  https://api.salesforce.com/platform/mcp/v1/platform/sobject-all
  ```
* For a **sandbox or developer org** - Your org has its own URL. Find your org's name in **Setup > My Domain** and use it in the URL. For example, for a developer org:

  ```text wrap theme={null}
  https://api.salesforce.com/platform/mcp/v1/d/<your-my-domain>/develop/platform/sobject-all
  ```

See [the Salesforce documentation](https://developer.salesforce.com/docs/platform/hosted-mcp-servers/guide/server-urls.html) for more information.

### 4. Add the Salesforce connector in Omni

1. Navigate to **AI Hub > Connectors**.
2. In the catalog, click **Salesforce**.
3. Fill in the following:
   * **Server URL** - Your MCP server URL from Step 3
   * **Client ID** - The consumer key from Step 2
   * **Client secret** - Leave blank, unless your app requires a secret
4. Click **Add**.

### 5. Connect your Salesforce account

Each person, including Organization Admins, must connect their own account and sign in to Salesforce before they can use the connector. This can happen from a few places in Omni:

* **The connector menu in the [Omni Agent](https://docs.omni.co/ai/chat.md)**. Click the  icon, then **Connectors**, and then **Connect** next to the connector.
* **From their user settings**. Connectors are listed in the [Connected services](https://docs.omni.co/administration/users/your-account.md#connected-services) section.

Organization Admins can also connect from the **Connectors** page in the AI Hub. If an admin hasn't connected their own account to a connector yet, they can click **Connect your account** in the connector's row.

To disconnect, see [Connected services](https://docs.omni.co/administration/users/your-account.md#connected-services) in **Your Account**.

## Troubleshooting

| Error | Cause and fix |
| - | - |
| `invalid_client_id` or **client identifier invalid** | The client ID is incorrect or the app is new. Copy the consumer key again and ensure there aren't any extra characters. If you created the app in the last 10 minutes, wait and try again. |
| `redirect_uri` mismatch | The app's callback URL isn't Omni's. Set it to `https://callbacks.omniapp.co/callback/mcp-client`. |

## Next steps

* [AI connector catalog](https://docs.omni.co/ai/connectors/catalog) - Add other connectors
* [Configuring an External Client App](https://github.com/forcedotcom/mcp-hosted/wiki/Configuring-an-External-Client-App) - Salesforce's guide
