Most conversations about AI and Salesforce stop at the wrong place. They describe what AI could do inside a CRM. Then they leave architects to figure out the how.
This post skips the pitch. It covers the actual integration architecture: how Claude connects to Salesforce through the Model Context Protocol, how OAuth 2.0 governs that access, and what production-grade implementations look like.
Why This Is Not Just Another API Integration
There is a common assumption in the Salesforce community. Many architects treat Claude as a bolt-on AI layer. The thinking goes: send data out to an AI endpoint, get a result back, write it to a record.
That model is already outdated. Since the Salesforce-Anthropic partnership formalised in late 2025, Claude connects to Salesforce as a live, permissioned participant, not a downstream consumer. Through Salesforce Hosted MCP Servers, Claude can read records, execute queries, and trigger actions directly inside your org’s security perimeter. The distinction matters architecturally.
The MCP Layer: What It Actually Does
MCP (Model Context Protocol) is an open standard that lets AI agents interact with external systems through a governed interface. Salesforce now hosts pre-built MCP servers inside your org. Each server exposes a category of Salesforce data over a standardised REST-like interface.
The most broadly useful is the SObject All Data server. It covers core objects: Accounts, Contacts, Opportunities, Leads, Cases, Tasks, and Events. Salesforce also provides specialised servers for Metadata, Flow definitions, and Analytics.
MCP servers are inactive by default. Architects choose which surfaces to expose and to whom. To activate a Salesforce Hosted MCP Server, navigate to MCP Servers in Setup, select the Salesforce Servers tab, activate each server individually, and copy its Server URL and API Name. This activation step forces deliberate decisions about what Claude can reach.
OAuth 2.0 Configuration: The Authentication Foundation
Claude authenticates to your org using an External Client App (ECA). This replaces the legacy Connected App model for MCP use cases. The ECA defines which external applications can connect and what they are permitted to do.
Creating the External Client App:
- In Setup, search External Client App Manager and create a new app
- Enable OAuth settings and set the callback URL to
http://localhost:38000/callbackfor Claude Code - Add two scopes:
api(data access) andrefresh_token, offline_access(persistent sessions) - Save and copy the Consumer Key and Consumer Secret
For server-to-server integrations without a user login flow, the JWT Bearer Token flow is the correct pattern. Generate a certificate/key pair, upload the certificate to the ECA, and use the private key to sign JWT assertions. Store that key in AWS Secrets Manager, HashiCorp Vault, or GCP Secret Manager. Never commit it to version control.
Registering the Connection in Claude
Once the ECA is configured, connector registration is straightforward. In claude.ai, go to Settings and select Connectors. Search for Salesforce, paste the Server URL and Consumer Key, then authorise the OAuth flow when prompted.
After authorisation, Claude has live, scoped access to the MCP servers you activated. Validate with a quick test: ask Claude to return the first 10 Account records with Name, Industry, and Annual Revenue. The tool call should execute and return structured data directly.
Permission Architecture: The Part Most Teams Get Wrong
Access control is where production implementations diverge from demos. Two principles apply.
First, never grant MCP access via profiles. Create a dedicated Permission Set scoped specifically to MCP interactions. Include only the object permissions your use case requires. Assign it only to users who need AI-assisted access.
Second, always start in a sandbox. Salesforce generates separate MCP Server URLs for sandbox and production orgs. Complete full end-to-end validation before promoting to production. For regulated industries, additionally review your Einstein Trust Layer settings to verify data handling compliance.
Apex Callout Pattern for Internal Integrations
Some teams prefer to keep logic inside Salesforce. In that case, Apex callouts provide a direct path. A Salesforce Flow or trigger calls an Apex class, the class constructs a Claude API request with relevant record data as context, and writes the result back.
Use a Named Credential to manage the Anthropic API key. This avoids hardcoding credentials and makes rotation straightforward. The callout targets the /v1/messages endpoint.
This pattern suits use cases that must stay within Salesforce governor limits: automated account summaries on record create, opportunity briefing generation from activity history, or case classification on incoming support requests.
Key Takeaways for Architects
- MCP is the correct integration layer. Salesforce Hosted MCP Servers are the supported path for agentic Claude access.
- OAuth 2.0 governs all access. Use JWT Bearer for server-to-server flows and ECA-based user flows for interactive sessions.
- Permission Sets — not profiles — control MCP access. Keep the scope tight.
- Sandbox-first is non-negotiable. Validate OAuth flows, permission sets, and write operations before going live.
- For logic that must stay inside Salesforce, Apex callouts with Named Credentials are the right pattern.
The integration is generally available. The architecture decisions you make now will determine how cleanly you can extend it.
Read Moar!
Claude Fable 5 Is Here. What It Actually Means for Salesforce Developers
Claude Fable 5 and Claude Mythos 5
Leave a Reply