@excaliwow/mcp 0.1.1 → 0.2.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.
Files changed (2) hide show
  1. package/dist/bin.js +12 -3
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -100,7 +100,12 @@ async function request(opts) {
100
100
  if (res.status === 204) return null;
101
101
  if (contentType.includes("image/")) {
102
102
  const buf = new Uint8Array(await res.arrayBuffer());
103
- return { bytes: buf, contentType };
103
+ return {
104
+ bytes: buf,
105
+ contentType,
106
+ quality: res.headers.get("x-render-quality") ?? void 0,
107
+ note: res.headers.get("x-render-note") ?? void 0
108
+ };
104
109
  }
105
110
  const text = await res.text();
106
111
  if (text === "") return null;
@@ -177,7 +182,9 @@ function renderDiagram(ctx, id, opts) {
177
182
  path: `${PREFIX}/diagrams/${encodeURIComponent(id)}/render`,
178
183
  token: ctx.token,
179
184
  baseUrl: ctx.baseUrl,
180
- query: { format: opts.format },
185
+ // `quality` (#220) — omitted ⇒ the server default (faithful). An older
186
+ // server ignores it and serves fast; the response's quality signal tells.
187
+ query: { format: opts.format, quality: opts.quality },
181
188
  accept,
182
189
  fetchImpl: ctx.fetchImpl
183
190
  });
@@ -516,9 +523,11 @@ function createServer(deps) {
516
523
  try {
517
524
  const png = await renderDiagram(ctx, id, { format: "png" });
518
525
  if (png && png.bytes.length > 0) {
526
+ const text = png.quality && png.quality !== "faithful" ? `${summary}
527
+ preview fidelity: ${png.quality} \u2014 faithful renderer unavailable; layout/fonts approximate` : summary;
519
528
  return {
520
529
  content: [
521
- { type: "text", text: summary },
530
+ { type: "text", text },
522
531
  {
523
532
  type: "image",
524
533
  data: Buffer.from(png.bytes).toString("base64"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excaliwow/mcp",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Excaliwow Model Context Protocol (MCP) server — lets AI agents create, read, render, and edit Excaliwow diagrams over the public REST API, via stdio.",
5
5
  "private": false,
6
6
  "publishConfig": {