Table of Contents
- Salesforce Hosted MCP Servers
- External Client App for OAuth
- Permission Scoping and Field-Level Security
- The MCP Client That Does the Work
- Managed Hosting With SetupYourClaw
- Custom MCP Servers in API Catalog
- Pub/Sub API for Event-Driven Runs
- Event Monitoring and the Audit Trail
- The 8 parts at a glance
- How to scope your first client org
- Frequently asked questions
- Conclusion
Salesforce AI agent deployments give an AI assistant authenticated access to Customer Relationship Management records in a Salesforce org through tool calls rather than screen scraping. Salesforce Hosted MCP Servers expose that access over the Model Context Protocol, so every call runs as an authorized user and inherits object permissions, field-level security and sharing rules.
Connecting an agent to Salesforce is well documented and takes an afternoon. Keeping that agent scoped, running and auditable across client orgs is the part that is not written up anywhere, and it is where deployments actually break. The eight parts below are ordered the way a production setup gets built: what the org exposes, how the agent authenticates, how far it can reach, what runs it, and how you find out afterwards what it did.
1. Salesforce Hosted MCP Servers

Salesforce Hosted MCP Servers are the access surface the org exposes. Salesforce announced general availability on 29 April 2026, and the documentation describes the feature as a universal connector: instead of building a custom API integration for every AI tool a team uses, an administrator configures a server once in Salesforce and any Model Context Protocol client can connect to it using standard OAuth-based authentication.
The standard servers are pre-configured by Salesforce with fixed tool sets that cannot be modified. They are disabled by default and an administrator enables the ones a deployment needs. The SObject family is where most CRM work happens, and it is split deliberately by capability. SObject All covers create, read, update and delete plus query and search across every standard and custom object in the org. SObject Reads is read and query only, with no mutations. SObject Mutations handles create and update with no deletes. There are also product-specific servers alongside the SObject set.
That split is the single most useful design decision for agency work, because it means scope is chosen at the server level before any prompt is written. An agent pointed at SObject Reads cannot write a record no matter how it is instructed, and an agent on SObject Mutations cannot delete one. Deciding which server to enable is therefore a configuration decision rather than a prompt-engineering one, and it is the first thing to settle for each client org.
2. External Client App for OAuth

An External Client App is the trust configuration between the AI client and the Salesforce org, and it is not optional. The documentation is explicit that Connected Apps are not supported for MCP authentication, which catches out teams reusing an older integration pattern. Each MCP server configuration links to one External Client App, and Salesforce Help recommends creating one External Client App for each AI partner that gets connected.
An administrator creates it from Setup by entering “external client” in the Quick Find box and selecting External Client App Manager. The app handles OAuth authorization, and the documented flow uses the authorization code grant with Proof Key for Code Exchange. The client side then needs the MCP server URL and the External Client App’s consumer key. One documented wrinkle is that External Client Apps cannot be created directly in scratch orgs through the Setup UI; the workaround is to create the app in a developer hub org, add it to a package, and install that package in the target scratch org.
For anyone running agents across several client orgs, this is where the operational burden sits. Every org needs its own External Client App, its own consumer key, and its own refresh token, and those credentials have to live somewhere that survives a restart. The same discipline that applies to any multi-client setup applies here, and credential management for AI agents is worth settling before the second org is added rather than after.
3. Permission Scoping and Field-Level Security

The security model is inheritance, and understanding it prevents most unpleasant surprises. Every MCP tool call runs with the same permissions as the user who authorized the connection. The agent gets that user’s object-level CRUD permissions, respects field-level security restrictions, follows record sharing rules, and all actions are attributed to the named user in audit trails. The practical consequence stated in the documentation is that if a user cannot perform an action in the Lightning UI or over the REST API, they cannot perform it through MCP either.
This cuts both ways. Authorizing the connection as a system administrator hands the agent administrator reach over the entire org. The safer pattern follows Salesforce’s own least-privilege guidance for integrations: create a dedicated user for the integration rather than reusing a person’s login. The Salesforce Integration user license works with the Minimum Access – API Only Integrations profile, and the Salesforce API Integration permission set license is a separate grant that has to be assigned on top of it.
From there, access is built up rather than trimmed down. A dedicated permission set grants only the objects the job actually needs, and field-level security is granted explicitly, because object access without field access produces confusing partial failures instead of clean errors. Salesforce’s own best-practice page recommends incremental permission strategies for exactly this reason. Start with read on a narrow set of objects, confirm the agent does useful work, then widen.
4. The MCP Client That Does the Work

The client is whatever actually reasons over the data. Salesforce documents the feature as working with any compatible AI client and names Claude, ChatGPT, Cursor and custom agents, with per-client configuration pages for the tested clients. The documented connection order is to create the External Client App first, then configure the client with the server URL and consumer key. Salesforce also publishes a Postman quick start, which is the fastest way to confirm a server is reachable and a token is valid before involving an agent at all.
Client choice matters more than it looks, because it determines what happens between tool calls. A coding-agent client such as Claude Code or Cursor can hold a multi-step task together: query accounts, notice which ones have stale close dates, write updates back, and record what it changed. A chat client is better suited to a person asking questions and reading answers. The work being automated should pick the client, not the other way round.
One documented exception is worth noting: registering an External Client App is not required for Agentforce Vibes, where Salesforce Platform MCP servers are auto-enabled. That also marks the line between two different things sharing the word agent. Agentforce builds agents inside Salesforce, running on Salesforce infrastructure. Hosted MCP Servers let an agent running outside Salesforce reach in. Teams already running agents against other systems, as in these HubSpot AI agent components, usually want the second.
5. Managed Hosting With SetupYourClaw

The Salesforce half of the setup is configuration inside an org. The agent half is a process that has to be running when work needs doing, and that is where deployments stall. An agent that only answers while a laptop is open and a terminal session is alive cannot pick up a platform event at two in the morning, and OAuth refresh tokens need somewhere persistent to live between runs.
SetupYourClaw provides managed AI agent deployment: the agent runs on provisioned infrastructure and stays connected, without the reader buying a virtual machine, generating and storing SSH keys, installing a runtime, and maintaining the result. The site puts a traditional self-hosted path at roughly an hour of setup across eight steps, against picking a model and deploying from a hosted flow.
This belongs in the middle of the list rather than at the top, because it solves a narrower problem than it first appears. It does not configure External Client Apps, choose which standard server to enable, or decide which permission set a client org needs. Those remain Salesforce-side decisions that someone has to make deliberately. What managed hosting removes is server administration and uptime for the agent process. Teams already comfortable running their own infrastructure should keep running it; the trade is worth making when the alternative is maintaining a box per client, and the patterns in this multi-tenant MCP server guide describe that shape of problem.
6. Custom MCP Servers in API Catalog

Standard servers expose generic record operations, which is rarely how a business actually works. A renewal process, a lead-scoring rule or a provisioning step usually already exists in the org as Apex, and exposing that logic to an agent is better than asking the agent to reconstruct it from raw records. API Catalog is where that happens. With Hosted MCP Servers enabled, an administrator can create custom Salesforce MCP servers, add assets to them, and activate them for use with Agentforce and other supported MCP clients.
The documented path is Setup, then API Catalog in Quick Find, then MCP Servers, then Create Salesforce MCP Server. The assets that can be exposed include Apex invocable methods annotated with @InvocableMethod, @AuraEnabled Apex methods that already back Lightning components, Apex REST endpoints declared with @RestResource, APIs registered in the API Catalog including standard platform APIs, and prompt templates. Permissions are documented: API Catalog is available to Salesforce admins by default and needs View Setup for other users, while creating or editing a custom MCP server requires Customize Application. The feature is available in Lightning Experience on Developer, Enterprise, Performance and Unlimited Editions.
The reliability argument for this is stronger than the convenience one. A single custom tool that runs an existing, tested Apex method is far more predictable than a sequence of generic record writes the agent assembles itself, and it keeps business rules in one place where they can be changed without rewriting prompts.
7. Pub/Sub API for Event-Driven Runs

An agent that only runs when someone types at it covers a fraction of the useful work. The rest is reactive: an opportunity changes stage, a case is escalated, a record is created by a form. Salesforce’s Pub/Sub API is the documented way for an external client to subscribe to those notifications. It provides a single interface for publishing and subscribing to platform events, including real-time event monitoring events and change data capture events.
The transport details shape how an agent gets built on top of it. Pub/Sub API is based on gRPC and HTTP/2 and delivers binary event messages in Apache Avro format, with the service defined in a proto file, so a client generates stubs rather than calling a plain REST endpoint. Salesforce publishes quick starts in Java and Python for subscribing and publishing.
The important property for agent work is that the subscription is pull-based. The documentation describes the Subscribe RPC as pull-based, meaning the client requests new events rather than waiting for the server to push them, and the volume of event messages received per Subscribe call can be controlled based on how fast the client processes them. That flow control is what stops a bulk data load in Salesforce from triggering a flood of concurrent agent runs, which is a real failure mode once model calls and write-backs are involved.
8. Event Monitoring and the Audit Trail

Unattended agents need a record of what they did, and Salesforce already has the plumbing. Because every tool call runs as the authorizing user, actions are attributed to that named user in audit trails, which is precisely why a dedicated integration user is worth the setup: it separates agent activity from a human’s activity in the logs instead of blending them.
Several log sources cover different questions. The Setup Audit Trail tracks administrative and configuration changes. EventLogFile is the baseline Event Monitoring log object capturing events such as report exports and API calls. The ApiEvent object tracks user-initiated read-only API calls including query, queryMore and count, with the documented caveat that Tooling API calls and calls originating from a Salesforce mobile app are not captured. API Total Usage events report Platform SOAP, Platform REST and Bulk API requests, and Salesforce notes that all orgs can view the daily API Total Usage event log files for the previous 24 hours.
Real-Time Event Monitoring and Event Log Objects carry their own licensing requirements, so what is available depends on the org rather than on the agent. Salesforce’s security best-practice page lists monitoring and auditing agent activity as a step in its own right, not an afterthought. Logging inside the agent process is still worth keeping alongside this, since org-side logs record the API call that landed but not the reasoning that produced it.
The 8 parts at a glance
| Part | What it does | Where it runs |
|---|---|---|
| 1. Hosted MCP Servers | Exposes org data and automation as MCP tools; standard servers have fixed tool sets | Salesforce org (admin-enabled) |
| 2. External Client App | OAuth authorization with PKCE; Connected Apps are not supported | Salesforce Setup |
| 3. Permission scoping | Integration user, permission sets and field-level security define the blast radius | Salesforce org |
| 4. MCP client | Reasons over the data and chains tool calls; Claude, ChatGPT, Cursor or custom | Wherever the agent runs |
| 5. Managed hosting | Keeps the agent process running and credentials persistent between runs | Hosted infrastructure |
| 6. Custom MCP servers | Exposes existing Apex and registered APIs as agent tools via API Catalog | Salesforce org |
| 7. Pub/Sub API | Pull-based platform event subscription for event-driven runs, with flow control | External client |
| 8. Event monitoring | Attributes and records agent API activity across Salesforce log objects | Salesforce org |
How to scope your first client org
Work from the narrowest thing that proves value. Enable SObject Reads only, authorize it as a dedicated integration user with a permission set covering two or three objects, and grant field-level security explicitly rather than assuming object access carries it. Confirm reachability with the Postman quick start before involving an agent, so authentication failures stay separate from reasoning failures. Only widen to SObject Mutations once there is a real task that needs writes, and prefer a custom API Catalog server wrapping existing Apex over generic record writes for anything with business rules attached. Add Pub/Sub API subscriptions last, because reactive runs are where an unscoped agent does the most damage fastest.
Frequently asked questions
Is a Salesforce AI agent the same thing as Agentforce?
No. Agentforce builds agents that run inside Salesforce on Salesforce infrastructure. Salesforce Hosted MCP Servers let an agent running outside the platform, such as Claude or Cursor, connect in over the Model Context Protocol and act as an authorized user. The two can coexist, and custom MCP servers created in API Catalog are usable by Agentforce and other supported MCP clients.
Can an AI agent see Salesforce fields the authorizing user cannot?
No. Every MCP tool call inherits the authorizing user’s object-level CRUD permissions, field-level security restrictions and record sharing rules. The documented rule is that if the user cannot perform an action in the Lightning UI or over the REST API, the agent cannot perform it through MCP. This makes the choice of authorizing user the most consequential security decision in the setup.
Why use an External Client App instead of a Connected App?
Because Salesforce’s documentation states Connected Apps are not supported for MCP authentication. An External Client App is the required registration and enablement mechanism, created from External Client App Manager in Setup. Each MCP server configuration links to one External Client App, and Salesforce Help recommends creating a separate one for each AI partner connected to the org.
How do you stop an agent from deleting Salesforce records?
Choose the server before writing any prompt. The standard SObject servers are split by capability: SObject Reads allows read and query only with no mutations, and SObject Mutations allows create and update with no deletes. Standard servers are disabled by default and their tool sets cannot be modified, so enabling only the narrower server is a configuration-level guarantee rather than an instruction.
Does the agent need to run continuously?
Only for reactive work. A person asking questions interactively needs the agent running at that moment. Subscribing to platform events through Pub/Sub API to react to stage changes or escalations needs a process that is running and holding a subscription when events arrive, which is the practical argument for hosted infrastructure over a local terminal session.
Conclusion
The Salesforce side of an agent deployment is configuration work that rewards being deliberate: pick the narrowest standard server, authorize as a dedicated integration user, and let the audit trail name it. The agent side is an always-on process holding credentials, and that is infrastructure rather than configuration. If maintaining a server per client org is not the work you want to be doing, SetupYourClaw runs the agent and keeps it connected, leaving the permission decisions where they belong, with the person who knows the org.
