コンテンツにスキップ

Salesforce as the MCP Server

このコンテンツはまだ日本語訳がありません。

Module 3 of 5 in the chapter MCP, Headless Systems, and Agent Tools, chapter 22 of the Integration Architect course. Each module stands on its own. Previous: MCP in One Picture · Next: Salesforce as the MCP Client

The question this module answers: When an outside AI application calls Salesforce through MCP, who is it acting as, what can it reach, and how do you start safely?

Salesforce hosts MCP servers for your org. In the words of the announcement, “A hosted MCP server is a Salesforce-managed endpoint that exposes your org’s logic and assets — data, flows, Apex actions, queries, and more — to any AI client that speaks MCP” (Salesforce Hosted MCP Servers Are Now Generally Available (opens in a new tab), Salesforce Developers Blog, 2026-04-29, checked 2026-11-21).

So a person using Claude, ChatGPT or a coding tool can ask a question, and their AI calls a tool on your org’s server to answer it. It’s one more door into Salesforce, next to the REST API and the others in chapter 8. And it’s closed until you open it: Salesforce describes “the secure-by-default posture requiring MCP servers to be specifically enabled.”

Here’s the rule that shapes everything else, in Salesforce’s words: “Every MCP tool call runs with the same permissions as the user who authorized the connection.” And: “There are no service accounts, no machine-to-machine flows, and no autonomous operation outside of user context” (Security Best Practices (opens in a new tab), Hosted MCP Servers, checked 2026-11-21).

So if a coordinator’s AI updates a delivery through MCP, “that person’s name appears in the audit trail,” and if their permissions don’t allow it, the AI can’t do it either. The sharing, the field-level security and the object access are the ones the coordinator has in Lightning.

That’s a strength and a limit. It’s safe, because the agent can never do more than the person. And it means a Salesforce-hosted MCP server isn’t the door for a nightly job or a system-to-system integration with no person behind it. That’s still the integration user and an API, from Part 2. The Identity course takes the identity side apart: MCP, the Door for Tools, where into Salesforce it’s always a person.

Setting it up follows the rules from chapter 13: an External Client App (“Connected Apps aren’t supported”), and Salesforce’s own reminder that “By default, refresh tokens remain valid indefinitely,” so shorten them (Create an External Client App (opens in a new tab), checked 2026-11-21). One more practical note from the same page: a new External Client App “can take up to 30 minutes to become available.” Plan the lab around it.

Two kinds of server.

Standard servers, with fixed tool sets: reading, changing or deleting records across your objects, and servers for Data 360, Tableau and more. “Standard servers are disabled by default and can be enabled by an administrator, but their tool sets cannot be modified” (Standard MCP Servers Reference (opens in a new tab), checked 2026-11-21).

Custom servers, where you choose each tool: a flow, an Apex action, an Apex REST resource, a Named Query, a prompt template.

And since Winter ‘27, an agent can be a tool. “Make an Agentforce agent available to any MCP client, such as Claude, ChatGPT, or Cursor, by adding it as a tool on a custom MCP server,” and “Every call runs as the authenticated user, so sharing rules, field-level security, and Einstein Trust Layer policies still apply” (The Salesforce Developer’s Guide to the Winter ‘27 Release (opens in a new tab), checked 2026-11-21). One agent calling another, through MCP, is where chapter 23 begins.

Which should you expose first? Salesforce answers that too: “start with the most restrictive configuration that meets your use case, then expand access only as needed.” Its own ladder has three steps (Security Best Practices (opens in a new tab)).

  1. Read only. “The platform/sobject-reads server exposes only read operations, eliminating modification risks entirely.” An AI can answer questions about your data and change nothing.
  2. Named Queries. Instead of letting the AI write any query, you write the queries it may run, and give each a name. It’s the agent’s version of chapter 8’s own door: a narrow contract you own, safe to expose, instead of the whole data model.
  3. Custom tools with embedded logic. Flows or Apex that do exactly one job, with your checks inside. They “give you full programmatic control over what the agent can see and do.”

Climb only as far as the use case needs. Most first projects should stop at step one or two.

And on how big each tool should be, Salesforce’s general advice is practical: “When in doubt, start with slightly coarser tools and split them if agents demonstrate they need finer control” (General Best Practices (opens in a new tab), checked 2026-11-21). Module 5 is about designing those tools.

Two things to know before you promise this to anyone.

It’s billed. “Salesforce Hosted MCP Servers are intended only for customers with Flex Credits and you may be billed for server usage” (Get Started (opens in a new tab), checked 2026-11-21). Every tool call an AI makes can cost something, and an AI can make many calls to answer one question. Size it the way you’d size any API, with chapter 6’s volumes.

It’s its own door. “A new OAuth scope provides access to MCP, but not our existing REST APIs.” So an app allowed onto MCP isn’t automatically allowed onto the REST API, and the reverse. Watch the MCP traffic in the same logs as your other API traffic, and include it in the door policy from chapter 18 module 6.

Hosted servers need Flex Credits, so you may not be able to run this in a practice org. This module comes with a recorded walkthrough of the four steps; if your org does have hosted MCP servers, follow along.

  1. Enable one standard server, the read-only one.
  2. Create the External Client App the guide describes, and wait for it to become available.
  3. Connect Postman first, not an AI. Postman can act as an MCP client. List the tools, read their names and descriptions, call one, and read the answer exactly as the server returns it.
  4. Then connect an AI client to the same server, ask it a question in plain words, and watch which tool it chooses and what it does with the answer.

Why Postman first? Because it shows you the integration with nothing in between. When the AI later gives a strange answer, you’ll know whether the tool returned something strange, or the AI did. The tool, not the AI, proves the integration works. The guide has the steps for each client (Connecting an MCP Client (opens in a new tab)).

Beyond the exam. Hosted MCP servers aren’t in the Integration Architect exam’s objectives. The exam-relevant habits all apply: least privilege, External Client Apps, short-lived tokens, and an identity chosen for each door.

  • Whether a person’s AI should reach Salesforce through MCP, knowing every call runs as that person.
  • Which servers are enabled, and how far up the ladder each use case climbs.
  • Which Named Queries and custom tools form the contract agents may use.
  • The External Client App, token lifetimes and users allowed to connect.
  • Who pays for the calls, and where the MCP traffic is watched.