For a typical remember call:
POST /mcp with bearer header and JSON-RPC
envelope.
MCPServer.service(), which delegates
to Kiss’s MCPServerBase.
authenticate() reads the Authorization header (or
the ?token= query-string fallback) and runs a constant-time
compare against Config.OWNSONA_API_TOKEN. Failure: 401 with
WWW-Authenticate: Bearer.
doRemember, doRecall, etc.
SecretScanner for write paths, normalizes tags, and calls
MemoryService.
MemoryService opens a fresh Connection from
MainServlet.openNewConnection(), optionally invokes the
EmbeddingProvider (one HTTP call out to OpenAI or whatever’s
configured), and runs the SQL via MemoryRepository. The
connection is closed with closeConnection(db, success), which
commits on success=true and rolls back on false.
Recall is structurally similar but read-only: one embedding call for the query text, one vector-similarity SELECT, no transaction commit.