@drawpro/mcp 0.6.3 → 0.6.5
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 +10 -0
- package/dist/server.js +20 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -211,3 +211,13 @@ DRAWPRO_TOKEN=dp_live_... npx tsx packages/mcp/tests/smoke.ts
|
|
|
211
211
|
Spawns the server as a subprocess and speaks MCP to it, because compiling proves
|
|
212
212
|
nothing about protocol behaviour. Read-only: it never creates or modifies a
|
|
213
213
|
sheet.
|
|
214
|
+
|
|
215
|
+
## Troubleshooting
|
|
216
|
+
|
|
217
|
+
`CONNECTION_CLOSED` means the process exited on spawn. `npm cache clean --force`
|
|
218
|
+
then reconnect; if it persists, pin the version in the registration. Run
|
|
219
|
+
`printf '' | npx -y @drawpro/mcp; echo $?` by hand to see the real error, since
|
|
220
|
+
the client reports only that the connection closed.
|
|
221
|
+
|
|
222
|
+
Full guide:
|
|
223
|
+
[docs/connect-claude-code.md](https://github.com/deBilla/drawpro/blob/main/docs/connect-claude-code.md#troubleshooting)
|
package/dist/server.js
CHANGED
|
@@ -1411,7 +1411,7 @@ function api() {
|
|
|
1411
1411
|
return clientInstance;
|
|
1412
1412
|
}
|
|
1413
1413
|
var SESSION_ID = Math.random().toString(36).slice(2, 10);
|
|
1414
|
-
var VERSION = "0.6.
|
|
1414
|
+
var VERSION = "0.6.5";
|
|
1415
1415
|
var inFlight = [];
|
|
1416
1416
|
var cachedUser = null;
|
|
1417
1417
|
async function currentUser() {
|
|
@@ -1750,7 +1750,7 @@ tool(
|
|
|
1750
1750
|
el.text = edit.replace;
|
|
1751
1751
|
el.originalText = edit.replace;
|
|
1752
1752
|
const fontSize = el.fontSize ?? 20;
|
|
1753
|
-
const wrapWidth =
|
|
1753
|
+
const wrapWidth = Math.max(el.width || 0, 80);
|
|
1754
1754
|
const metrics = measureText(edit.replace, fontSize, wrapWidth);
|
|
1755
1755
|
el.width = metrics.width;
|
|
1756
1756
|
el.height = metrics.height;
|
|
@@ -2017,14 +2017,18 @@ async function reportOnce() {
|
|
|
2017
2017
|
Could not send (${detail}). Paste the JSON above into an issue instead.`);
|
|
2018
2018
|
}
|
|
2019
2019
|
function maybeSendInBackground() {
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2020
|
+
try {
|
|
2021
|
+
if (!telemetryEnabled()) return;
|
|
2022
|
+
const last = readConfig().lastReportAt;
|
|
2023
|
+
if (last && Date.now() - Date.parse(last) < 24 * 60 * 60 * 1e3) return;
|
|
2024
|
+
const report = buildReport();
|
|
2025
|
+
if (!report) return;
|
|
2026
|
+
void sendReport(report).then(({ ok }) => {
|
|
2027
|
+
if (ok) writeConfig({ lastReportAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
2028
|
+
}).catch(() => {
|
|
2029
|
+
});
|
|
2030
|
+
} catch {
|
|
2031
|
+
}
|
|
2028
2032
|
}
|
|
2029
2033
|
async function auth(arg) {
|
|
2030
2034
|
if (arg === "--forget") {
|
|
@@ -2175,7 +2179,12 @@ async function main() {
|
|
|
2175
2179
|
process.exit(2);
|
|
2176
2180
|
}
|
|
2177
2181
|
maybeSendInBackground();
|
|
2178
|
-
|
|
2182
|
+
try {
|
|
2183
|
+
await server.connect(new import_stdio.StdioServerTransport());
|
|
2184
|
+
} catch (err) {
|
|
2185
|
+
console.error("[drawpro-mcp] failed to start the stdio transport:", err.message);
|
|
2186
|
+
throw err;
|
|
2187
|
+
}
|
|
2179
2188
|
}
|
|
2180
2189
|
main().catch((err) => {
|
|
2181
2190
|
if (err instanceof ConfigError) {
|