Announcing CIMD support for MCP Client registration
Learn more

Salesforce MCP server: hosted setup, client config and your own agent

Diagram: Claude Code, Cursor and Codex connect to Salesforce Hosted MCP with an External Client App consumer key, while a product's agent reaches Salesforce per user through Scalekit
Nityashree Yadunath
Product Marketing Manager

Salesforce's official MCP server is Salesforce Hosted MCP Servers: Salesforce-managed endpoints under https://api.salesforce.com/platform/mcp/v1/ that became generally available on April 29, 2026. Each server acts as the signed-in user through OAuth 2.0 with PKCE and an External Client App, so that user's object permissions, field-level security and sharing rules apply to every tool call.

Salesforce also published a local server for developers, the Salesforce DX MCP server, which reaches end of life on November 2, 2026. A product whose own agent works in many customers' orgs has to hold a Salesforce authorization for every user, which single-user MCP integrations never have to handle.

TL;DR

  • The hosted servers are generally available for Enterprise Edition orgs and above and are intended for customers with Flex Credits. Every server is off until an admin enables it, and each client connects through an External Client App with the mcp_api and refresh_token scopes. Connected Apps and dynamic client registration are not supported.
  • Because there is no dynamic registration, every client needs the app's consumer key and its own callback URL registered on that app. Claude, Claude Code, Cursor, Codex and VS Code each use a different callback.
  • Salesforce recommends its hosted servers over custom REST wrappers, and a product's agent can use them in customer orgs whose admins enable the servers and register the product. Where that isn't possible, the agent calls Salesforce's APIs as each user through one packaged OAuth app. Scalekit AgentKit's Salesforce connector runs that flow, refreshes each user's tokens and serves 74 tools from one MCP server URL.

What Salesforce Hosted MCP Servers include

Salesforce ships standard servers, each with a fixed set of tools from one product area, and lets admins build custom servers. An admin can enable a standard server but cannot change its tools. The servers reference lists the current set:

Server
What it exposes
Status
SObject Reads, Mutations, Deletes, All
Records in standard and custom objects: schema, SOQL, search and related records, with create, update or delete depending on the server
Generally available
Data 360, Tableau Next
SQL queries over Data 360, and Tableau Next semantic models, KPIs and analytics questions
Generally available
Content Read-Only, Content Write
Salesforce CMS workspaces, channels, content, variants and folders
Generally available
Headless 360, Metadata Grounding, CRM Analytics
Setup and platform operations, org metadata lookups for coding agents, and read-only SAQL on sandbox and scratch orgs
Beta

The SObject server paths are platform/sobject-reads, platform/sobject-mutations, platform/sobject-deletes and platform/sobject-all. SObject Reads offers getObjectSchema, soqlQuery, find, getUserInfo, listRecentSobjectRecords and getRelatedRecords. The other three add create and update tools, delete tools, or both. The tool descriptions state limits: soqlQuery returns at most 50,000 records per transaction and find at most 2,000, and deleted records stay in the Recycle Bin for up to 15 days with no undelete tool.

A custom server combines tools from several standard servers under one URL and adds tools backed by your own logic: Autolaunched Flows, Apex methods annotated with @InvocableMethod, @AuraEnabled or @RestResource, Named Queries and endpoints in the API Catalog. Salesforce recommends one curated server per persona, because beyond a few dozen tools an AI client struggles to pick the right one.

Status, editions and billing

Salesforce's general availability announcement describes the servers as production-ready for every Enterprise Edition org and above. The developer docs add that they are intended only for customers with Flex Credits, available through your account executive or Salesforce Foundations, and that server usage may be billed. Tools can change between releases, so re-check the servers you rely on after each Salesforce release.

How sign-in works

Salesforce allows only the OAuth authorization code flow with PKCE, with no service accounts or machine-to-machine flows, so every tool call traces to a named user. Without dynamic client registration, an admin registers each client in advance. The mcp_api scope grants access to MCP servers but not to Salesforce's REST APIs.

The servers publish OAuth protected resource metadata, so a client that has your consumer key can find the rest on its own. Production URLs point to https://login.salesforce.com as the authorization server. Sandbox and scratch orgs use the same path with /sandbox/ inserted after /v1, and those URLs point to https://test.salesforce.com. To get a server ready:

  1. In Setup, enter MCP Servers in Quick Find, open MCP Servers and turn on the servers you need. A server can take up to 2 minutes to become active.
  2. Open External Client App Manager and click New External Client App. Enable OAuth, add the callback URL for each client you will use, and add the scopes Access MCP servers (mcp_api) and Perform requests at any time (refresh_token).
  3. Under Security, select Issue JSON Web Token (JWT)-based access tokens for named users, and deselect the other options that don't need Salesforce support to change. Click Create. The app can take up to 30 minutes to start working.
  4. Under Settings, open Consumer Key and Secret and copy the consumer key. It is a public identifier, not a secret.

Callback URLs for each client

Salesforce matches the callback URL exactly, so add the one for each client your team uses to the External Client App before anyone signs in:

Client
Callback URL to add to the External Client App
Where the consumer key goes
Claude and Claude Desktop
https://claude.ai/api/mcp/auth_callback
Custom connector, Use your own OAuth client
Claude Code (CLI)
http://localhost:8080/callback, with the port you pass to --callback-port
--client-id flag
Cursor (desktop)
http://localhost:8787/callback, plus cursor://anysphere.cursor-mcp/oauth/callback for older versions
auth.CLIENT_ID in mcp.json
Codex
The exact URL that codex mcp add prints
--oauth-client-id flag
VS Code
http://127.0.0.1:33418 and https://vscode.dev/redirect
oauth.clientId in mcp.json
Agentforce Vibes
None
None; enabled servers appear automatically

The examples below use the read-only SObject server in a production org. Replace YOUR_CONSUMER_KEY with your app's consumer key, and change the path to use another server or a sandbox.

Add the Salesforce MCP server to Claude Code

Salesforce documents the Claude route: in Claude, open Customize, then Connectors, click Add and choose Add custom connector. Enter the server URL, choose Use your own OAuth client, paste the consumer key, leave the secret blank and click Connect. Claude Code picks up claude.ai connectors when you sign in with a claude.ai subscription, but not when an API key or a provider such as Amazon Bedrock is active.

To add the server to Claude Code directly, register http://localhost:8080/callback on the External Client App and pass the consumer key and the same port:

claude mcp add --transport http --scope user \ --client-id YOUR_CONSUMER_KEY --callback-port 8080 \ salesforce https://api.salesforce.com/platform/mcp/v1/platform/sobject-reads

Then sign in from your shell, or type /mcp in a session, select salesforce and follow the browser sign-in:

claude mcp login salesforce

Leave out --scope user to add the server to the current project only.

Add it to Cursor

Open Cursor Settings, then Tools & MCP, and click New MCP Server, which creates mcp.json. Cursor reads the client ID from an auth object, as Salesforce's Cursor instructions show:

{ "mcpServers": { "Salesforce": { "url": "https://api.salesforce.com/platform/mcp/v1/platform/sobject-reads", "auth": { "CLIENT_ID": "YOUR_CONSUMER_KEY" } } } }

Cursor's desktop app uses the localhost callback, and web and Cursor Agents sign-ins use https://www.cursor.com/agents/mcp/oauth/callback, so register both if your team uses both. Put the entry in ~/.cursor/mcp.json for every project or .cursor/mcp.json for one.

Add it to Codex

Codex supports pre-registered OAuth clients. By default it listens on whichever local port is free and puts that port into its callback URL, while Salesforce expects the exact URL registered on the app, so fix the port first. Add these two lines at the top of ~/.codex/config.toml, above any table:

mcp_oauth_callback_port = 8765 mcp_oauth_callback_url = "http://127.0.0.1:8765/callback"

Then add the server with the consumer key:

codex mcp add salesforce \ --url https://api.salesforce.com/platform/mcp/v1/platform/sobject-reads \ --oauth-client-id YOUR_CONSUMER_KEY

Codex prints an OAuth callback URL that ends in a server-specific ID; add that exact URL to the External Client App. Codex then starts a sign-in, so press Ctrl+C until the app accepts the new callback. Then add two lines under the [mcp_servers.salesforce] table the command wrote, so Codex requests only the MCP scopes and prompts before any tool not marked read-only:

scopes = ["mcp_api", "refresh_token"] default_tools_approval_mode = "writes"

Sign in when you are ready:

codex mcp login salesforce

VS Code and Agentforce Vibes

In VS Code, run MCP: Open User Configuration and add the server with an oauth object. Register both of VS Code's redirect URLs on the External Client App. VS Code opens the browser sign-in on first use:

{ "servers": { "salesforce": { "type": "http", "url": "https://api.salesforce.com/platform/mcp/v1/platform/sobject-reads", "oauth": { "clientId": "YOUR_CONSUMER_KEY" } } } }

Agentforce Vibes, Salesforce's VS Code extension, needs no External Client App or consumer key. Servers your admin has enabled appear under Toolkit, MCP Servers, in the Salesforce Platform group, where you turn each one on.

Self-hosted Salesforce MCP servers

The Salesforce DX MCP server (@salesforce/mcp) runs locally against orgs you have authorized with the Salesforce CLI, with more than 60 tools grouped into toolsets. Salesforce has announced its end of life for November 2, 2026. After that date its repositories become read-only and the npm package is marked deprecated, although pinned installs such as version 0.30.15 keep working. Salesforce now delivers its developer tooling as skills in forcedotcom/sf-skills, which install into Claude Code, Codex and Cursor with npx skills add forcedotcom/sf-skills.

tsmztech/mcp-server-salesforce is MIT-licensed, needs Node.js 22 or later, and signs in with a Salesforce CLI login, a username with password and security token, OAuth client credentials, or an access token. Its tools include querying and changing records, managing objects and fields, and reading and writing Apex. With the CLI option, it reuses the org the Salesforce CLI is already authenticated to:

{ "mcpServers": { "salesforce": { "command": "npx", "args": ["-y", "@tsmztech/mcp-server-salesforce"], "env": { "SALESFORCE_CONNECTION_TYPE": "Salesforce_CLI" } } } }

A self-hosted server acts as whichever credential you configure, so everyone using that setup shares its access. Some of these tools, such as running anonymous Apex, can change an org in ways a record tool cannot, so vet a third-party server before you give it an org login.

Official, self-hosted or managed: which to use

Option
Runs on
Credential
Better fit when
Salesforce Hosted MCP Servers
Salesforce's infrastructure
Each user's own Salesforce sign-in through your org's External Client App
People use Claude, Cursor, Codex or another MCP client against their own org, or a product's agent works in orgs whose admins enable the servers and register it
Self-hosted server
Your machine, over stdio
A Salesforce CLI login, password and security token, or client credentials, in the server's environment
One developer works against a sandbox or scratch org, or you need tools the hosted servers don't offer
Managed per-user server
The vendor's infrastructure
Each end user's Salesforce OAuth tokens, stored and refreshed by the vendor
Your product's agent works across many customer orgs that can't each set up the hosted servers, or needs Salesforce APIs outside their tools

The hosted servers are the right default for people working in their own MCP client against their own org, and for a product whose customers can set them up. Salesforce maintains the tools and enforces each user's permissions.

Connect your own agent for many users

The Salesforce MCP vs API comparison concludes that interactive assistants fit the hosted MCP servers, background jobs fit the REST, Bulk and Metadata APIs, and most production agents end up using both. A product that acts for many users needs a token for each of them.

Salesforce's best practices advise using the hosted server rather than a custom proxy layer around the REST APIs, since the hosted server handles authentication, authorization and observability, and custom agents are among the clients it supports. Where your customers can do the setup, follow that advice: each customer's admin enables the servers and creates an External Client App with your callback URL, you keep that app's consumer key, and each user signs in. Salesforce enforces each user's permissions and logs every call under the hosted MCP client category.

That setup repeats in every customer org. Each org needs Enterprise Edition or above and Flex Credits, and Salesforce notes that ISV managed packages cannot yet include MCP server configurations, so each customer's admin builds any custom server. Because mcp_api excludes the REST APIs, an agent that also calls REST, Bulk or Metadata APIs needs the api scope as well.

Where that setup isn't possible, the agent calls the REST API as each user through one OAuth app that every customer org installs. Salesforce's security guide describes MCP calls as inheriting the access a user has over the REST API, so a REST call with that user's token gets the same object, field and sharing limits. Server enablement and the hosted MCP log category don't apply, so your product curates the tools and logs the calls. Built by hand, the REST path looks like this:

  1. Create an External Client App in a Salesforce Partner Business Org with a registered namespace, with the id, api and refresh_token scopes and PKCE required. Package it as a managed package and promote a version to get an install URL.
  2. Have each customer's Salesforce admin install the package once. Other users in that org can skip the install.
  3. Send each user through the authorization code flow with PKCE, and store their access token, refresh token and instance URL encrypted, keyed by your user ID. Calls go to each user's own org instance.
  4. Refresh each access token when it expires. Salesforce refresh tokens stay valid until revoked by default; the app's OAuth policies can shorten that or turn on rotation, which invalidates the old refresh token whenever a new one is issued.
  5. Revoke the tokens through Salesforce's revocation endpoint, /services/oauth2/revoke on login.salesforce.com, and delete them when the user disconnects.

Per-user OAuth for MCP integrations covers this design and its failure modes in more depth.

With Scalekit AgentKit

AgentKit is an MCP gateway that runs each user's OAuth flow, stores their tokens encrypted with AES-256, refreshes them and calls tools as that user. Its Salesforce connector uses OAuth 2.0 with your own External Client App and lists 74 tools: 35 read, 28 write and 11 destructive. They cover CRM records, SOQL and SOSL, reports, dashboards, Chatter and Tooling API queries.

A user's authorization link opens on an install screen: an admin installs your package, and later users in that org confirm it is installed and sign in.

You create a Virtual MCP server once per agent role and choose its tools. All users share its URL. Before each run, your back end mints a session token for one user, and the agent connects with that token. Scalekit checks the token, finds that user's Salesforce account and calls Salesforce as that user, so your agent never sees their Salesforce token. AgentKit logs every tool call with the tool name, user identifier and status for 90 days.

Once per agent role: create the server.

import os from scalekit import ScalekitClient from scalekit.actions.models.mcp_config import McpConfigConnectionToolMapping actions = ScalekitClient( env_url=os.environ["SCALEKIT_ENVIRONMENT_URL"], client_id=os.environ["SCALEKIT_CLIENT_ID"], client_secret=os.environ["SCALEKIT_CLIENT_SECRET"], ).actions server = actions.mcp.create_config( name="sales-pipeline-assistant", connection_tool_mappings=[ McpConfigConnectionToolMapping( connection_name="salesforce", # your Salesforce connection tools=[ "salesforce_query_soql", "salesforce_account_get", "salesforce_opportunity_get", "salesforce_opportunity_update", ], ) ], ).config print(server.id, server.mcp_server_url)

Before each run: check the user's account, then mint a token. This run only reads, so the token is read-only:

from datetime import timedelta user_id = "user_123" # your app's stable ID for this user accounts = actions.mcp.list_mcp_connected_accounts( config_id=server.id, identifier=user_id, include_auth_link=True ) for account in accounts.connected_accounts: if account.connected_account_status != "ACTIVE": print("Send the user this link:", account.authentication_link) session = actions.mcp.create_session_token( mcp_config_id=server.id, identifier=user_id, expiry=timedelta(minutes=30), access_level="READ_ONLY", )

During the run: connect any MCP client with the server URL and the session token as a bearer header. With the Python MCP SDK (version 2):

import asyncio import httpx2 from mcp import Client from mcp.client.streamable_http import streamable_http_client SOQL = ( "SELECT Id, Name, StageName, Amount FROM Opportunity " "WHERE IsClosed = false ORDER BY CloseDate LIMIT 5" ) async def run(): headers = {"Authorization": f"Bearer {session.token}"} async with httpx2.AsyncClient(headers=headers, timeout=30) as http: url = server.mcp_server_url transport = streamable_http_client(url, http_client=http) async with Client(transport) as mcp: tools = await mcp.list_tools() print([tool.name for tool in tools.tools]) result = await mcp.call_tool( "salesforce_query_soql", {"query": SOQL} ) print(result.is_error, result.content) asyncio.run(run())

How session tokens behave:

  • A token is bound to one user and one server. Sent to any other server URL, it is rejected with a 401.
  • It lasts one hour by default, and you can set anything from 60 seconds to 24 hours.
  • It is short-lived by design and is not refreshed. Mint a new one per run, per chat session, or on a schedule for a long-running host. A new token does not revoke earlier ones.
  • With access_level="READ_ONLY", the run sees only the server's read-only tools. salesforce_opportunity_update is left out of the tool list, and a call to it is refused before it reaches Salesforce.

For an agent that should see every Salesforce tool, skip the Virtual MCP server and use the connection's own MCP server, whose URL is your environment URL followed by /mcp/v3/connections/salesforce, minting the token with connection_name="salesforce". To revoke one user, delete their connected account; their next call fails until they authorize again, and other users keep working:

actions.delete_connected_account( connection_name="salesforce", identifier=user_id )

Security notes

  • Start with read access. Salesforce suggests trying platform/sobject-reads in a sandbox first. Named Queries and custom tools narrow access further, and with Scalekit a read-only session token does the same for a run.
  • Require approval for writes. An instruction hidden in a record or email should not be able to change data without a person approving it. Cursor asks before using MCP tools by default. In Codex, default_tools_approval_mode = "writes" prompts for tools not marked read-only. In Claude Code, an ask rule such as mcp__salesforce__* in /permissions makes every call to the salesforce server you added wait for you.
  • Set annotations on custom tools. Salesforce's platform tools carry readOnlyHint and destructiveHint. A custom tool without them is treated as potentially destructive.
  • Tighten the External Client App. Salesforce recommends refresh tokens valid for 30 days or less with rotation on, a permission set to limit which users can connect, and single logout so that revoking a Salesforce session ends the MCP client session. IP restrictions also work, but some MCP clients use more IP ranges than Salesforce's allowlist can hold.
  • Audit by user. Every hosted MCP call appears in Salesforce's API logs under the user who authorized it. Filter on API_CLIENT_CATEGORY = SALESFORCE_HOSTED_MCP to see MCP traffic.

FAQs

Does Salesforce have an official MCP server?

Yes. Salesforce Hosted MCP Servers became generally available on April 29, 2026, at URLs under https://api.salesforce.com/platform/mcp/v1/. Admins enable standard servers and can build custom ones from Flows, Apex and Named Queries.

Which Salesforce edition do hosted MCP servers need?

Salesforce's general availability announcement says they are available for every Enterprise Edition org and above. The developer docs say they are intended only for customers with Flex Credits and that server usage may be billed.

Can I connect with a Connected App or dynamic client registration?

No. Salesforce supports only External Client Apps for MCP authentication, and dynamic client registration is not supported. An admin creates the app with the mcp_api and refresh_token scopes and adds each client's callback URL.

Can a background agent use the hosted servers without a user?

No. The servers accept only the OAuth authorization code flow with PKCE, with no service accounts or machine-to-machine flows, so every call runs as a named user who signed in. For scheduled jobs, the Salesforce MCP vs API comparison recommends Salesforce's REST, Bulk and Metadata APIs.

What is happening to the Salesforce DX MCP server?

The local @salesforce/mcp server reaches end of life on November 2, 2026. Salesforce now ships developer tooling as skills in forcedotcom/sf-skills.

How do I connect Claude Code to Salesforce's MCP server?

Either add the server as a custom connector in Claude with your External Client App's consumer key, which Claude Code picks up when you sign in with a claude.ai subscription, or run claude mcp add with --client-id and --callback-port, register http://localhost:8080/callback (or your chosen port) on the app, and run claude mcp login salesforce.

Details checked October 2026.

No items found.
Agent
Auth Quickstart
On this page
Share this article
Agent
Auth Quickstart

Acquire enterprise customers with
‍zero upfront cost.

Every feature unlocked. No hidden fees.