@drawpro/mcp 0.4.0 → 0.4.1

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
@@ -123,7 +123,21 @@ coordinates.
123
123
 
124
124
  ## Usage log
125
125
 
126
- Set `DRAWPRO_MCP_LOG` to record every tool call as JSONL:
126
+ Turning telemetry on is enough to start recording:
127
+
128
+ ```bash
129
+ npx -y @drawpro/mcp telemetry # show the state and the exact payload
130
+ npx -y @drawpro/mcp telemetry on # records to ~/.drawpro/usage.jsonl and shares an aggregate
131
+ npx -y @drawpro/mcp telemetry off
132
+ npx -y @drawpro/mcp report # send once, without turning anything on
133
+ ```
134
+
135
+ Consenting to *send* usage implies consent to *record* it — recording is the
136
+ lesser act — so opting in does not also require configuring a log. The
137
+ implication does not run the other way: setting `DRAWPRO_MCP_LOG` records
138
+ locally and shares nothing.
139
+
140
+ To record without ever sharing, set the path yourself:
127
141
 
128
142
  ```bash
129
143
  claude mcp add drawpro --scope user \
@@ -131,9 +145,14 @@ claude mcp add drawpro --scope user \
131
145
  -e DRAWPRO_MCP_LOG="$HOME/.drawpro/usage.jsonl" \
132
146
  -- npx -y @drawpro/mcp
133
147
 
134
- drawpro-mcp stats # or: npx -y @drawpro/mcp stats
148
+ npx -y @drawpro/mcp stats
135
149
  ```
136
150
 
151
+ > Run these from anywhere except a checkout of this repository. Inside it, npm
152
+ > resolves `@drawpro/mcp` to the workspace copy, whose bin is not linked, and
153
+ > npx fails with `drawpro-mcp: command not found`. Use
154
+ > `node packages/mcp/dist/server.js <command>` there instead.
155
+
137
156
  ```
138
157
  5 calls 2026-08-29 .. 2026-08-29
139
158
 
package/dist/server.js CHANGED
@@ -25,6 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
 
26
26
  // src/server.ts
27
27
  var import_node_fs3 = require("node:fs");
28
+ var import_node_os3 = require("node:os");
28
29
  var import_node_path3 = require("node:path");
29
30
  var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
30
31
  var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
@@ -1406,7 +1407,7 @@ function api() {
1406
1407
  return clientInstance;
1407
1408
  }
1408
1409
  var SESSION_ID = Math.random().toString(36).slice(2, 10);
1409
- var VERSION = "0.4.0";
1410
+ var VERSION = "0.4.1";
1410
1411
  var inFlight = [];
1411
1412
  var cachedUser = null;
1412
1413
  async function currentUser() {
@@ -1432,10 +1433,17 @@ function text(body) {
1432
1433
  function sheetUrl(workspaceId, sheetId) {
1433
1434
  return `${APP_URL}/workspace/${workspaceId}/sheet/${sheetId}`;
1434
1435
  }
1436
+ var DEFAULT_LOG = (0, import_node_path3.join)((0, import_node_os3.homedir)(), ".drawpro", "usage.jsonl");
1437
+ function logPath() {
1438
+ const explicit = process.env.DRAWPRO_MCP_LOG;
1439
+ if (explicit) return explicit;
1440
+ return telemetryEnabled() ? DEFAULT_LOG : void 0;
1441
+ }
1435
1442
  function logCall(entry) {
1436
- const path = process.env.DRAWPRO_MCP_LOG;
1443
+ const path = logPath();
1437
1444
  if (!path) return;
1438
1445
  try {
1446
+ (0, import_node_fs3.mkdirSync)((0, import_node_path3.join)((0, import_node_os3.homedir)(), ".drawpro"), { recursive: true, mode: 448 });
1439
1447
  (0, import_node_fs3.appendFileSync)(path, JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), ...entry }) + "\n");
1440
1448
  } catch {
1441
1449
  }
@@ -1843,9 +1851,11 @@ function summariseLog(file) {
1843
1851
  };
1844
1852
  }
1845
1853
  function stats(path, asJson) {
1846
- const file = path ?? process.env.DRAWPRO_MCP_LOG;
1854
+ const file = path ?? logPath();
1847
1855
  if (!file) {
1848
- console.error("Set DRAWPRO_MCP_LOG, or pass a path: drawpro-mcp stats <file>");
1856
+ console.error(
1857
+ "No usage is being recorded. Either set DRAWPRO_MCP_LOG, turn on telemetry\n(which records to ~/.drawpro/usage.jsonl), or pass a path: drawpro-mcp stats <file>"
1858
+ );
1849
1859
  process.exit(2);
1850
1860
  }
1851
1861
  const summary = summariseLog(file);
@@ -1874,7 +1884,7 @@ function stats(path, asJson) {
1874
1884
  console.log(" Add --json for a machine-readable copy.");
1875
1885
  }
1876
1886
  function buildReport() {
1877
- const file = process.env.DRAWPRO_MCP_LOG;
1887
+ const file = logPath();
1878
1888
  if (!file) return null;
1879
1889
  const summary = summariseLog(file);
1880
1890
  if (!summary) return null;
@@ -1907,8 +1917,11 @@ async function telemetry(action) {
1907
1917
  const report = buildReport();
1908
1918
  if (action === "on") {
1909
1919
  writeConfig({ telemetry: "on" });
1910
- console.log("Telemetry on. Roughly once a day, this is sent:\n");
1911
- console.log(report ? JSON.stringify(report, null, 2) : " (nothing yet \u2014 set DRAWPRO_MCP_LOG to record usage)");
1920
+ console.log(`Telemetry on. Usage is recorded to ${logPath()}`);
1921
+ console.log("Roughly once a day, an aggregate of it is sent:\n");
1922
+ console.log(
1923
+ report ? JSON.stringify(report, null, 2) : " (no calls recorded yet \u2014 the first report goes out once you have used the tools)"
1924
+ );
1912
1925
  console.log("\nTurn it off any time with: drawpro-mcp telemetry off");
1913
1926
  return;
1914
1927
  }
@@ -1916,7 +1929,9 @@ async function telemetry(action) {
1916
1929
  `);
1917
1930
  console.log("If enabled, this is the entire payload \u2014 tool counts and timings,");
1918
1931
  console.log("no account, no token, no workspace or sheet ids, nothing drawn:\n");
1919
- console.log(report ? JSON.stringify(report, null, 2) : " (nothing recorded yet \u2014 set DRAWPRO_MCP_LOG first)");
1932
+ console.log(
1933
+ report ? JSON.stringify(report, null, 2) : ` (no calls recorded yet; recording ${logPath() ? `to ${logPath()}` : "is off"})`
1934
+ );
1920
1935
  console.log("\n drawpro-mcp telemetry on share it");
1921
1936
  console.log(" drawpro-mcp telemetry off stop");
1922
1937
  console.log(" drawpro-mcp report send once now, without turning it on");
@@ -1924,7 +1939,9 @@ async function telemetry(action) {
1924
1939
  async function reportOnce() {
1925
1940
  const report = buildReport();
1926
1941
  if (!report) {
1927
- console.error("Nothing to report. Set DRAWPRO_MCP_LOG to record usage first.");
1942
+ console.error(
1943
+ "Nothing to report \u2014 no usage has been recorded. Set DRAWPRO_MCP_LOG, or\nturn on telemetry, which records to ~/.drawpro/usage.jsonl."
1944
+ );
1928
1945
  process.exit(2);
1929
1946
  }
1930
1947
  console.log("Sending:\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawpro/mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "MCP server for DrawPro \u2014 read and create end-to-end encrypted Excalidraw diagrams from Claude",
5
5
  "license": "MIT",
6
6
  "repository": {