Salesforce MCP Server Setup Guide
Salesforce MCP Server Setup Guide
Section titled “Salesforce MCP Server Setup Guide”Overview
Section titled “Overview”This guide walks you through setting up the Salesforce Platform MCP server with OAuth 2.1 authentication in LMA. Once connected, AI agents in LMA can query and interact with Salesforce data during meetings using the tools and prompts provided by Salesforce’s built-in MCP servers.
Prerequisites
Section titled “Prerequisites”- LMA deployed with OAuth 2.1 support (0.2.23 and above)
- A Salesforce org with the Platform MCP feature enabled (Developer Edition, Sandbox, or Production)
- Admin access to Salesforce Setup
Step 1: Get Your OAuth Callback URL
Section titled “Step 1: Get Your OAuth Callback URL”- Log into your LMA application
- Go to AWS CloudFormation console
- Find your LMA stack
- Go to the Outputs tab
- Copy the value of
OAuthCallbackUrl- Should look like:
https://your-cloudfront-domain.cloudfront.net/#/oauth/callback
- Should look like:
Step 2: Create Salesforce Connected App
Section titled “Step 2: Create Salesforce Connected App”2.1 Navigate to Setup
Section titled “2.1 Navigate to Setup”- Log into your Salesforce org
- Click the gear icon (⚙️) in the top right
- Select Setup
2.2 Create Connected App
Section titled “2.2 Create Connected App”- In the Quick Find box, search for “App Manager”
- Click New Connected App
- Fill in the basic information:
- Connected App Name:
LMA MCP Integration - API Name:
LMA_MCP_Integration(auto-filled) - Contact Email: Your email address
- Connected App Name:
2.3 Configure OAuth Settings
Section titled “2.3 Configure OAuth Settings”-
Check Enable OAuth Settings
-
Callback URL: Paste your OAuth Callback URL from Step 1
https://your-cloudfront-domain.cloudfront.net/#/oauth/callback -
Selected OAuth Scopes: Add these three scopes:
- ✅ Access Salesforce Platform MCP services (
mcp_api) - ✅ Perform requests at any time (
refresh_token,offline_access)
- ✅ Access Salesforce Platform MCP services (
-
Enable Authorization Code and Credentials Flow: ✅ Checked
-
Require Proof Key for Code Exchange (PKCE): ✅ Checked
-
Issue JSON Web Token (JWT)-based access tokens for named users: ✅ Checked
-
Refresh Token Policy:
- Select: Expire refresh token after specific time
- Refresh Token Validity Period:
365Days
-
Click Save
2.4 Get Consumer Key
Section titled “2.4 Get Consumer Key”- After saving, click Continue
- Click Manage Consumer Details
- Verify your identity (may require 2FA code)
- Copy the Consumer Key (this is your OAuth Client ID)
- Example:
[YOUR_CONSUMER_KEY_HERE]...
- Example:
- You don’t need the Consumer Secret for this flow (PKCE is used instead).
Step 3: Activate at Least One MCP Server in Salesforce
Section titled “Step 3: Activate at Least One MCP Server in Salesforce”Salesforce’s Platform MCP feature exposes a catalog of server definitions under Setup → MCP Servers. Activate the ones you want to use.
- In Salesforce Setup, search for MCP Servers
- Pick a server — common built-ins include:
- sobject-all — full CRUD + SOQL + SOSL (9 tools, 2 prompts)
- sobject-reads — read-only subset
- sobject-mutations — write-only subset
- sobject-deletes — delete-only subset
- metadata-experts — schema / describe helpers
- salesforce-api-context — Salesforce REST API context
- data-cloud-queries — CDP / Data Cloud
- engagement-interaction — engagement events
- Take note of the server’s API Name — e.g.,
platform.sobject-all. The dot in the API name becomes a slash in the URL path, soplatform.sobject-all→/platform/sobject-all. - Click Activate.
The Server URL to use in LMA is:
https://api.salesforce.com/platform/mcp/v1/platform/<server-api-name>For sobject-all that is:
https://api.salesforce.com/platform/mcp/v1/platform/sobject-allStep 4: Add Salesforce MCP Server in LMA
Section titled “Step 4: Add Salesforce MCP Server in LMA”4.1 Navigate to MCP Servers
Section titled “4.1 Navigate to MCP Servers”- Log into your LMA application
- Go to Configuration → MCP Servers
- Click the Custom Servers tab
4.2 Add Custom HTTP Server
Section titled “4.2 Add Custom HTTP Server”-
Fill in the server details:
- Server Name:
Salesforce(or any name you prefer) - Server URL:
https://api.salesforce.com/platform/mcp/v1/platform/sobject-all(replacesobject-allwith the API name of whichever MCP server you activated in Step 3) - Description (Optional):
Salesforce Platform MCP — sobject-all
- Server Name:
-
Check ✅ This server requires authentication
-
Click Add Server
4.3 Configure OAuth Authentication
Section titled “4.3 Configure OAuth Authentication”The authentication modal will open automatically:
-
Authentication Type: Select
OAuth 2.1 with PKCE (User Authorization) -
OAuth Provider: Select
Salesforce- Authorization and Token URLs are pre-filled with
https://login.salesforce.com/services/oauth2/{authorize,token} - Scopes are pre-filled with:
mcp_api refresh_token offline_access
- Authorization and Token URLs are pre-filled with
-
Client ID: Paste your Consumer Key from Step 2.4
-
Scopes: Verify the scopes are
mcp_api refresh_token offline_access -
Click Authorize with OAuth
4.4 Complete Authorization
Section titled “4.4 Complete Authorization”- A popup window will open with Salesforce login
- Log into your Salesforce org (if not already logged in)
- Review the permissions being requested
- Click Allow
- The popup will show ”✅ Authorization complete!” and close automatically
Step 5: Verify Installation
Section titled “Step 5: Verify Installation”5.1 Check Installed Servers
Section titled “5.1 Check Installed Servers”- Go to Configuration → MCP Servers
- Click the Installed Servers tab
- You should see your
Salesforceentry with:- Status:
ACTIVE - Package Type:
streamable-http - Authentication: OAuth 2.1
- Status:
5.2 Test in Chat
Section titled “5.2 Test in Chat”-
Start or join a meeting
-
Open the chat assistant
-
Ask:
"What Salesforce tools do you have?" -
For the
sobject-allserver you should see nine tools:getUserInfo— current user identitysoqlQuery— execute SOQLfind— SOSL cross-object searchgetObjectSchema— schema / describelistRecentSobjectRecords— recently viewed recordsgetRelatedRecords— parent→child traversalcreateSobjectRecord,updateSobjectRecord,updateRelatedRecord
-
Test a query:
"Who am I in Salesforce?"(invokesgetUserInfo) -
Or:
"List recent accounts in Salesforce"(invokeslistRecentSobjectRecords)
Troubleshooting
Section titled “Troubleshooting”Issue: 404 {"error":{"code":404,"message":"Server definition not found for: <name>"}}
Section titled “Issue: 404 {"error":{"code":404,"message":"Server definition not found for: <name>"}}”The MCP server name in the URL doesn’t match an activated server in your org.
Fix:
- The path segment after
/v1/must match the server’s API Name in Setup → MCP Servers, with dots replaced by slashes. Forplatform.sobject-allthe URL path ends with/platform/sobject-all. - Confirm the server is Active (not Inactive) in Setup → MCP Servers.
Issue: 403 {"error":{"code":403,"message":"OAuth invalid scope"}}
Section titled “Issue: 403 {"error":{"code":403,"message":"OAuth invalid scope"}}”The token does not have the mcp_api scope.
Fix:
- Add
mcp_api(plusrefresh_token/offline_access) to the Connected App’s Selected OAuth Scopes and save. - In LMA, delete and re-add (or re-authorize) the Salesforce MCP server so a fresh token is minted with the new scope. Refreshing the existing token will not pick up newly granted scopes — a full re-authorization is required.
Issue: 401 {"errors":[{"message":"Invalid token"}]}
Section titled “Issue: 401 {"errors":[{"message":"Invalid token"}]}”Token expired, issued for the wrong org, or missing the
https://api.salesforce.com audience.
Fix: Re-authorize from LMA. If the problem persists, confirm the
Connected App is in the correct org and that the JWT sfap_op claim
includes MCPService (org is entitled for Platform MCP).
Issue: redirect_uri_mismatch
Section titled “Issue: redirect_uri_mismatch”The callback URL in Salesforce doesn’t match the one being sent.
Fix:
- The callback URL in Salesforce must include the
#character:https://domain/#/oauth/callback.
Issue: invalid_client_id
Section titled “Issue: invalid_client_id”Wrong Consumer Key entered.
Fix:
- Go to Salesforce → App Manager → your Connected App → Manage Consumer Details, copy the correct Consumer Key, and re-enter it in LMA.
Token Management
Section titled “Token Management”Automatic Token Refresh
Section titled “Automatic Token Refresh”- Access tokens expire after 2 hours
- LMA automatically refreshes tokens 5 minutes before expiration using the stored refresh token
- Refresh tokens last 365 days (configurable in Salesforce)
- No manual intervention needed
Token Storage
Section titled “Token Storage”- Access and refresh tokens are encrypted with AWS KMS before being written to DynamoDB
- Only accessible by the LMA Lambda functions that connect to MCP servers
Available Salesforce MCP Servers and Tools
Section titled “Available Salesforce MCP Servers and Tools”The exact set of servers, tools and prompts depends on your org edition and
which servers you activate. For sobject-all in a current Developer org:
Tools
getUserInfo— current user identity, role, timezone, preferencessoqlQuery— execute a SOQL queryfind— SOSL cross-object text searchgetObjectSchema— LLM-optimized schema / describelistRecentSobjectRecords— recently viewed/modified recordsgetRelatedRecords— traverse parent→child relationshipscreateSobjectRecord— create a recordupdateSobjectRecord— update a record by IDupdateRelatedRecord— update a child record via parent navigation
Prompts
accountReviewBriefing— renders an account-review template (takesAccountName)revenueReconciliationAnalysis— renders a revenue-reconciliation template (takesLookback Days,Minimum Opportunity Amount)
The other read/write/metadata-specific servers (sobject-reads,
sobject-mutations, metadata-experts, salesforce-api-context,
data-cloud-queries, engagement-interaction) publish narrower subsets of
the above.
Security Considerations
Section titled “Security Considerations”OAuth 2.1 with PKCE
Section titled “OAuth 2.1 with PKCE”- PKCE (Proof Key for Code Exchange) protects against authorization code interception
- Required by Salesforce for public clients
Token Security
Section titled “Token Security”- Access and refresh tokens are encrypted with KMS before storage
- DynamoDB table encrypted at rest
- Tokens only accessible by authorized Lambda functions
- Tokens are scoped to the user who authorized (one token per user)
Permissions
Section titled “Permissions”- All MCP operations respect the authorized user’s Salesforce permissions and field-level security
- Access can be revoked from Salesforce Setup → Connected Apps OAuth Usage at any time
Revoking Access
Section titled “Revoking Access”- Go to Salesforce Setup
- Search for Connected Apps OAuth Usage
- Find LMA MCP Integration
- Click Revoke next to your username
- Delete the server in LMA
Advanced Configuration
Section titled “Advanced Configuration”Sandbox or My Domain
Section titled “Sandbox or My Domain”The MCP Server URL is always on the unified gateway:
https://api.salesforce.com/platform/mcp/v1/platform/<server-api-name>Salesforce routes the call to your org based on the bearer token; leave the
host as api.salesforce.com.
Your My Domain only affects the OAuth endpoints. For a Sandbox or a custom domain, override the Authorization / Token URLs in LMA:
- Production:
https://login.salesforce.com/services/oauth2/{authorize,token} - Sandbox:
https://test.salesforce.com/services/oauth2/{authorize,token} - Custom:
https://<your-domain>.my.salesforce.com/services/oauth2/{authorize,token}
Multiple MCP Servers From One Org
Section titled “Multiple MCP Servers From One Org”If you activate several MCP servers in Setup → MCP Servers (e.g.
sobject-reads and metadata-experts), add each one as a separate entry
in LMA → Configuration → MCP Servers, with its own URL
(…/v1/platform/sobject-reads, …/v1/platform/metadata-experts, etc.) and
re-authorize once per entry. They can share the same Connected App.
Support
Section titled “Support”- LMA OAuth implementation: see the troubleshooting section above
- Salesforce MCP server: see the Salesforce Platform MCP documentation
- OAuth configuration: see Salesforce’s Connected Apps and OAuth flow documentation
Summary
Section titled “Summary”✅ What You Get:
- AI assistant can query and mutate Salesforce data during meetings
- Automatic token refresh (no manual intervention)
- Secure OAuth 2.1 with PKCE
- Works with any Salesforce org that has Platform MCP enabled
✅ What You Need:
- Salesforce admin access (to create the Connected App and activate MCP servers)
- Scopes
mcp_api,refresh_token,offline_accesson the Connected App - The Consumer Key from the Connected App
- At least one Active MCP server in Setup → MCP Servers