
Salesforce Hosted MCP Servers: Let AI Clients Use Your Org Safely
What MCP means for Salesforce, how hosted servers expose governed tools, and how to design safe tools: an Apex tool, a client script and an injection guard.
Tag
6 guides tagged Security.

What MCP means for Salesforce, how hosted servers expose governed tools, and how to design safe tools: an Apex tool, a client script and an injection guard.

Pick the right OAuth flow, set up an External Client App, and build a tested token client for client credentials and JWT bearer.

Enforce CRUD, FLS and sharing in Apex with user mode, stripInaccessible and justified system mode, plus tests with real permission sets and a migration script.

Scope, constrain and test an AI agent before it meets customers: code-level guardrails in Apex, a red-team test set with a release gate, and staged rollout.

Compare profiles and permission sets with a regulated onboarding org: groups, muting, custom permissions, Apex checks, tests and CLI deploys.

How Salesforce decides who can see a record: OWD, roles, sharing rules and Apex managed sharing, with a working project-sharing example and tests.