Durable AI memory: recall distilled facts in a later session or subagent, and remember new ones.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Durable memory that survives the session. An MCP server that plugs Khwan β a pure AI-memory layer β into Claude Code, Claude Desktop, or any MCP client.
Khwan never runs a model. The client is the model. Its job is to persist and distil what matters into a brain you can recall in a later session or seed a subagent with β a compact, bounded set of facts instead of a replayed transcript. One account can hold many isolated cores (brains), and β on paid plans β an isolated sub-brain per end-user.
Be honest about the mechanism β an MCP adds to a host's context, it cannot replace the transcript the host already sends. So:
The token-smart pattern: seed once, remember durable facts (below), rather
than running the full loop on every turn of a caching host. The full
prepare β record loop still shines in a custom agent on a non-caching host,
where replacing history with distilled memory bounds per-turn cost directly.
--scope project writes .mcp.json into the repo, so the setting travels with
the project. Note what is not in that command: the key.
claude mcp add -e KHWAN_API_KEY=β¦ writes the literal value into .mcp.json β
a file whose whole point is being committed. Two ways to avoid that, and the
second is the one that works everywhere:
Shell environment. Leave KHWAN_API_KEY out of the config entirely and
export it in the shell that launches claude. The server inherits it.
A launcher (works in the desktop app too). A desktop app is started from a dock or menu, not a login shell, so it inherits none of your shell exports and the approach above silently yields no key. Read it from a file instead:
Then point the config at the launcher and keep only non-secret settings inline:
.mcp.json is now safe to commit, and every new repo costs two lines instead of
a pasted key. Anyone else on the team writes their own ~/.khwan/env.
Memory is only useful if the right project's memory comes back. Two axes, and both give complete isolation:
| selected by | free | paid | |
|---|---|---|---|
| core | KHWAN_CORE | 1 β default only | 5 (starter) β 25 (pro) |
| sub-brain | KHWAN_USER | 3 | unlimited |
A sub-brain is a full separate brain, not a filter: account::@web shares
nothing with account::@api. So the two axes multiply, and a free account
already holds four isolated brains β the core on its own, plus three
sub-brains:
Which means one-brain-per-project works on the free plan, for up to four
projects β and it needs no KHWAN_CORE at all:
Named cores are the paid axis. Reach for one when four brains stop being enough, or when you want them grouped per client rather than per repository:
Two things to know before you point KHWAN_CORE anywhere. A core must exist
first β an unknown slug answers 404, not "created it for you" β and they are
created in the dashboard. On the free plan there is nothing to point at: the
cap of one is spent on default, so creating a named core answers 402. Leave
KHWAN_CORE unset there and use KHWAN_USER. Sub-brains, by contrast, are
created on first write.
On a caching host like Claude Code, prefer seed + remember over the per-turn loop:
"Call
khwan_recall(query="<the task>")and use the returnedseed_textas context."
"That's a standing decision β call
khwan_remember(fact="β¦")."
Reinforce it in your project's CLAUDE.md, e.g.:
Seeding a subagent is where the win is clearest β hand it a bounded brief instead of the whole transcript:
"Recall deploy memory with
khwan_recall(query="deploy runbook"), then spawn a subagent whose brief is thatseed_textplus the task."
Claude Desktop and Claude Code keep separate MCP configuration β a server
added to one is invisible to the other, and claude mcp add does not touch this
file. Add to claude_desktop_config.json:
Use an absolute path: a desktop app does not get your shell's PATH either, so
a bare khwan-mcp may not resolve. One core is selected for the whole app β
there is no per-project switch here, so choose a broad one.
| Var | Required | Purpose |
|---|---|---|
KHWAN_API_KEY | yes | Your key from the Khwan dashboard (kwk_live_β¦). |
KHWAN_CORE | no | Select a named core. Paid plans only β free has just default. |
KHWAN_USER | no | A separate brain inside the core β 3 on free, unlimited on paid. |
KHWAN_BASE_URL | no | Override the API base β e.g. http://127.0.0.1:8010 for a local engine. |
| Tool | When |
|---|---|
khwan_recall(query, limit=3) | seed a session/subagent β synthesised lessons + up to 3 relevant facts, as seed_text. |
khwan_remember(fact) | persist a durable fact/preference for future sessions. |
khwan_prepare(input) | full loop, before answering β memory context + a turn_token. |
khwan_record(turn_token, answer) | full loop, after answering β persists the turn so Khwan learns. |
khwan_memory(limit=20) | inspect what the brain currently remembers. |
khwan_cores() | list the isolated cores on the account. |
khwan_recall / khwan_remember are the token-smart pair for a caching host;
khwan_prepare / khwan_record are the full loop for custom agents (pass the
exact turn_token from prepare back into record).
khwan_recall returns at most three facts β that ceiling is the server's,
so limit can lower it but not raise it β plus any lessons synthesis has
distilled from many past turns. Lessons lead the seed_text: a rule earned over
months outranks a single turn that happens to sit nearby in the index.
Retrieval applies a relevance floor, so an empty facts is an answer: the
brain has nothing close to this question. Read it as "not known here" rather than
as a failure, and do not fill the gap by leaning on whichever fact was nearest.
The floor is deliberately loose, because a memory wrongly dropped is invisible while a memory wrongly kept is not. Expect a returned fact to be plausibly related, not certainly relevant β read it before relying on it.
A new brain knows nothing, so its first weeks of recall are thin β while the
answers are often already sitting in the host's own transcripts, unread.
examples/backfill/ replays Claude Code transcripts into a
brain: deterministic, no model calls, dry-run by default.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/khwan)<a href="https://allmcps.com/mcp/khwan"><img src="https://allmcps.com/api/badge/khwan?style=directory" alt="Khwan on AllMCPs" /></a>