Prerequisites: Set Up Salesforce Hosted MCP Servers

The Salesforce API Context MCP server is one of many Salesforce Hosted MCP Servers. To use the Salesforce API Context MCP server, you must first set up the Salesforce Hosted MCP Server.

Activate the MCP Server

Activate the API Context MCP Server in your org.
  1. From Setup, in the Quick Find box, enter MCP Servers, and then select MCP Servers.
  2. Click salesforce-api-context and click Activate.

Create an External Client App

External client apps enable third-party applications to integrate with Salesforce using APIs and security protocols. You need an external client app if you’re using these tools with any MCP client other than Agentforce Vibes. Skip this step if you’re using the API Context tools in Agentforce Vibes.
In this Quick Start, we provide the steps to use Cursor as your MCP client. Cursor is an AI-driven coding editor that supports MCP. To use Cursor as your MCP client, you must install Node.js. After installing Node.js, confirm that your installation was successful by running the commands node -v and npm -v from the command line.
  1. From Setup, in the Quick Find box, enter external client, and then select External Client App Manager.
  2. Click New External Client App.
  3. Fill out the Basic Information section.
  4. Expand the section labeled API (Enable OAuth Settings) and click the Enable OAuth checkbox.
  5. In Callback URL, enter http://localhost:8080/oauth/callback.
    For other clients, consult the provider’s documentation for the callback URL.
  6. In OAuth Scopes, add the Manage user data via APIs (api), Access the Salesforce API Platform (sfap_api) and Perform requests at any time (refresh_token, offline_access) scopes. If you’re using prompt templates, add the Access Einstein GPT services (einstein_gpt_api) scope.
  7. Under Security:
    1. Select Issue JSON Web Token (JWT)-based access tokens for named users.
    2. Select Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows.
    3. Deselect all other options.
  8. Click Create.
  9. Click Settings, then click Consumer Key and Secret under OAuth Settings to get the consumer key.
    Store the consumer key for later use.

Log Into Your Target Org

When you configure your MCP client and initiate its authentication, it opens a web browser to authenticate into your org via OAuth. To prepare for this, additional steps are sometimes needed for the authentication to succeed. Since the MCP spec doesn't have special provisions for systems like Salesforce with multiple tenants, we recommend the following steps:
  1. Log out of all other Salesforce orgs.
  2. Using your default browser, log into the org that you want to access from your MCP client.
    This should be the org in which you created the External Client App in the previous section.
  3. Keep the browser open, since the MCP client will open a new tab in that browser window in a later step.