khwan-mcp
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| KHWAN_CORE | No | Select an isolated core (brain). Defaults to the account's default core. The core must already exist. | |
| KHWAN_USER | No | Isolated sub-brain per end-user within a core (paid plans); sets the X-Khwan-User header. | |
| KHWAN_API_KEY | Yes | Your Khwan key from https://app.khwan.ai (kwk_live_...). It authenticates you to Khwan; it is not your model provider's key. | |
| KHWAN_BASE_URL | No | Override the API base URL, e.g. http://127.0.0.1:8010 for a self-hosted engine. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| khwan_prepareA | Pull the memory-enriched context for a turn BEFORE you answer. Khwan builds context from memory + the brain's constitution + a coherence
gate. No model is called. Ground your reply in the returned Args: input: The user's message / the turn you are about to answer. Returns: context: ready-to-use messages (memory + constitution) to ground your reply. coherence: optional float — how coherent this turn is with the brain (may be None). allowed: whether Khwan's coherence gate permits answering. reason: why, when not allowed (else None). turn_token: opaque token — pass it verbatim to khwan_record. |
| khwan_recordA | Hand your answer back to Khwan AFTER you reply, so it persists + learns. Args:
turn_token: the exact token returned by the matching Returns: Khwan's record acknowledgement (persisted state / next-turn hints). |
| khwan_recallA | SEED a session/subagent with a COMPACT, bounded set of relevant memories. The token-smart entry point for a caching host (Claude Code, Claude Desktop): call it ONCE at the start of a session or subagent — or when you need a fact that has scrolled out of context — NOT on every turn. It returns only the relevant facts (not Khwan's full prepared prompt), so you seed a fresh, bounded context instead of replaying a transcript. No model is called. Two limits are worth knowing, because neither is this tool's to set:
Lessons — what synthesis distilled from many turns — come back alongside the raw exchanges and LEAD the seed text: a rule earned over months outranks any single turn that happens to sit nearby in the index. Args: query: the task or topic to recall memory for. Phrase it as the work you are about to do, not as a keyword — it is matched on meaning. limit: cap on facts returned, 1-3. The server's own ceiling is 3, so this can only lower it. Leave it alone unless you want fewer than three. Returns: lessons: rules synthesis distilled from many past turns. facts: [{you_said, khwan_knows}] — the relevant remembered exchanges. count: how many facts were returned. seed_text: a ready-to-drop-in memory block for a subagent's brief ("" if none). |
| khwan_rememberA | Persist a durable fact/preference so FUTURE sessions can recall it. A convenience over the prepare→record loop for the common "just remember this"
case: it stores Reach for this the moment you are corrected. A user rejecting your work, or telling you how they want it done, is the most durable thing a session produces and the easiest to lose — you fix the thing, the session ends, and the next one makes the same mistake. If the user is telling you something for the second time, the first time should have been stored here. Write the standing RULE, not the utterance. "Deploys go to staging first, never straight to production" survives into a session that never saw the conversation; "no, not like that" does not. Args: fact: the durable rule/preference to store, phrased to stand alone. Returns: stored: whether the fact was persisted; reason when not. |
| khwan_memoryA | Inspect what this brain currently remembers, newest first. A DEBUGGING window on the brain, not a way to seed a session. It returns
recent entries in time order and ignores what you are working on, so it
answers "is anything in here / did that write land" — not "what is relevant
to this task". For the latter use Reach for it when a recall came back empty and you want to know whether the
brain is empty or merely has nothing close, when confirming a
Args: limit: max entries to return, newest first (default 20). Returns: The brain's recent memory entries, in the order they were written. |
| khwan_coresA | List the isolated cores (brains) available on this account. Each core is a fully isolated brain — its own memory, identity and learning. HOW A CORE IS SELECTED DEPENDS ON HOW YOU CONNECTED, and the two are not interchangeable:
On a remote connection, do not advise |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 6 tools
The tools split into two semantically overlapping pairs—prepare/recall for retrieval and record/remember for persistence—but the descriptions clearly separate turn-by-turn context from session seeding, and structured recording from standalone fact storage. khwan_memory and khwan_cores are unambiguous. An agent must read carefully, but misselection risk is low.
All tools share the khwan_ prefix and use lowercase snake_case, with most names being imperative verbs: prepare, record, recall, remember. khwan_memory and khwan_cores break the verb pattern by being plain nouns, making the set slightly inconsistent but still readable and predictable.
Six tools is a well-scoped size for a memory/context server: two for the turn loop, one for session seeding, one for direct persistence, one for debugging, and one for core isolation. Each tool has a clear job and none feels redundant.
The core memory lifecycle is covered: prepare/record for turns, remember for durable facts, recall for retrieval, and memory for inspection. However, there is no explicit forget/update or memory-editing tool, which is a notable gap for a persistent brain, though it does not break the main workflows.