@lumeo-ui/mcp-server 4.2.0 → 4.3.0

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/dist/index.js CHANGED
@@ -159,9 +159,23 @@ function docsUrl(c) {
159
159
  const slug = c.name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
160
160
  return `${DOCS_BASE}/components/${slug}`;
161
161
  }
162
+ // RazorParameterScanner decodes XML doc entities ONCE at the source (<Button> ->
163
+ // <Button>), so a description can legitimately carry literal "<" / ">" characters. Blazor's
164
+ // plain `@p.Description` interpolation renders those safely as a DOM text node — but these
165
+ // markdown builders emit the SAME strings into `text/markdown` MCP resources, where a real
166
+ // Markdown renderer may parse "<form>" as raw HTML and hide or corrupt the surrounding table
167
+ // (Codex P2, PR #358 round 3). Backslash-escape angle brackets (and the escape character
168
+ // itself) at this markdown boundary — CommonMark honors `\<`/`\>` as literal characters — so
169
+ // free text can never be mistaken for a tag. Structured JSON tool responses are unaffected;
170
+ // those interpolate the raw decoded strings, which is safe for JSON.
171
+ function escapeMd(text) {
172
+ if (!text)
173
+ return "";
174
+ return text.replace(/\\/g, "\\\\").replace(/</g, "\\<").replace(/>/g, "\\>");
175
+ }
162
176
  function paramRow(p) {
163
177
  const def = p.default ?? "—";
164
- const desc = p.description ?? "";
178
+ const desc = escapeMd(p.description);
165
179
  const flags = [];
166
180
  if (p.isEditorRequired)
167
181
  flags.push("required");
@@ -175,10 +189,10 @@ function paramRow(p) {
175
189
  function toComponentMarkdown(c) {
176
190
  const paramRows = c.parameters.map(paramRow).join("\n");
177
191
  const enumRows = c.enums
178
- .map((e) => `- **${e.name}**: ${e.values.join(", ")}${e.description ? ` — ${e.description}` : ""}`)
192
+ .map((e) => `- **${e.name}**: ${e.values.join(", ")}${e.description ? ` — ${escapeMd(e.description)}` : ""}`)
179
193
  .join("\n");
180
194
  const eventRows = c.events
181
- .map((e) => `- **${e.name}** \`${e.type}\`${e.description ? ` — ${e.description}` : ""}`)
195
+ .map((e) => `- **${e.name}** \`${e.type}\`${e.description ? ` — ${escapeMd(e.description)}` : ""}`)
182
196
  .join("\n");
183
197
  const subRows = Object.values(c.subComponents)
184
198
  .map((s) => `- **${s.componentName}** (${s.parameters.length} params)`)
@@ -196,7 +210,7 @@ function toComponentMarkdown(c) {
196
210
  `**Namespace:** \`${c.namespace ?? "Lumeo"}\``,
197
211
  ...(coverage ? [`**Test coverage:** ${coverageSummary(coverage)}`] : []),
198
212
  "",
199
- c.description,
213
+ escapeMd(c.description),
200
214
  "",
201
215
  "## Parameters",
202
216
  "",
@@ -233,7 +247,7 @@ function toCategoryMarkdown(category) {
233
247
  if (inCat.length === 0)
234
248
  return `# ${category}\n\nNo components in this category.`;
235
249
  const rows = inCat
236
- .map((c) => `| [\`${c.name}\`](lumeo://component/${c.name}) | ${c.description} |`)
250
+ .map((c) => `| [\`${c.name}\`](lumeo://component/${c.name}) | ${escapeMd(c.description)} |`)
237
251
  .join("\n");
238
252
  return [
239
253
  `# ${category}`,
@@ -252,16 +266,16 @@ function findService(name) {
252
266
  }
253
267
  function toServiceMarkdown(s) {
254
268
  const propRows = s.properties
255
- .map((p) => `| \`${p.name}\` | \`${p.type}\` | \`${p.default ?? "—"}\` | ${p.summary ?? ""} |`)
269
+ .map((p) => `| \`${p.name}\` | \`${p.type}\` | \`${p.default ?? "—"}\` | ${escapeMd(p.summary)} |`)
256
270
  .join("\n");
257
271
  const methodRows = s.methods
258
- .map((m) => `- \`${m.signature}\` → \`${m.returnType}\`${m.summary ? ` — ${m.summary}` : ""}`)
272
+ .map((m) => `- \`${m.signature}\` → \`${m.returnType}\`${m.summary ? ` — ${escapeMd(m.summary)}` : ""}`)
259
273
  .join("\n");
260
274
  const enumRows = s.enumValues
261
- .map((e) => `- **${e.name}**${e.summary ? ` — ${e.summary}` : ""}`)
275
+ .map((e) => `- **${e.name}**${e.summary ? ` — ${escapeMd(e.summary)}` : ""}`)
262
276
  .join("\n");
263
277
  const eventRows = s.events
264
- .map((e) => `- **${e.name}** \`${e.type}\`${e.summary ? ` — ${e.summary}` : ""}`)
278
+ .map((e) => `- **${e.name}** \`${e.type}\`${e.summary ? ` — ${escapeMd(e.summary)}` : ""}`)
265
279
  .join("\n");
266
280
  const sections = [
267
281
  `# ${s.name}`,
@@ -269,7 +283,7 @@ function toServiceMarkdown(s) {
269
283
  `**Kind:** ${s.kind}`,
270
284
  `**Namespace:** \`${s.namespace ?? "Lumeo"}\``,
271
285
  "",
272
- s.summary ?? "_(no summary)_",
286
+ s.summary ? escapeMd(s.summary) : "_(no summary)_",
273
287
  "",
274
288
  ];
275
289
  if (s.enumValues.length)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumeo-ui/mcp-server",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "Model Context Protocol server for the Lumeo Blazor component library. Lets LLMs (Claude, Copilot, Cursor) author correct Lumeo markup.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",