mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 13:02:50 -05:00
Document direct control protocol authentication
(cherry picked from commit 9e84a049f7)
This commit is contained in:
1 parent
819df31426
commit
2a289b32e8
2 files changed
+19
-5
No files matched your search
@@ -6,7 +6,20 @@
|
||||
from 1 to 65535 (`--control=<port>` works too), given once; otherwise the app prints an error and exits
|
||||
before it starts. Each connection must authenticate with the app's control token before it can send
|
||||
commands. The [MCP setup guide](mcp.md#connect-to-the-desktop-app) shows how to give the app and the CLI
|
||||
the same token file. After authentication, send one JSON request per line:
|
||||
the same token file.
|
||||
|
||||
The CLI handles authentication. A direct loopback client can send this JSON line first, with the
|
||||
app's 64-digit hexadecimal control token in `params.token`:
|
||||
|
||||
```json
|
||||
{"id":"auth","method":"auth","params":{"token":"<control token>"}}
|
||||
```
|
||||
|
||||
With the correct token, the app replies `{"id":"auth","ok":true,"result":{"authenticated":true}}`.
|
||||
With an incorrect token, it replies `{"id":"auth","ok":false,"error":"authentication required"}`
|
||||
and closes the connection. Authenticate once on each new connection.
|
||||
|
||||
After authentication, send one JSON request per line:
|
||||
`{"id": 1, "method": "ui.inspect", "params": {}}` → `{"id": 1, "ok": true, "result": {...}}` or `{"id":1,"ok":false,"error":"..."}`.
|
||||
|
||||
Set `VECTORCRAFT_CONFIG_DIR` to a dedicated directory for an isolated native test profile. Preferences,
|
||||
@@ -34,7 +47,7 @@ and returns its slot
|
||||
that stalls gets the usual error line first);
|
||||
persistent clients can send further requests within these bounds, or reconnect after idle expiration.
|
||||
These transport budgets are separate from the existing 60-second command-processing wait.
|
||||
Transport: `apps/vectorcraft/src/control_server.rs`.
|
||||
Transport: the `craft-automation` server in Craft Libs.
|
||||
|
||||
## Synthetic input budgets
|
||||
|
||||
|
||||
+4
-3
@@ -84,9 +84,10 @@ claude mcp add vectorcraft -- vectorcraft-cli mcp
|
||||
|
||||
### Connect to the desktop app
|
||||
|
||||
The app and the MCP server need the same control token. Choose an absolute path to a token file in an
|
||||
existing private directory. Start the app with that path before starting the MCP server. VectorCraft
|
||||
creates the token file if it is missing and reuses a valid token already in the file.
|
||||
The app and the MCP server need the same control token. Choose an absolute path for a private token
|
||||
file and start the app with that path before starting the MCP server. Let VectorCraft create the file
|
||||
for a new setup. If the file already exists, the app requires a valid token and rejects files that
|
||||
grant access to other users.
|
||||
|
||||
```sh
|
||||
# Linux (deb, rpm). Use your private token-file path.
|
||||
|
||||
Reference in new issue
Block a user