MCP in Salesforce: How AI Agents Plug Into Your Org, and Your Agents Plug Into Everything Else
Your sales reps want pipeline answers inside Claude or Slack. Your service agent needs shipment status from a logistics system. Your developers want their coding assistant to understand the org they're deploying to. A year ago, each of those meant a custom integration. Today they share one answer: the Model Context Protocol (MCP).
MCP shows up in Salesforce in three directions, and most confusion comes from mixing them up. Salesforce can be the server that outside AI tools call, Agentforce can be the client that calls other systems, and builders use MCP in their tools. In this post you'll trace a real tool call step by step in the MCP Flow Tracer and break it on purpose. Then you'll pick the right setup for your use case in the MCP Path Finder and finish with an interview-style quiz.
Salesforce Hosted MCP Servers. Claude, ChatGPT, Cursor or Slackbot read and act on your org as the signed-in user.
MCP for Agentforce. Your agents call tools on third-party, MuleSoft and Salesforce-hosted MCP servers.
Agentforce Vibes, the Headless 360 MCP Server and skills. Your IDE assistant works with your org's metadata and setup.
Heroku, MuleSoft and Trailhead. Host your own MCP servers, turn APIs into MCP tools, or ground answers in Trailhead content.
The MCP Flow Tracer
Pick a direction, then press Play or go one Step at a time. Turn on a "what if" to see exactly where a real setup breaks.
Prompt:
1. MCP in one minute: host, client, server
MCP is an open standard for connecting AI models to external systems, their tools and their data. Salesforce compares it to USB-C for AI: build one connector and any compatible app can use it. Anthropic created it, and in December 2025 donated it to the Agentic AI Foundation. Before MCP, every AI app needed custom code for every system. With MCP, a system publishes its capabilities once and any MCP-aware app can discover them.
- Host: the AI app the person uses (Claude, Cursor, Slackbot, Agentforce). It runs the client.
- Client: the connector inside the host that talks to one or more servers.
- Server: exposes what a system can do as tools (actions), resources (data) and prompts (reusable templates).
The key idea: a server describes its own tools (names, input schemas, descriptions), so the model decides when to call one. Trailhead's MCP for Agentforce quick look explains the same three roles in Agentforce terms.
2. Salesforce as the server: Hosted MCP Servers
Salesforce Hosted MCP Servers let any MCP-compatible client (Claude, ChatGPT, Cursor, Postman or your own agent) connect to an org and act on behalf of the signed-in user. After a pilot in spring 2025 and a beta from October 2025, they became generally available on April 29, 2026, for Enterprise Edition and above. Salesforce runs the infrastructure, so there's nothing to deploy.
Standard servers come pre-built and you can't change their tools:
sobject-all(full CRUD plus query and search),sobject-reads(read and query only),sobject-mutations(create and update, no delete) andsobject-deletes. Choosing among them is your first and cheapest guardrail.- Product servers such as Data 360 (SQL over unified data) and Tableau Next (semantic models, KPIs, dashboards).
Custom servers are built in Setup with no code. They expose your own logic as tools: Flows, Apex @InvocableMethod actions, @AuraEnabled methods, Apex REST classes, Named Queries, endpoints from the API Catalog and Prompt Builder templates. You can even expose an Agentforce agent as an MCP tool, but only agents built in the new Agent Script builder.
// An invocable action you can publish as a tool on a custom MCP server.
// Clear labels and descriptions matter: the model reads them to decide when to call it.
public with sharing class OpportunityHealthTool {
public class Request {
@InvocableVariable(label='Opportunity Id' description='The opportunity to check' required=true)
public Id opportunityId;
}
public class Result {
@InvocableVariable(label='Summary' description='One-line health summary')
public String summary;
}
@InvocableMethod(label='Check Opportunity Health' description='Returns stage, close date and last activity for one opportunity')
public static List<Result> check(List<Request> requests) {
Set<Id> ids = new Set<Id>();
for (Request r : requests) { ids.add(r.opportunityId); }
Map<Id, Opportunity> opps = new Map<Id, Opportunity>(
[SELECT Id, Name, StageName, CloseDate, LastActivityDate
FROM Opportunity WHERE Id IN :ids WITH USER_MODE]);
List<Result> results = new List<Result>();
for (Request r : requests) {
Opportunity o = opps.get(r.opportunityId);
Result res = new Result();
res.summary = (o == null)
? 'Not found, or not visible to you.'
: o.Name + ': ' + o.StageName + ', closes ' + String.valueOf(o.CloseDate)
+ (o.LastActivityDate == null ? ', no logged activity' : ', last activity ' + String.valueOf(o.LastActivityDate));
results.add(res);
}
return results;
}
}Setup takes three moves, and Salesforce puts it at under 30 minutes:
- Enable the server in Setup → API Catalog → MCP Servers. Every server is off by default. If it isn't enabled, clients can't connect even with valid credentials.
- Create an External Client App with the
mcp_apiandrefresh_tokenscopes. Users sign in with OAuth 2.0 and PKCE. Themcp_apiscope reaches the MCP servers, not your REST APIs. - Connect the client with the server URL and the app's consumer key, then test in a sandbox with a read-only server first.
- Security is the user's own. Each call runs as the authenticated user, so CRUD, field-level security and sharing all apply, and the audit trail records the action under that user's name. No anonymous service accounts.
- Billing. Hosted MCP Servers are intended for customers with Flex Credits, and usage may be billed. Check with your account team before a wide rollout.
- Coming from the beta? GA uses new URLs and replaces the beta scopes with
mcp_apiandrefresh_token. Your tools and prompts work unchanged once clients reconnect.
readOnlyHint, destructiveHint, idempotentHint and openWorldHint. Hints guide clients but don't enforce anything; permissions still do that. Size each tool so it returns a useful result on its own. If it needs a fixed call sequence, it's too fine. If it hides multi-step decisions, put those in a Flow. And don't wrap REST APIs in your own proxy: that bypasses the platform's security and telemetry.
3. Agentforce as the client: MCP for Agentforce
The other direction lets your agents use tools that live outside Salesforce, such as a carrier's tracking API, a document store or a data warehouse, without writing Apex callouts. Agentforce has a native MCP client. It entered beta in January 2026 and is generally available from the Summer '26 release. See MCP for Agentforce in Salesforce Help.
- Register the server. Register third-party servers in Agentforce Registry, and MuleSoft and Salesforce-hosted servers through API Catalog. Salesforce creates the named credential, external credential and permission set for you.
- Allowlist tools. Nothing is exposed by default. Each tool you allow becomes an agent action in the Agentforce asset library.
- Add the actions in Agentforce Builder and write instructions for when the agent should use them.
- Govern with Agentforce Gateway: policies set usage limits and control access to MCP tools, such as how often an agent can call a tool in a given period.
The considerations are where projects get stuck:
- Streamable HTTP only. Servers that only use HTTP+SSE aren't supported.
- Tools only. Agents can't use a server's resources, prompts or apps.
- Auth: OAuth client credentials (a shared service identity) or browser flow (per-user). Basic, API keys and JWT are planned, not yet available.
- Timeouts: the MCP client gives up after 60 seconds, and the reasoning engine after 120 seconds in total across servers.
- Keep responses simple. Builder works best with flat JSON. Nested properties and dynamic payloads aren't fully supported.
- Deployments: agents with MCP tool actions can be packaged, but server registrations aren't. In each target org, register the server, allowlist the tools and re-add the actions.
- Billing: MCP tool actions are billed like any other agent action. Track them in Digital Wallet.
MCP isn't only for Agentforce agents. Slackbot's MCP client is generally available and can connect to Salesforce MCP servers and partner apps. On the partner side, AgentExchange lists verified MCP servers from companies such as AWS, Box, Google Cloud, PayPal and Stripe.
The MCP Path Finder
Answer three questions. Get the Salesforce MCP piece to use, how to set it up, and the guardrails that matter.
4. MCP for builders: what changed this year
- The local DX MCP server has been retired. The
@salesforce/mcppackage reached end of life on November 2, 2026, according to its official repository. If yourmcp.jsonstill runs it, plan to replace it. Salesforce now publishes much of its developer tooling as skills and plugins in theforcedotcom/sf-skillslibrary. - Agentforce Vibes (the VS Code extension) has an MCP panel where you connect Salesforce-hosted servers, such as the API context server, alongside local servers. Your admin must enable hosted servers in the org first.
- Headless 360 MCP Server (beta, July 2026). Instead of one tool per feature, it gives an agent four tools: Discover, Describe, Dispatch and Dispatch Read Only. Behind them is a growing library of setup "skills", such as managing users and named credentials. It still runs as the authenticated user, with your permissions.
- CLI management (developer preview).
sf agent mcp list | create | update | deletecommands manage server registrations in API Catalog. That's handy for scripting environments.
5. The rest of the platform
- Heroku runs a remote MCP server for managing your Heroku apps. With Heroku AppLink, you can build your own MCP server in any language and expose it to Salesforce. This is the usual route when the tool you need doesn't exist yet.
- MuleSoft turns existing APIs into MCP tools with the Anypoint Connector for MCP, and its MCP servers can sync into API Catalog so Agentforce can use them.
- Trailhead MCP is a free, open server for Trailhead's learning content, with no authentication for public content. Ground an enablement agent with it, or ask your own assistant for "the Trailhead content on LWC for an intermediate developer".
Predict the Outcome
Six scenarios from real MCP rollouts and architect interviews.
Cheat sheet: which MCP piece do I need?
| You want to… | Use | Status | Watch out for |
|---|---|---|---|
| Let reps query and update records from Claude, ChatGPT or Slackbot | Hosted MCP Servers (sobject-*) | GA | Servers off by default; Flex Credits; choose the narrowest server |
| Expose a Flow, Apex action or agent to outside AI | Custom Hosted MCP Server | GA | Tool descriptions and annotations; agents need the new Agent Script builder |
| Give an Agentforce agent a third-party system's tools | MCP for Agentforce + Agentforce Registry | GA | Streamable HTTP only; tools only; 60s timeout; registrations not packaged |
| Put an API you already have in front of agents | MuleSoft MCP + API Catalog | GA | Allowlist tools in API Catalog; nothing is exposed by default |
| Build a brand-new tool in Node, Python or Java | Custom MCP server on Heroku (AppLink) | Available | You own the code, auth and uptime |
| Let an AI assistant do org setup tasks | Headless 360 MCP Server | Beta | Beta terms; require approval before each tool runs |
| Keep using the local DX MCP server | @salesforce/mcp | End of life | No releases or support after Nov 2, 2026; move to skills and Agentforce Vibes |
Checked against the Salesforce Hosted MCP Servers guide, MCP for Agentforce in Salesforce Help, the Agentforce Developer Guide and the Salesforce Developers blog in November 2026. MCP features are moving fast, so confirm the current status in your org's release notes.
Official Resources
Straight from Salesforce: the docs this article is based on.
Trailhead
Developer Docs
Planning to open your org to AI assistants, or give your agents new tools?
Book a session with our AI Solution Architects to design MCP access, identity and guardrails.