NexBlazers Logo
NexBlazers Learn • Build • Grow
Agentforce & AI

MCP in Salesforce: How AI Agents Plug Into Your Org, and Your Agents Plug Into Everything Else

Written by NexBlazers Architecture Team November 22, 2026 13 min read Interactive

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 as server

Salesforce Hosted MCP Servers. Claude, ChatGPT, Cursor or Slackbot read and act on your org as the signed-in user.

Agentforce as client

MCP for Agentforce. Your agents call tools on third-party, MuleSoft and Salesforce-hosted MCP servers.

Builder tooling

Agentforce Vibes, the Headless 360 MCP Server and skills. Your IDE assistant works with your org's metadata and setup.

Platform servers

Heroku, MuleSoft and Trailhead. Host your own MCP servers, turn APIs into MCP tools, or ground answers in Trailhead content.

Try it

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.

Direction
What if…

Prompt:

    Trace (simplified)

    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) and sobject-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:

    1. 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.
    2. Create an External Client App with the mcp_api and refresh_token scopes. Users sign in with OAuth 2.0 and PKCE. The mcp_api scope reaches the MCP servers, not your REST APIs.
    3. 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_api and refresh_token. Your tools and prompts work unchanged once clients reconnect.
    Architecture Note: annotate and size your custom tools Salesforce's best practices ask you to set the four tool hints on Flow-, Apex- and REST-backed tools: 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.

    1. 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.
    2. Allowlist tools. Nothing is exposed by default. Each tool you allow becomes an agent action in the Agentforce asset library.
    3. Add the actions in Agentforce Builder and write instructions for when the agent should use them.
    4. 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.

    Decision helper

    The MCP Path Finder

    Answer three questions. Get the Salesforce MCP piece to use, how to set it up, and the guardrails that matter.

    Question 1 of 3

    4. MCP for builders: what changed this year

    • The local DX MCP server has been retired. The @salesforce/mcp package reached end of life on November 2, 2026, according to its official repository. If your mcp.json still runs it, plan to replace it. Salesforce now publishes much of its developer tooling as skills and plugins in the forcedotcom/sf-skills library.
    • 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 | delete commands 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".
    Architecture Note: identity is the real design decision On the server side, Salesforce answers it for you: every call is the signed-in user. On the client side, you choose. Client credentials means every agent conversation reaches the external system as one service identity, so that system can't tell users apart. Per-user (browser flow) means each Salesforce user needs a matching account in the external system before the connection works for them. Decide tool by tool, write it down, and check which OAuth flows the external server actually supports instead of assuming.
    Interview-ready

    Predict the Outcome

    Six scenarios from real MCP rollouts and architect interviews.

    Question 1 of 6 Score: 0

    Cheat sheet: which MCP piece do I need?

    You want to…UseStatusWatch out for
    Let reps query and update records from Claude, ChatGPT or SlackbotHosted MCP Servers (sobject-*)GAServers off by default; Flex Credits; choose the narrowest server
    Expose a Flow, Apex action or agent to outside AICustom Hosted MCP ServerGATool descriptions and annotations; agents need the new Agent Script builder
    Give an Agentforce agent a third-party system's toolsMCP for Agentforce + Agentforce RegistryGAStreamable HTTP only; tools only; 60s timeout; registrations not packaged
    Put an API you already have in front of agentsMuleSoft MCP + API CatalogGAAllowlist tools in API Catalog; nothing is exposed by default
    Build a brand-new tool in Node, Python or JavaCustom MCP server on Heroku (AppLink)AvailableYou own the code, auth and uptime
    Let an AI assistant do org setup tasksHeadless 360 MCP ServerBetaBeta terms; require approval before each tool runs
    Keep using the local DX MCP server@salesforce/mcpEnd of lifeNo 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.

    Keep learning

    Official Resources

    Straight from Salesforce: the docs this article is based on.

    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.

    Book AI Advisory