sfmc_mcp
A Node.js server implementing the Model Context Protocol (MCP) for Salesforce Marketing Cloud (SFMC). Provides modular tools for interacting with SFMC campaigns, assets, data extensions, etc. Enabling automation, integration, and advanced workflows via MCP-compatible clients.
claude mcp add --transport stdio alandelacanal-sfmc_mcp node C:\wks\my\Projects\mcps\sfmc_mcp\build\server.js \ --env MCP_WS_PORT="3000" \ --env MCP_TRANSPORT="stdio" \ --env SFMC_CLIENT_ID="your-client-id" \ --env SFMC_AUTH_BASE_URI="https://yourdomain.auth.marketingcloudapis.com" \ --env SFMC_CLIENT_SECRET="your-client-secret" \ --env SFMC_REST_BASE_URI="https://yourdomain.rest.marketingcloudapis.com"
How to use
This MCP server for Salesforce Marketing Cloud (SFMC) exposes capabilities around Data Extensions and Assets. It currently supports querying data from Data Extensions, retrieving data from a specific Data Extension, and obtaining the fields of a Data Extension. In practice, you deploy the server, point an MCP client at the provided URL, and use the client’s interface to run the available operations against your SFMC instance. The server reads SFMC credentials from environment variables and uses the REST and Auth base URIs to authenticate and query SFMC resources. When running in server mode with a streamable transport, you can connect an Inspector tool to validate requests and monitor traffic.
How to install
Prerequisites:
- Node.js and npm installed on your machine
- Access to SFMC with a registered integration (Client ID and Client Secret)
Step-by-step installation:
- Clone or download the repository for sfmc_mcp.
- Install dependencies: npm install
- Build the MCP server: npm run build
- Prepare environment variables (example): SFMC_CLIENT_ID="your-client-id" SFMC_CLIENT_SECRET="your-client-secret" SFMC_AUTH_BASE_URI="https://yourdomain.auth.marketingcloudapis.com" SFMC_REST_BASE_URI="https://yourdomain.rest.marketingcloudapis.com" MCP_TRANSPORT="stdio" # or "stream" for remote development MCP_WS_PORT="3000"
- Run the server in client mode (example): node build/server.js
- Optional: add the SFMC server configuration to your MCP client: { "mcpServers": { "sfmc": { "command": "node", "args": [ "C:\wks\my\Projects\mcps\sfmc_mcp\build\server.js" ], "env": { "SFMC_CLIENT_ID": "your-client-id", "SFMC_CLIENT_SECRET": "your-client-secret", "SFMC_AUTH_BASE_URI": "https://yourdomain.auth.marketingcloudapis.com", "SFMC_REST_BASE_URI": "https://yourdomain.rest.marketingcloudapis.com" } } } }
Additional notes
Tips and common considerations:
- Ensure your SFMC integration has the required permissions to access Data Extensions and their fields.
- If you change SFMC base URIs, update SFMC_AUTH_BASE_URI and SFMC_REST_BASE_URI accordingly.
- When running in server mode, MCP_TRANSPORT should be set to stdio for local development or stream for remote/ inspector usage.
- The MCP WS port can be changed from the default 3000 to fit your network environment; ensure firewall rules allow this port.
- For debugging, you can use the MCP Inspector by running the inspector tool and selecting the appropriate transport and URL, for example http://localhost:4042/mcp, as described in the readme.
- If you encounter authentication errors, double-check the Client ID/Secret and the OAuth base URI in SFMC.
Related MCP Servers
deploystack
Open source MCP hosting - deploy MCP servers to HTTP endpoints for n8n, Dify, Voiceflow, and any MCP client.
js
🔐 Plug-and-play auth for Node.js MCP servers.
sfcc-dev
Supercharge your Salesforce B2C Commerce Cloud development with AI-powered documentation access, real-time log analysis, and intelligent best practices guidance
openapi-to
Turns any OpenAPI/Swagger API into an MCP server. One MCP tool per endpoint, Streamable HTTP - for AI clients calling your REST API.
Notion
A Model Context Protocol (MCP) server for integrating with Notion workspaces (made before the official one 😅)
sf
A very simple implementation of Salesforce MCP server for Claude for Desktop