Getting Started with Claude Code and the Marketing Cloud Engagement MCP Server

Overview

Salesforce’s new Marketing Cloud Engagement MCP Server (Summer ’26 release) makes it possible to securely connect AI assistants like Claude Code directly to your Marketing Cloud instance. Instead of relying on generic knowledge, Claude can work with your actual Data Extensions, Journeys, Automations, and other Marketing Cloud assets through Salesforce-supported APIs. In this article, we’ll configure the MCP Server, connect it to Claude Code, and get everything ready to start using AI as a practical Marketing Cloud assistant.

What is MCP?

Model Context Protocol (MCP) is an open standard that allows AI assistants to communicate with external applications. Think of it like a translator between your AI assistant and another platform.

Without MCP, if you were to ask your AI assistant “Claude, what fields are in my Data Extension?”, Claude would have no idea.

With MCP, Claude can securely ask Marketing Cloud, retrieve the schema, and answer based on your actual environment instead of making educated guesses. Salesforce’s hosted Marketing Cloud Engagement MCP server exposes Marketing Cloud capabilities through standard APIs, allowing supported AI assistants to interact with your tenant using your own authenticated permissions.

Prerequisites

Before getting started you’ll need:

  • A Marketing Cloud Engagement account
  • Permission to create Installed Packages
  • Claude Code CLI (or another supported assistant) installed locally
  • A Claude account

Salesforce currently provides a hosted MCP server, so there’s nothing for you to deploy yourself. You’ll simply create an Installed Package, connect Claude Code to the endpoint and authenticate.

Note: Other documentation available online suggests that Gemini CLI is another supported assistant that can support this on their free platform. In my testing, I ran into deprecation errors that suggested I needed Google Antigravity, which once installed, I couldn’t get to authenticate on their free platform before running out of tokens. Your mileage may vary, if you get it working I’d love to hear about it in the comments!

SFMC Setup

Create an Installed Package

  1. Navigate to Setup > Apps > Installed Packages
  2. Click “New”
  3. Give your package a meaningful name and description

Add an API Integration Component

  1. Add a New Component to your package.
  2. Select “API Integration”.
  3. Choose “Public App”.

Configure the App Properties

  1. Think carefully about what you’d like to give your AI assistant the capabilities to be able to execute within your Marketing Cloud Engagement instance. With write and send access comes great responsibility. Ultimately, you are responsible for the actions your assistant takes on your behalf, and you should follow the principle of least privilege here as well as everywhere else in your Salesforce instances.
  2. The property section requests us to set a Redirect URI, which we can’t do at the moment. Let’s use https://salesforce.com as a placeholder for now.
  3. Check off the permissions you’d like to grant your assistant. In our use case, we’ll grant read/write access to Email, Data Extensions, Automations, and Journeys. We will not be granting send privileges or access to contact creation.
  4. Save.

Configure the URI

  1. After saving, review the Installed Package screen. Take note of your Client ID and and Tenant ID. These are sensitive values, so they have been blocked visually here – be sure to guard your app details closely.
    • Your ClientID is clearly labeled in the API Integration section under Components
    • Your Tenant ID can be found in the Authentication Base URI section: https://yoursampletenant-here.auth.marketingcloudapis.com
  2. Edit the API Integration component you just created earlier.
  3. Configure the Redirect URI by replacing the https://salesforce.com placeholder with the appropriate URI endpoint provided in the official documentation:
    • North America: https://mai-mce-mcp-cdp1.sfdc-yfeipo.svc.sfdcfc.net/t/{tenantId}/c/{clientId}/api/mcp/oauth/callback
    • Europe: https://mai-mce-mcp-cdp1.sfdc-yzvdd4.svc.sfdcfc.net/t/{tenantId}/c/{clientId}/api/mcp/oauth/callback
  4. Replace the {tenantID} and {clientID} with the values you noted in step 1.
  5. Save.

Grant User Access

  1. If other users will require access to the installed package, grant them access
  2. Alternatively, license all current and future users (not recommended!)

Claude Code Setup

Add the MCP Server to Claude Code

  1. Navigate to your project folder in your CLI.
  2. Add the MCP. In Claude Code, the request is formatted like the below, with you providing:
    • CONFIG_NAME desired. I used mcdemo-claude-mcp, which is also the name of my project folder
    • Your desired US or Europe URI endpoint from above
    • Your tenantID from above
    • Your clientID from above
  3. Run the command
claude mcp add \
-s user \
--transport http \
CONFIG_NAME \
https://mai-mce-mcp-cdp1.sfdc-yfeipo.svc.sfdcfc.net/t/{tenantID}/c/{clientID}/api/mcp

Restart your CLI

  1. After adding the MCP, you may need to restart your CLI for the changes to be recognized

Verify MCP Installation

  1. After restarting your CLI, validate the installation by running claude mcp list
  2. You should see your installed MCP details. You may see a warning asking you to authenticate, which we’ll do next

Authenticate the MCP

  1. To authenticate, run authentication via the command /mcp
  2. Follow the on screen prompts, which will open a browser window for authentication
  3. After authenticating, you should receive a Success message.
  4. You can validate the connection by running mcp list again, which should now show a “Connected” status after your MCP details

Let’s Test!

Now that we’re connected, we can take begin building in Marketing Cloud Engagement based off the permissions we configured in our installed package above. Let’s submit a request to build a data extension and validate.

Here’s the prompt I used to create a new data extension:

Please create a non-sendable data extension in Marketing Cloud Engagement. Create it in the Data Extensions > HandsOn > BostonMarketer Group > MCP folder. Create a text field, length 18, named SubscriberKey, which is the primaryKey. Create a text field for EmailAddress, type Email, length 254. Create a date field named DateToSFMC, date type, default value GetDate(). Explain the actions you will take back to me and ask for confirmation prior to executing any actions in Marketing Cloud Engagement.

And here’s a screenshot of the response I got from Claude Code:

How cool is that? Claude flagged a couple details it needed that I had failed to provide and prompted me to complete them so it could successfully make the requests.

Here’s a screenshot of my response and the eventual output:

Claude is claiming success, though after struggling with hallucinations in a few other tools, we’ll want to make sure by validating in Marketing Cloud Engagement. Let’s navigate into our instance and double check in the UI.

Our data extension is there, exactly as we requested. A successful test!

Recap

Connecting Claude Code to the Marketing Cloud Engagement MCP Server gives your AI assistant access to your actual Marketing Cloud environment instead of relying on generic knowledge. Whether you’re creating Data Extensions, exploring Journeys, documenting your instance, or troubleshooting existing assets, the MCP Server can dramatically speed up day-to-day administration while keeping you in control of what actions are taken.

As with any integration, it’s important to be intentional about security. Create a dedicated Installed Package for AI use, grant only the permissions your use case requires, and follow the principle of least privilege. Avoid granting send or contact management permissions unless they’re truly needed, and always use a dedicated API integration rather than sharing credentials. Even though Claude can explain its intended actions and ask for confirmation before making changes, treat AI as an assistant—not an autonomous administrator. Review generated code, validate changes in Marketing Cloud, and confirm the results before relying on them in production.

This is only the beginning of what’s possible. As Salesforce continues to expand MCP capabilities and AI assistants become more capable, having a secure connection between your AI tools and Marketing Cloud Engagement is likely to become an increasingly valuable part of every consultant’s and administrator’s toolkit.

Interest in learning more? Join us for our Marketing Cloud Mondays weekly hands-on sessions where we create and build these solutions live.

Sign up here: https://trailblazercommunitygroups.com/salesforce-marketer-group-boston-united-states/

Leave a comment