Three modes from one binary with no dependencies: --meta for discovery, ?action= for JSON, plain GET for a responsive HTML page — plus --mcp and --daemon for a connector. Copy these files, change three defines, build, install.
Complete single-binary plugin: three modes, node auth guard, dark/light UI, no Content-Length.
native / musl / win64 / macos / test targets for the starter.
Windows build with MinGW-w64 static PE output and a --meta smoke test.
Connector starter on the vendored Connector SDK: HTTPS/TLS client, --mcp tool server, --daemon bridge, default-deny sender gate.
mkdir -p plugin_mine && cd plugin_mine
# save plugin_starter.c, Makefile, build.ps1 here
# (or connector_starter.c + the SDK's build/libsxconn.a)
make # native build
make musl # static musl (universal Linux)
make win64 # MinGW-w64 static PE
make test # --meta + action=info + HTML smoke test
cp plugin_starter ~/.scorpiox/plugins/The route follows the filename: a file named plugin_mine is served at /plugin_mine. Rename the binary and you have renamed the plugin.
| Invocation | Returns | Content-Type |
|---|---|---|
| --meta | {"name":..,"desc":..} | anything JSON |
| ?action=.. / ?format=json | JSON with ok | application/json |
| GET (default) | complete HTML page | text/html |
| --mcp (connector) | stdio MCP JSON-RPC 2.0 | line-delimited JSON |
| --daemon (connector) | long-lived bridge to the node API | — |
The SDK guide explains every mode, the auth guard and the escaping rules; the cross-compile guide gives the exact invocation for all six published targets.