scanruler-mcp 0.4.0 → 0.4.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 +41 -8
- package/package.json +14 -3
- package/src/commands.json +257 -60
- package/src/config.js +24 -2
- package/src/link.js +1 -1
- package/src/main.js +3 -3
- package/src/mcp.js +413 -63
- package/src/relay.js +10 -0
- package/src/tools.js +75 -35
package/README.md
CHANGED
|
@@ -158,7 +158,10 @@ connects to that one, with the same token, and sends its calls through it.
|
|
|
158
158
|
When the copy holding the port stops, another takes the port over, and the
|
|
159
159
|
tab — which keeps trying — connects to it within ten seconds.
|
|
160
160
|
`scanruler_status` says which this copy is (`server.role`: `holder`,
|
|
161
|
-
`relay
|
|
161
|
+
`relay` — with the holding copy's version as `server.holder.version` —, or
|
|
162
|
+
`none` with `server.error` saying why). The page judges the copy holding
|
|
163
|
+
its connection: when that one is out of date, a relaying copy's status says
|
|
164
|
+
so, and quitting the app that started it lets a current copy take over. Copies with different
|
|
162
165
|
tokens cannot share a port: give them the same `SCANRULER_MCP_TOKEN`, or
|
|
163
166
|
each its own `--port`. Changes from several agents run one after another in
|
|
164
167
|
the tab, each one step of the same undo history.
|
|
@@ -221,8 +224,9 @@ that return a picture — `view_render`, `section_render`, `flat_render` and
|
|
|
221
224
|
lets the model call a tool it was not given can call them directly too.
|
|
222
225
|
- The tools that return a picture are listed so the model calls them
|
|
223
226
|
directly and sees the picture. In a batch a picture is not shown: it is
|
|
224
|
-
written to a file, the call's `path` or a new file in the
|
|
225
|
-
(
|
|
227
|
+
written to a file, the call's `path` or a new file in the open scan's
|
|
228
|
+
folder (the output folder, `--out`, while no scan or project was opened
|
|
229
|
+
from one), and the call's result names it. A tab that connects with
|
|
226
230
|
another picture tool has the client list the tools again.
|
|
227
231
|
|
|
228
232
|
**LM Studio**: add `--tools` and `compact` to the server's arguments as two
|
|
@@ -282,8 +286,9 @@ last tab that connected, which the server keeps in its config folder
|
|
|
282
286
|
(`tools.json`), or, the first time, the app's own; a client that lists the
|
|
283
287
|
tools once, when it starts, sees them all that way, and one that listens is
|
|
284
288
|
told when the list changes. Six more are the server's: `scanruler_status`
|
|
285
|
-
(is a tab connected, which version, how to pair one,
|
|
286
|
-
session holds — its scan, project, unsaved changes and work counted —
|
|
289
|
+
(is a tab connected, which version, how to pair one, what the tab's
|
|
290
|
+
session holds — its scan, project, unsaved changes and work counted — the
|
|
291
|
+
time on this computer with its offset from UTC (`server.now`), and,
|
|
287
292
|
when the client's list is out of date, which tools were added, removed or
|
|
288
293
|
changed since and which page it came from),
|
|
289
294
|
`scanruler_open` (open ScanRuler in the default browser, paired, and wait
|
|
@@ -320,8 +325,34 @@ listed; the rest are read through a seventh of the server's own,
|
|
|
320
325
|
- **Arguments from a file.** `{ "$file": path }` anywhere in a tool's
|
|
321
326
|
arguments — an object of that one key — is replaced by the JSON the file
|
|
322
327
|
holds: a long list of stations a script wrote need not pass through the
|
|
323
|
-
conversation.
|
|
324
|
-
|
|
328
|
+
conversation.
|
|
329
|
+
- **Relative paths** — a batch's `file`, `$file`, a file to open, an
|
|
330
|
+
output's `path` — are taken from the open scan's folder, or from the folder
|
|
331
|
+
the server was started in while no scan is open; `scanruler_status` gives
|
|
332
|
+
both (`server.relativeTo`, `server.cwd`). A picture or file written into a
|
|
333
|
+
folder is numbered past one already there (`-2`, `-3`), never written over.
|
|
334
|
+
- **Long answers.** An answer past what one carries (40 k characters; a
|
|
335
|
+
guide 90 k — several guides asked for together come while they fit about
|
|
336
|
+
80 k, the rest named in `next`) is written whole to a JSON file in the
|
|
337
|
+
open scan's folder, where an agent that may only read there can open it —
|
|
338
|
+
in the output folder (`--out`) while the scan open now was not opened from
|
|
339
|
+
a folder through this server. The answer says
|
|
340
|
+
`truncated: true`, the `file`, its short fields and the person's notes,
|
|
341
|
+
and its `note` says which folder it went to and how to ask for less — by
|
|
342
|
+
the command's own fields, as the command says it (a guide a section at a
|
|
343
|
+
time).
|
|
344
|
+
- **Strings of JSON.** A client that sends a large nested value as a string
|
|
345
|
+
— a batch's `calls`, a call in it, or a call's `arguments` — has it read as
|
|
346
|
+
the JSON it holds; one that is not JSON is refused saying so, with nothing
|
|
347
|
+
run.
|
|
348
|
+
- **A tab that reloaded.** A tab says who it is each time it loads. When a
|
|
349
|
+
tab that held work comes back as another — reloaded by the person, by the
|
|
350
|
+
dev server after an edit, or unloaded by the browser — the next answer
|
|
351
|
+
says so (`pageReloaded`), with the project file last opened or saved here,
|
|
352
|
+
which `scanruler_status` gives too (`lastProject`, kept in
|
|
353
|
+
`folders.json`). A tab older than the app it came from, which could not
|
|
354
|
+
load a part of it, answers `stale_page`, and the status says so from then
|
|
355
|
+
on (`page.stale`): save the project before the tab is reloaded.
|
|
325
356
|
- **Pictures.** `view_render` comes back as an image the agent sees — the
|
|
326
357
|
3D view as the tab shows it, after `view_set` has turned it if asked — and
|
|
327
358
|
is written to a file only when the call gives `path`. `show` puts the
|
|
@@ -356,7 +387,9 @@ listed; the rest are read through a seventh of the server's own,
|
|
|
356
387
|
`retried: "busy"`. `timings:
|
|
357
388
|
true` gives each call its `ms`, the batch its `total_ms`, and a change's
|
|
358
389
|
build the steps it played with their milliseconds (`result.steps.played`;
|
|
359
|
-
otherwise only how many it played and took up from a state held).
|
|
390
|
+
otherwise only how many it played and took up from a state held). The
|
|
391
|
+
notes left for the agent (`notes`), when a call answers with them, are
|
|
392
|
+
repeated at the batch's top as the last call gave them.
|
|
360
393
|
- **Long changes.** Every tool that changes the session takes `wait`, and
|
|
361
394
|
so does a read the tab marks long (a comparison over whole bodies, say);
|
|
362
395
|
`wait: false` answers at once with `{ queued: true, job }` while the call
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scanruler-mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Drive ScanRuler, the 3D-scan measuring tool, from an AI agent: a local MCP server that reaches the ScanRuler tab open in your browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -11,11 +11,22 @@
|
|
|
11
11
|
"url": "git+https://github.com/CNCKitchen/scanruler.git",
|
|
12
12
|
"directory": "mcp"
|
|
13
13
|
},
|
|
14
|
-
"keywords": [
|
|
14
|
+
"keywords": [
|
|
15
|
+
"mcp",
|
|
16
|
+
"model-context-protocol",
|
|
17
|
+
"3d-scan",
|
|
18
|
+
"metrology",
|
|
19
|
+
"scanruler"
|
|
20
|
+
],
|
|
15
21
|
"bin": {
|
|
16
22
|
"scanruler-mcp": "bin/scanruler-mcp.js"
|
|
17
23
|
},
|
|
18
|
-
"files": [
|
|
24
|
+
"files": [
|
|
25
|
+
"bin",
|
|
26
|
+
"src",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
19
30
|
"engines": {
|
|
20
31
|
"node": ">=22"
|
|
21
32
|
},
|