Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

docs: service.json on Linux, which Origin headers the API refuses; CI runs the kokon-mcp help test

Gabriele Lozupone9e6de7c987c0
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 41ddad9..f34255e 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -33,6 +33,6 @@ jobs:
working-directory: mcp
run: npm run typecheck
# The protocol test needs a built kokon-service and MCP bundle; the others need no binaries.
- - name: Test MCP paths, tools and version
+ - name: Test MCP paths, tools, version and help
working-directory: mcp
- run: npm test -- test/paths.test.ts test/tools.test.ts test/version.test.ts
+ run: npm test -- test/paths.test.ts test/tools.test.ts test/version.test.ts test/help.test.ts
diff --git a/README.md b/README.md
index 1467bac..1fd882d 100644
--- a/README.md
+++ b/README.md
@@ -427,8 +427,8 @@ claude mcp add-json --scope user kokon '{"type":"stdio","command":"C:\\Users\\<y
Base URL `http://127.0.0.1:39151/api/v1`. Every call except `/ping` needs
`Authorization: Bearer <token>`, with the token from `%LOCALAPPDATA%\KokonData\service.json`
-(Mac: `~/Library/Application Support/KokonData/service.json`).
-Requests that carry a browser `Origin` header are refused.
+(Mac: `~/Library/Application Support/KokonData/service.json`, Linux: `~/.local/share/KokonData/service.json`).
+Requests from web pages (a browser `Origin` header other than the app's own) are refused.
```powershell
$i = Get-Content "$env:LOCALAPPDATA\KokonData\service.json" | ConvertFrom-Json
@@ -437,7 +437,7 @@ Invoke-RestMethod -Method Post "http://127.0.0.1:$($i.port)/api/v1/generate" -He
-ContentType 'application/json' -Body '{"prompt":"a lighthouse at dusk, 16:9","quality":"fast"}'
```
-On macOS (or any shell with `curl`):
+On macOS or Linux (`curl`; on Linux the file is in `~/.local/share/KokonData/`):
```bash
INFO="$HOME/Library/Application Support/KokonData/service.json"
diff --git a/docs/http-api.md b/docs/http-api.md
index ed784ca..26cf170 100644
--- a/docs/http-api.md
+++ b/docs/http-api.md
@@ -13,10 +13,11 @@ The service writes its port and token to `service.json` when it starts:
| --- | --- |
| Windows | `%LOCALAPPDATA%\KokonData\service.json` |
| Mac | `~/Library/Application Support/KokonData/service.json` |
+| Linux | `~/.local/share/KokonData/service.json` (or `$XDG_DATA_HOME/KokonData`) |
Base URL: `http://127.0.0.1:<port>/api/v1` (the port is usually `39151`). Every call except
-`/ping` needs `Authorization: Bearer <token>`. Requests that carry a browser `Origin` header are
-refused. Errors come back as `{"error": {...}}`.
+`/ping` needs `Authorization: Bearer <token>`. Requests from web pages (a browser `Origin`
+header other than the app's own) are refused. Errors come back as `{"error": {...}}`.
**PowerShell:**
@@ -27,7 +28,7 @@ Invoke-RestMethod -Method Post "http://127.0.0.1:$($i.port)/api/v1/generate" -He
-ContentType 'application/json' -Body '{"prompt":"a lighthouse at dusk, 16:9","quality":"fast"}'
```
-**macOS (curl):**
+**macOS and Linux (curl):** on Linux, set `INFO` to `$HOME/.local/share/KokonData/service.json`.
```bash
INFO="$HOME/Library/Application Support/KokonData/service.json"