What if you could act on Salesforce records and run business logic without having to log into Lightning Experience? For example, in the context of a hotel management application, you could use an agent with tools that load upcoming reservations, analyze popular events around the hotel’s location and then create personalized marketing campaigns around those events without having to leave the chat interface of the agent. Now, you can do so with Headless 360 using agentic tools like Claude Desktop or Claude Code to interact with the Salesforce Platform through the Model Context Protocol (MCP).

In this post, we’ll explore the benefits of working with MCP servers, then we’ll focus specifically on how to configure Claude for MCP, and finally, we’ll share some sample use cases.

What are Salesforce Hosted MCP Servers?

The Model Context Protocol (MCP) is an open standard that lets agentic tools like Postman or AI agents like Claude interact with external tools and data sources from various vendors. In the context of Salesforce, it means that you can run SOQL queries, modify records, and execute actions directly from a third-party agent. In other words, you don’t have to log into Salesforce and you’re no longer limited to using Agentforce to interact with your data from agents.

In order to perform operations on Salesforce with agents, you use MCP servers that expose tools and prompts. You can configure and host your own Salesforce MCP Server or use the Salesforce Hosted MCP Servers that are now generally available. We’ll only focus on the latter in this post since this approach saves you from the burden of hosting, securing, and maintaining the server.

Standard Salesforce Hosted MCP Servers

In addition to the Salesforce DX MCP Server used for development purposes, Salesforce offers a number of standard hosted MCP servers out of the box for daily operations. These allow agents to access our Headless 360 portfolio ranging from the Salesforce Platform, Data 360, Tableau, and MuleSoft. You can also connect directly to the Slack hosted MCP server.

Custom Salesforce Hosted MCP Servers

If the standard hosted MCP servers do not fit your needs, you can also create custom hosted MCP servers. This option gives you granular control over the tools and prompts that the server exposes, and lets you add custom tools and prompts.

You can build custom MCP tools from the following types:

  • Apex Action: Expose invocable Apex Actions (@InvocableMethod annotated Apex methods) as MCP tools
  • Lightning Flows: Expose autolaunched flows as MCP tools
  • Apex REST: Expose custom Apex REST endpoints as MCP tools.
  • AuraEnabled: Expose @AuraEnabled (see docs) annotated Apex methods as MCP tools
  • Named Query API: Expose Named Query APIs as MCP tools to provide access to specific parametrized SOQL queries

You can also create custom MCP prompts from Flex prompt templates built with Prompt Builder. Using MCP prompts in an agent lets you call those parametrized prompt templates as commands. For example, if you expose a “Generate Personalized Schedule” prompt template, you can run the following command in Claude (you don’t have to type the full tool name, autocomplete provides the prompt description).

Screenshot of Claude Code autocompleting a custom Salesforce MCP prompt command.

Now that we’ve seen the benefits of working with the Salesforce Hosted MCP Servers, let’s look at how to configure Claude to leverage them.

Configure Claude to work with Salesforce Hosted MCP Servers

Configuring Claude to connect with the hosted MCP servers is a three-step process:

  1. Activate Salesforce Hosted MCP Servers
  2. Create an external client app
  3. Connect Claude to the Salesforce Hosted MCP Servers

Note: Claude is available in different surfaces. In this post, we’ll cover Claude Code (the CLI experience) and Claude Desktop (the desktop app).

As part of the setup, you’ll need to set up an external client app (ECA) so that Claude can authenticate via OAuth 2.0 with Salesforce to use the hosted MCP servers. An ECA tells Salesforce which external applications are allowed to connect to your org and what they’re allowed to do. Standard Salesforce user access permissions apply in addition to the app-level access checks.

Schema illustrating how the Claude MCP client authenticates with the external client app and calls Salesforce Hosted MCP Servers

Step 1: Activate Salesforce Hosted MCP Servers

The standard Salesforce Hosted MCP Servers are inactive by default. Follow these steps to activate them:

  1. In Setup, search for MCP Servers.
  2. Click the Salesforce Servers tab.
  3. Repeat the following steps for each server that you want to activate:
    1. Click on the server name.
    2. Click Activate.
    3. Copy the server’s API Name without the platform. suffix and the Server URL. We’ll need those in the next step.

Screenshot showing a list of Salesforce Hosted MCP Servers with some active

Step 2: Create an external client app

Follow these steps to create an ECA:

  1. In Setup, search for External Client App Manager and click New External Client App.
  2. Under Basic Information, fill in the required fields:

    Field name Field Value
    App Name Claude MCP Client
    API Name Claude_MCP_Client (auto-filled)
    Contact Email Your email address
  3. Expand the API (Enable OAuth Settings) section, check Enable OAuth and configure the following app settings:
    1. Callback URL with either:
      • https://claude.ai/api/mcp/auth_callback for Claude Desktop
      • http://localhost:38000/callback for Claude Code. Use this if you only have an Anthropic API key provisioned for you by your enterprise. Otherwise, we recommend setting up connectors in your Claude.ai account, then using them in Claude Code.
    2. Selected OAuth scopes:
      • Perform requests at any time (refresh_token, offline_access)
      • Access Salesforce Hosted MCP Servers (mcp_api)
  4. Under Security, apply the following:
    1. Uncheck these boxes:
      • Require secret for Web Server Flow
      • Require secret for Refresh Token Flow
    2. Check these boxes:
      • Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows
      • Issue JSON Web Token (JWT)-based access tokens for named users 

        At this point, your ECA configuration should look like this:
        Screenshot of the ECA configuration

  5. Click Create to save the app.

Now that the app is created, you need to retrieve the connection information:

  1. Navigate to the Settings tab and expand OAuth Settings.
  2. Click Consumer Key and Secret.
  3. Complete the authentication dialog with the verification code.
  4. Copy the Consumer Key and Consumer Secret.

Step 3: Connect Claude to the Salesforce Hosted MCP Servers

The last step of the integration process is to configure the Salesforce MCP Server connections in Claude.

The instructions differ depending on whether you use Claude Code or Desktop (in particular the ECA callback URL). We’ll dive into how to configure Claude Code here, and you can find instructions for Claude Desktop in the docs.

Instructions for Claude Code

  1. Run the following command in a terminal where:
    MY_MCP_SERVER_NAME is replaced by the name of the server that you’re connecting to. You’re free to enter any value, but we recommend that you stick to the following convention: salesforce- followed by the API name of the MCP server. For example: salesforce-sobject-all for the sobject-all server.
    MY_MCP_SERVER_URL is replaced by the MCP server URL that you copied earlier. Pay attention to the fact that server URLs differ depending on whether you are connecting to a production or sandbox/scratch org.
    MY_ECA_CONSUMER_KEY is replaced by the ECA consumer key you’ve obtained in the previous step.

    For example, to install the sobject-all MCP server from a scratch org, run:

  2. When prompted to do so, paste the ECA consumer secret you’ve obtained previously.
  3. Launch Claude Code with the claude terminal command.
  4. Run /mcpto list the MCP servers.
  5. Select your newly added MCP server from the list (it is annotated with a “needs authentication” message).
  6. Select Authenticate.
  7. When prompted, allow access to the MCP server.

      Screenshot of the dialog asking to grant access to the MCP server

      Once you authorize the connection, Claude Code lists your MCP server as “connected.”

      Screenshot of Claude Code showing the newly added MCP server in the “connected” state

      Some practical examples of Claude working with Salesforce Hosted MCP Servers

      Let’s assume that you work at Coral Cloud Resorts, a fictitious resort that offers tailored experience to their guests using Headless 360. You can use Claude and our MCP servers for a number of tasks.

      Analyzing daily bookings

      Let’s imagine that as the resort manager, you want to review customer bookings on a weekly basis.

      In traditional Salesforce operations, you would build a report and then generate a dashboard out of it. To access it, you would need tens of clicks in Lightning Experience.

      With Claude, all you have to do is use natural language, such as “Show me a report of daily bookings. Use the start date to group bookings,” to get the trend of your bookings with some additional insights that would require that you set up Tableau reports. You can also drill down by interacting further with Claude with follow up questions.

      Reading data is nice, but agents can take things further with MCP and take action.

      Mass cancelling bookings using a custom server and a flow

      Running a resort is no simple feat, and there can be unforeseen events (such as jellyfish invasions) that lead to booking cancellations. Should such unlikely scenarios occur, the resort staff is left scrambling to mass cancel bookings with hundreds of clicks, which is a repetitive and error-prone process.

      Instead, you can leverage Headless 360 and expose our existing Cancel Booking flow as a custom hosted MCP server.

      Screenshot of a custom hosted MCP server exposing a Cancel Booking flow

      Note: in this basic example, you use a flow to cancel a single booking at a time. However, in production, we recommend creating a dedicated flow to process cancellations in bulk to reduce API calls and scale.

      Once the custom MCP server is added to Claude, you can run the cancellations with a prompt that combines multiple calls to our various MCP servers. Note how the prompt is structured to keep the human in the loop: you validate the data before running the cancellation batch.

      These are two basic examples of what you can do with Claude and Salesforce Hosted MCP Servers, ranging from standard actions to custom scenarios.

      Conclusion

      You’ve now had a glimpse at how Salesforce Hosted MCP Servers let you use agents like Claude to interact with Headless 360 without requiring users to log into Lightning Experience. You’ve learned how to configure Claude Code and Claude Desktop to connect with Salesforce Hosted MCP Servers, and you saw some practical examples of what can be done with those servers.

      Now, it’s your turn to put Headless 360 to the test by building custom tools and configuring MCP servers to power your business.

      Resources

      About the Author

      Philippe Ozil is a Principal Developer Advocate at Salesforce, where he focuses on the Salesforce Platform. He writes technical content and speaks frequently at conferences. He is a full-stack developer and enjoys working with APIs, DevOps, robotics, and VR projects. Follow him on X, LinkedIn, and Bluesky, and check out his GitHub projects.