Prerequisites: Set Up Salesforce Hosted MCP Servers
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.
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.
- From Setup, in the Quick Find box, enter external client, and then select External Client App Manager.
- Click New External Client App.
- Fill out the Basic Information section.
- Expand the section labeled API (Enable OAuth Settings) and click the Enable OAuth checkbox.
-
In Callback URL, enter http://localhost:8080/oauth/callback.
For other clients, consult the provider’s documentation for the callback URL.
- 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.
-
Under Security:
- Select Issue JSON Web Token (JWT)-based access tokens for named users.
- Select Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows.
- Deselect all other options.
- Click Create.
-
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:
- Log out of all other Salesforce orgs.
-
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.
- Keep the browser open, since the MCP client will open a new tab in that browser window in a later step.