MCP server

The Haki MCP server: memory for Cursor, Claude, and any MCP client

Haki's MCP server gives any MCP-compatible client — Cursor, Claude Desktop, or your own agent — long-term memory that runs on your own PostgreSQL: self-hosted, Apache 2.0, no account required, with every remembered fact dated, versioned, and traceable to its source. It speaks Streamable HTTP and ships inside the main Haki API — nothing extra to deploy.

Last updated: August 2026.

What it does that a memory directory doesn't

Most MCP memory servers store notes and search them. Haki manages the lifecycle of what your agent knows: when a decision changes, the old fact is marked superseded and never served as current again (but never silently deleted); when two facts genuinely conflict, both come back flagged with their dates instead of one winning at random; and every recall carries a trace ID you can inspect — which memories were included, which were excluded, and why. For a coding agent, that's the difference between "we use pnpm" and "we use pnpm — since March 14, replacing the yarn decision, per this captured conversation."

Install

Cursor — one click. Run:

uv run haki mcp

It prints an "Add Haki to Cursor" deeplink (plus the raw mcp.json if you prefer manual), and a ready-made Project Rule — .cursor/rules/haki.mdc — that tells the agent when to memorize and when to recall. Click, done.

Claude Desktop / any MCP client — point at the endpoint:

{
  "mcpServers": {
    "haki": {
      "url": "http://localhost:8100/mcp",
      "headers": { "Authorization": "Bearer hk_..." }
    }
  }
}

Backend not running yet? Two commands, ~10 minutes, no account: docker compose up -d then uv run haki verify — full walkthrough in the self-hosted guide. Or use the hosted API (1,000 credits/month free, no card) and swap the URL.

The four tools

ToolWhat the agent uses it for
haki_contextrecall the relevant project memory before starting work
haki_capturememorize a decision, a convention, a resolved bug
haki_inspectshow why a memory was used — the full trace
haki_forgetremove something, with cascade and a receipt

In Cursor, the practical effect: decisions, conventions and resolved errors survive between sessions. Your agent stops re-asking which package manager you use, and stops confidently applying the architecture you abandoned in April.

An honest limitation

MCP servers only see the tool calls the client decides to make — no MCP memory server can intercept entire conversations, whatever its marketing says. The Project Rule instructs the agent on when to capture, and coverage is something we measure rather than promise. For full-conversation capture, the OpenAI-compatible gateway sits in the request path instead — same memory, different integration point.

Under the hood, in one paragraph

Facts live in Postgres 16 + pgvector as versioned rows with explicit status (active / superseded / contested), bitemporal dates (when it happened vs. when it was recorded), and a link to the source event that justifies them. Embeddings are computed locally (ONNX, multilingual) — no network call in the retrieval path; retrieval p95 measured at 42.5 ms on 10,000 facts. Isolation is PostgreSQL row-level security, deletion cascades with a timestamped receipt, and writes are idempotent so a retry never duplicates a memory.

Links: GitHub · self-hosted setup · docs