mcp-server-sfmc — Claude Code MCP server
Gives an AI assistant working knowledge of AMPscript, SSJS, GTL and Handlebars in Salesforce Marketing Cloud, plus code validation and a path to Marketing Cloud Next.
claude mcp add mcp-server-sfmc -- npx -y mcp-server-sfmcWhat mcp-server-sfmc does
The server exposes Salesforce Marketing Cloud language intelligence as Model Context Protocol tools, resources and prompts. It runs on sfmc-language-lsp, the engine behind the SFMC Language Service VS Code extension. Your assistant can then check code: syntax errors, unknown functions, wrong argument counts, SSJS syntax that is not supported.
Two searchable doc indexes ship with it — Salesforce Help for Marketing Cloud Engagement administration, and the Marketing Cloud Next developer reference covering the REST API. The server figures out whether a project targets MCE or MCN on its own. On MCN, completions and validation stick to functions that platform supports, SSJS is flagged as unsupported, and behavioural differences show up in hover text and diagnostics. A migration toolkit analyses code and rewrites AMPscript into Handlebars and SSJS into Handlebars.
It runs locally over stdio and needs Node.js and npm, since npx comes from npm. The first run may pull the package from npm. In VS Code, version 1.101+ of the SFMC Language Service extension registers the server for you, so .vscode/mcp.json stays untouched. For CI there is a bundled CLI, sfmc-review-diff: it spawns the server, calls review_change on a unified diff and exits non-zero on ERROR by default. Ready-made pipeline files sit in ci-templates/ for GitHub Actions, GitLab CI, Jenkins, Azure Pipelines and Bitbucket Pipelines.
What it helps with
- catch syntax errors and unknown functions in AMPscript
- convert AMPscript or SSJS to Handlebars for Marketing Cloud Next
- pull up the right MCE help page or MCN doc from the assistant
- spot MCN-incompatible functions before deploy
- fail a CI job when a diff review reports an error
Example prompts for the agent
- Check this AMPscript for errors and tell me what Marketing Cloud Next does not support
- Rewrite the SSJS in
process.jsas Handlebars for MCN - Find the MCE help page on sending through the API
How to install mcp-server-sfmc
Platform CLI
claude mcp add mcp-server-sfmc -- npx -y mcp-server-sfmcPlatform CLI
codex mcp add mcp-server-sfmc -- npx -y mcp-server-sfmcConfig file
{
"mcpServers": {
"mcp-server-sfmc": {
"command": "npx",
"args": [
"-y",
"mcp-server-sfmc"
]
}
}
}Config file
{
"servers": {
"mcp-server-sfmc": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-server-sfmc"
]
}
}
}Platform CLI
gemini mcp add mcp-server-sfmc npx -y mcp-server-sfmcStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-server-sfmc
How do I install mcp-server-sfmc in Claude Code?
Run claude mcp add mcp-server-sfmc -- npx -y mcp-server-sfmc. Node.js and npm are required, because the server starts through npx.
What does mcp-server-sfmc do?
It hands your assistant tools for Salesforce Marketing Cloud languages: validation of AMPscript, SSJS, GTL and Handlebars, search across MCE and MCN documentation, and a migration toolkit for Marketing Cloud Next.
How is it different from the SFMC Language Service extension?
The extension handles editing — syntax, LSP, snippets. The server only makes the same language features available to tools that speak the Model Context Protocol. With extension version 1.101 or newer, it registers the server in VS Code itself.