start_preview
Serve a local folder over HTTP to open exported images in a browser for quick preview. Returns a tokenized 127.0.0.1 URL that lists and serves files.
Instructions
Serve a folder over HTTP on 127.0.0.1 so exported images can be opened in a browser.
Export into the folder, then open the returned URL exactly as given: its first path segment is a secret token, and file URLs are the URL plus the file's path inside the folder (e.g. url + "walk.gif"). The URL itself lists the folder. Only this machine can connect, and only with 127.0.0.1 or localhost as the host name. Only .png, .gif, .webp, .bmp, .tga, .qoi and .json files are served; dotfiles, other files and anything outside the folder are not, and nothing can be uploaded. One preview runs at a time: starting it again for the same folder returns the running URL; for another folder call stop_preview first. The server stops when this program exits.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"directory": "<directory>"
},
"name": "start_preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | 0 picks a free port | |
| directory | Yes | Folder to serve, e.g. where exports go |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||