OTO
reference · oto serve --help at v0.6.1

oto serve

run the query server over stdio (JSON-RPC 2.0), or over HTTP

oto serve [-h] [--project PROJECT] [--backend {sqlite,neo4j}] [--http [HOST:]PORT]
                 [--cors ORIGIN] [--preview] [--watch] [--view VIEW]

Options

OptionWhat it does
--project PROJECTproject root (default: current directory)
--backend {sqlite,neo4j}serve from the local SQLite build or the configured Neo4j (default: the project's `serve.backend`, else sqlite)
--http [HOST:]PORTserve over HTTP instead of stdio: POST /rpc, GET /api/graph and the tool routes. Binds to 127.0.0.1 unless a host is given; any other host requires OTO_SERVE_TOKEN in the environment, and every call must then carry it as a bearer token
--cors ORIGINwith --http: allow a browser app served from ORIGIN to call this server (repeatable; `*` for any). Off by default
--previewserve the preview store (build/preview/: the live graph plus the candidate and every proposal), built first if absent; the live store is untouched
--watchserve the preview and rebuild it whenever graph.json, the candidate, a proposal, the vocabulary, the rules or the lexicon change (implies --preview)
--view VIEWwith --http: the view to serve at /, by name or directory (default: the built-in explorer; `reader` is the other built-in); its data files are generated from the graph

Where to use it

An MCP client, such as Claude Code, needs the query tools.

oto serve --project claims

fourteen kg_* tools over JSON-RPC 2.0 on stdio

People need the explorer; a browser app needs the graph.

oto serve --project claims --http 8765

the explorer at /, POST /rpc, GET /api/graph

Authoring, with the preview rebuilt on every change.

oto serve --project claims --http 8765 --watch

serves the preview store and rebuilds it when the graph, a proposal, the vocabulary or the rules change

Your own web app instead of the explorer.

oto serve --project claims --http 8765 --view ./views/claims-desk

its data files generated from the graph as its app.json says

Beyond this machine.

OTO_SERVE_TOKEN=... oto serve --project claims --http 0.0.0.0:8765 --cors https://app.example

every call must carry the token as a bearer; a browser opens /?oto_token=... once

As the terminal prints it
usage: oto serve [-h] [--project PROJECT] [--backend {sqlite,neo4j}] [--http [HOST:]PORT]
                 [--cors ORIGIN] [--preview] [--watch] [--view VIEW]

options:
  -h, --help            show this help message and exit
  --project PROJECT     project root (default: current directory)
  --backend {sqlite,neo4j}
                        serve from the local SQLite build or the configured Neo4j (default: the
                        project's `serve.backend`, else sqlite)
  --http [HOST:]PORT    serve over HTTP instead of stdio: POST /rpc, GET /api/graph and the tool
                        routes. Binds to 127.0.0.1 unless a host is given; any other host requires
                        OTO_SERVE_TOKEN in the environment, and every call must then carry it as a
                        bearer token
  --cors ORIGIN         with --http: allow a browser app served from ORIGIN to call this server
                        (repeatable; `*` for any). Off by default
  --preview             serve the preview store (build/preview/: the live graph plus the candidate
                        and every proposal), built first if absent; the live store is untouched
  --watch               serve the preview and rebuild it whenever graph.json, the candidate, a
                        proposal, the vocabulary, the rules or the lexicon change (implies
                        --preview)
  --view VIEW           with --http: the view to serve at /, by name or directory (default: the
                        built-in explorer; `reader` is the other built-in); its data files are
                        generated from the graph