Skip to main content

Module http

Module http 

Source
Expand description

HTTP/JSON transport for Solo. Local-only by default — binds to 127.0.0.1:<port> and serves the same four operations the MCP server exposes:

  • POST /memory — remember (body: { content, source_type?, source_id? })
  • POST /memory/search — recall (body: { query, limit? })
  • GET /memory/{id} — inspect
  • DELETE /memory/{id}?reason=… — forget

There’s no auth at this layer. The threat model is local-machine single-user; binding to 127.0.0.1 keeps the surface off the LAN. A future commit can add bearer-token auth + LAN binding.

§Lifecycle

serve_http(addr, server, shutdown) binds to addr, runs axum with with_graceful_shutdown(shutdown), returns when shutdown fires or the listener errors. solo http-serve invokes this from inside a OneShotContext, so writer + reader pool + lockfile stay live for the server’s lifetime and clean up properly afterwards.

Structs§

ApiError
SoloHttpState

Functions§

openapi_spec
Build the OpenAPI 3.1 spec describing Solo’s HTTP transport. Public so the smoke test + future client-codegen tooling can produce the same document without spinning up the server.
router
Convenience wrapper: no auth (loopback-only deployments).
router_with_auth
Build the router with optional bearer-token auth.
serve_http
Bind + serve. shutdown is awaited inside axum’s with_graceful_shutdown; resolving it triggers a clean drain. bearer_token = None runs unauthenticated (loopback default); Some(t) requires Authorization: Bearer t on every request except GET /health.