mcp-server-sfmc 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # mcp-server-sfmc
2
2
 
3
- MCP server providing Salesforce Marketing Cloud language intelligence — AMPscript, SSJS, and GTL — as Model Context Protocol tools, resources, and prompts for AI-assisted development and code review.
3
+ MCP server providing Salesforce Marketing Cloud language intelligence — AMPscript, SSJS, and GTL — as Model Context Protocol tools, resources, and prompts for AI-assisted development and code review. It also ships a **searchable index** of mirrored Salesforce Help for **Marketing Cloud Engagement** administration and setup (business units, Journey Builder, Automation Studio, tenants, and similar topics), with explicit scoping vs **Marketing Cloud Next** (a separate product).
4
4
 
5
5
  Built on [sfmc-language-lsp](https://github.com/JoernBerkefeld/sfmc-language-lsp), the same engine that powers the [SFMC Language Service VS Code extension](https://marketplace.visualstudio.com/items?itemName=joernberkefeld.sfmc-language).
6
6
 
@@ -43,6 +43,7 @@ None of these replace the VS Code extension for **editing** (syntax, LSP, snippe
43
43
  | **Completions** | AMPscript function/keyword completions, SSJS Platform API catalog |
44
44
  | **Prompts** | Guided prompts for writing AMPscript, SSJS, reviewing code, and converting between the two |
45
45
  | **Resources** | Full function catalogs, keyword list, unsupported ES6+ syntax list |
46
+ | **MCE help search** | Bundled excerpts from local Help mirrors (`docs/help.salesforce/mce`) with Engagement vs Next labeling |
46
47
 
47
48
  ## Quick start
48
49
 
@@ -140,6 +141,7 @@ Then replace `"command": "npx", "args": ["-y", "mcp-server-sfmc@latest"]` with:
140
141
  | `get_ampscript_completions` | List valid completions at a given cursor position in AMPscript |
141
142
  | `get_ssjs_completions` | List SSJS Platform API completions, optionally filtered by prefix |
142
143
  | `format_sfmc_code` | Apply basic formatting conventions (keyword casing, quote normalisation) |
144
+ | `search_mce_help` | Search bundled Marketing Cloud setup/ops help; use `product_focus` to target **Engagement** vs **Next** |
143
145
 
144
146
  ## Resources
145
147
 
@@ -149,6 +151,8 @@ Then replace `"command": "npx", "args": ["-y", "mcp-server-sfmc@latest"]` with:
149
151
  | `sfmc://ssjs/functions` | Full SSJS function catalog |
150
152
  | `sfmc://ampscript/keywords` | All AMPscript keywords |
151
153
  | `sfmc://ssjs/unsupported-syntax` | ES6+ features not supported in SFMC SSJS |
154
+ | `sfmc://mce/product-context` | How **Marketing Cloud Engagement** differs from **Marketing Cloud Next** (when to use which) |
155
+ | `sfmc://mce/help-index` | List of bundled help files and section counts per product scope |
152
156
 
153
157
  ## Prompts
154
158
 
@@ -160,6 +164,90 @@ Access via `/mcp.sfmc.writeAmpscript` etc. in VS Code, or via the prompts API:
160
164
  | `writeSsjs` | Generate SSJS code for a described task |
161
165
  | `reviewSfmcCode` | Review AMPscript or SSJS code for bugs and best-practice violations |
162
166
  | `convertAmpscriptToSsjs` | Convert AMPscript code to equivalent SSJS |
167
+ | `answerMceHowTo` | Guided prompt for admin/setup questions — searches bundled help and keeps Engagement vs Next explicit |
168
+
169
+ ## Writing effective prompts
170
+
171
+ ### Automatic tool use
172
+
173
+ Clients that honour the MCP `instructions` field (Cursor, Claude Desktop, GitHub Copilot Agent mode) will call `search_mce_help` automatically whenever you ask an MCE administration or setup question — no special phrasing needed. If your client does not process server instructions, or if you want explicit control, the templates below help.
174
+
175
+ ### Quick reference: which tool or prompt to use
176
+
177
+ | Situation | What to do |
178
+ |---|---|
179
+ | MCE admin question (classic Engagement) | Ask naturally; the server will call `search_mce_help` for you. Or use the `answerMceHowTo` prompt with `assumeProduct: engagement`. |
180
+ | Marketing Cloud Next question | Use `answerMceHowTo` with `assumeProduct: next`, or add "for Marketing Cloud Next" to your question. |
181
+ | Not sure which product | Use `answerMceHowTo` with `assumeProduct: unsure`, or add "check both Engagement and Next" to your question. |
182
+ | Write or validate AMPscript | Use the `writeAmpscript` prompt, or ask directly (the server auto-validates). |
183
+ | Write or validate SSJS | Use the `writeSsjs` prompt, or ask directly. |
184
+ | Review a code diff | Use the `reviewSfmcCode` prompt or mention "review the following diff". |
185
+
186
+ ### Copy-paste prompt templates
187
+
188
+ #### Classic Engagement admin (most common)
189
+
190
+ ```
191
+ Search the Marketing Cloud Engagement help (product_focus: engagement) and tell me:
192
+ <your question here>
193
+
194
+ Cite which product version your steps apply to and note if the bundled docs are incomplete.
195
+ ```
196
+
197
+ #### Marketing Cloud Next
198
+
199
+ ```
200
+ Search the Marketing Cloud Next help (product_focus: next) and tell me:
201
+ <your question here>
202
+
203
+ Confirm the steps apply to Marketing Cloud Next, not classic Engagement.
204
+ ```
205
+
206
+ #### Unknown product / migration question
207
+
208
+ ```
209
+ Search both Marketing Cloud Engagement and Next help (product_focus: any) and tell me:
210
+ <your question here>
211
+
212
+ Separate the steps for classic Engagement vs Marketing Cloud Next clearly.
213
+ ```
214
+
215
+ #### Explicit use of the answerMceHowTo prompt
216
+
217
+ In clients that support MCP prompts (e.g. VS Code with the `/mcp.sfmc.answerMceHowTo` command):
218
+
219
+ ```
220
+ /mcp.sfmc.answerMceHowTo
221
+ question: "How do I create a child business unit and assign it a sender profile?"
222
+ assumeProduct: engagement
223
+ ```
224
+
225
+ #### Combining MCE admin with code
226
+
227
+ ```
228
+ 1. Use search_mce_help (product_focus: engagement) to find the correct Journey Builder entry event
229
+ configuration steps, then
230
+ 2. Write the AMPscript snippet that reads the data extension row inside the journey email.
231
+ ```
232
+
233
+ ### What to expect from the AI
234
+
235
+ - The AI cites the product scope (Engagement or Next) in every answer.
236
+ - If the bundled excerpts do not cover the question fully, the AI says so and suggests verifying in the live Salesforce Help.
237
+ - Function signatures (AMPscript / SSJS) are always sourced from the language catalog, not from training data.
238
+
239
+ ## Refresh bundled Marketing Cloud Engagement help
240
+
241
+ The published npm package includes `bundled/mce-help/chunks.json`, built from a checkout that contains the mirrored Help tree at `docs/help.salesforce/mce` (for example in this monorepo). To regenerate after updating those docs:
242
+
243
+ ```bash
244
+ cd mcp-server-sfmc
245
+ npm run bundle-mce-help
246
+ npm run build
247
+ npm test
248
+ ```
249
+
250
+ Override the source path: `MCE_HELP_DOCS=/absolute/path/to/mce npm run bundle-mce-help`
163
251
 
164
252
  ## AI code review in pull requests
165
253