Skip to content

serve

tonic serve --stdio exposes the same target resolution, execution, artifact planning, inspect, and session behavior as the CLI through newline-delimited JSON-RPC 2.0.

Terminal window
tonic serve --stdio

--stdio is currently required.

  • One JSON-RPC message per UTF-8 line.
  • Request-response only; server-initiated notifications are not implemented.
  • Sessions are process-local and close when the server process exits.
  • Open transactions are rolled back best-effort when their session closes.
{"jsonrpc":"2.0","id":1,"method":"server.capabilities","params":{}}

The result includes the service name, binary version, transport, supported backends, and method list.

Current backends reported by the service are postgres, snowflake, sqlite, and mysql.

  • targets.list
  • targets.ping
  • query.executeInline
  • query.planArtifact
  • query.executeArtifact
  • sessions.open
  • sessions.execute
  • sessions.close
  • inspect.catalogs
  • inspect.namespaces
  • inspect.tables
  • inspect.views
  • inspect.columns
  • inspect.viewDefinition
  • inspect.ddl

See Serve JSON-RPC for request and response shapes.