kimi-code-memory-mcp-server 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.en.md +349 -0
  3. package/README.md +223 -137
  4. package/assets/contextFlow.svg +144 -0
  5. package/dist/config.d.ts +13 -0
  6. package/dist/config.js +13 -0
  7. package/dist/config.js.map +1 -1
  8. package/dist/context/wire-context.d.ts +3 -0
  9. package/dist/context/wire-context.js +20 -50
  10. package/dist/context/wire-context.js.map +1 -1
  11. package/dist/dao/constants.d.ts +33 -0
  12. package/dist/dao/constants.js +17 -0
  13. package/dist/dao/constants.js.map +1 -0
  14. package/dist/dao/index-catalog.d.ts +19 -0
  15. package/dist/dao/index-catalog.js +94 -0
  16. package/dist/dao/index-catalog.js.map +1 -0
  17. package/dist/dao/index-reconciler.d.ts +13 -0
  18. package/dist/dao/index-reconciler.js +162 -0
  19. package/dist/dao/index-reconciler.js.map +1 -0
  20. package/dist/dao/index-store.d.ts +31 -0
  21. package/dist/dao/index-store.js +128 -0
  22. package/dist/dao/index-store.js.map +1 -0
  23. package/dist/dao/index.d.ts +12 -31
  24. package/dist/dao/index.js +50 -404
  25. package/dist/dao/index.js.map +1 -1
  26. package/dist/dao/memory-store.js +2 -10
  27. package/dist/dao/memory-store.js.map +1 -1
  28. package/dist/dao/memory-tree-renderer.d.ts +22 -0
  29. package/dist/dao/memory-tree-renderer.js +75 -0
  30. package/dist/dao/memory-tree-renderer.js.map +1 -0
  31. package/dist/prompts/index.d.ts +26 -0
  32. package/dist/prompts/index.js +103 -0
  33. package/dist/prompts/index.js.map +1 -0
  34. package/dist/refine/adapter.d.ts +6 -0
  35. package/dist/refine/adapter.js +28 -0
  36. package/dist/refine/adapter.js.map +1 -0
  37. package/dist/refine/constants.d.ts +35 -0
  38. package/dist/refine/constants.js +107 -0
  39. package/dist/refine/constants.js.map +1 -0
  40. package/dist/refine/extractor.d.ts +12 -0
  41. package/dist/refine/extractor.js +122 -0
  42. package/dist/refine/extractor.js.map +1 -0
  43. package/dist/refine/store.d.ts +23 -0
  44. package/dist/refine/store.js +153 -0
  45. package/dist/refine/store.js.map +1 -0
  46. package/dist/refine/types.d.ts +56 -0
  47. package/dist/refine/types.js +5 -0
  48. package/dist/refine/types.js.map +1 -0
  49. package/dist/refined-manager.d.ts +14 -56
  50. package/dist/refined-manager.js +27 -341
  51. package/dist/refined-manager.js.map +1 -1
  52. package/dist/resources/index.d.ts +15 -0
  53. package/dist/resources/index.js +134 -0
  54. package/dist/resources/index.js.map +1 -0
  55. package/dist/server.js +46 -2
  56. package/dist/server.js.map +1 -1
  57. package/dist/theme-manager.d.ts +1 -0
  58. package/dist/theme-manager.js +7 -0
  59. package/dist/theme-manager.js.map +1 -1
  60. package/dist/tools/context-tools.d.ts +16 -51
  61. package/dist/tools/context-tools.js +303 -55
  62. package/dist/tools/context-tools.js.map +1 -1
  63. package/dist/tools/index.d.ts +5 -827
  64. package/dist/tools/index.js +23 -354
  65. package/dist/tools/index.js.map +1 -1
  66. package/dist/tools/memory-tools.d.ts +4 -60
  67. package/dist/tools/memory-tools.js +129 -79
  68. package/dist/tools/memory-tools.js.map +1 -1
  69. package/dist/tools/system-tools.d.ts +3 -34
  70. package/dist/tools/system-tools.js +110 -33
  71. package/dist/tools/system-tools.js.map +1 -1
  72. package/dist/tools/theme-tools.d.ts +3 -31
  73. package/dist/tools/theme-tools.js +101 -22
  74. package/dist/tools/theme-tools.js.map +1 -1
  75. package/dist/tools/types.d.ts +21 -0
  76. package/dist/tools/types.js +13 -0
  77. package/dist/tools/types.js.map +1 -0
  78. package/dist/types.d.ts +11 -2
  79. package/dist/utils/action-entities.d.ts +16 -0
  80. package/dist/utils/action-entities.js +35 -0
  81. package/dist/utils/action-entities.js.map +1 -0
  82. package/dist/utils/date.d.ts +11 -0
  83. package/dist/utils/date.js +13 -0
  84. package/dist/utils/date.js.map +1 -0
  85. package/dist/utils/file-helpers.d.ts +10 -0
  86. package/dist/utils/file-helpers.js +28 -0
  87. package/dist/utils/file-helpers.js.map +1 -0
  88. package/dist/utils/headings.d.ts +5 -0
  89. package/dist/utils/headings.js +21 -0
  90. package/dist/utils/headings.js.map +1 -0
  91. package/dist/utils/search.d.ts +17 -0
  92. package/dist/utils/search.js +60 -0
  93. package/dist/utils/search.js.map +1 -0
  94. package/dist/utils/tools.d.ts +5 -0
  95. package/dist/utils/tools.js +10 -0
  96. package/dist/utils/tools.js.map +1 -0
  97. package/dist/version.d.ts +1 -1
  98. package/dist/version.js +1 -1
  99. package/dist/vis/api.d.ts +117 -0
  100. package/dist/vis/api.js +426 -0
  101. package/dist/vis/api.js.map +1 -0
  102. package/dist/vis/auto-start.d.ts +12 -0
  103. package/dist/vis/auto-start.js +87 -0
  104. package/dist/vis/auto-start.js.map +1 -0
  105. package/dist/vis/server.d.ts +14 -0
  106. package/dist/vis/server.js +337 -0
  107. package/dist/vis/server.js.map +1 -0
  108. package/dist/vis/static/api.js +57 -0
  109. package/dist/vis/static/app.js +1468 -0
  110. package/dist/vis/static/index.html +25 -0
  111. package/dist/vis/static/state.js +26 -0
  112. package/dist/vis/static/style.css +1553 -0
  113. package/dist/vis/static/utils/helpers.js +94 -0
  114. package/dist/vis/static/utils/markdown.js +81 -0
  115. package/dist/vis-cli.d.ts +7 -0
  116. package/dist/vis-cli.js +140 -0
  117. package/dist/vis-cli.js.map +1 -0
  118. package/docs/0.agent-memory-market-research.md +354 -0
  119. package/docs/1.memory-system-proposal-for-kimi-code.md +688 -0
  120. package/docs/2.memory-architecture-overview.md +417 -0
  121. package/docs/3.memory-skill-prompt-design.md +430 -0
  122. package/docs/4.kimi-code-native-evolution-roadmap.md +559 -0
  123. package/docs/5.decision-guard-design-notes.md +500 -0
  124. package/docs/ARCHITECTURE.md +2 -2
  125. package/docs/design-story.md +350 -0
  126. package/docs/three-layer-memory-model.md +153 -0
  127. package/docs/three-layer-memory-model.zh-CN.md +153 -0
  128. package/package.json +12 -6
  129. package/README.zh-CN.md +0 -292
package/CHANGELOG.md CHANGED
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [0.2.0] - 2026-06-25
11
+
12
+ ### Added
13
+ - MCP tools: `delete_theme` and `delete_search_view` (with optional `deleteRefinedTurns` cascade).
14
+ - Visual dashboard: delete actions for themes and search views, read-only default for Markdown editors, Edit/Delete buttons in composer headers, scrollable Markdown preview, dynamic page title using workspace folder name, lightweight Markdown rendering.
15
+ - Frontend refactor: dashboard `app.js` split into ES modules (`state.js`, `api.js`, `utils/helpers.js`, `utils/markdown.js`).
16
+
17
+ ### Changed
18
+ - Markdown documents in the dashboard now render in read-only mode by default; editing requires clicking the Edit button.
19
+ - Breadcrumbs root label now shows the actual workspace folder name.
20
+
21
+ ## [0.1.2] - 2026-06-25
22
+
23
+ ### Added
24
+ - MCP Prompts support: `memory-decision-check`, `memory-theme-trace`, `memory-session-summary`.
25
+ - MCP Resources support: `memory://<folder>/<key>`, `theme://<theme>`, `essence://essence`.
26
+ - LobeHub badge and green npm version badge in README.
27
+ - README sections documenting prompts and resources.
28
+
29
+ ### Changed
30
+ - Code refactor: split tools/refine/DAO layers, shared utils, and unit tests.
31
+ - `search_context` output-size controls (`compact`/`normal`/`full`, `max_output_chars`).
32
+
8
33
  ## [0.1.0] - 2026-06-24
9
34
 
10
35
  ### Added
@@ -36,6 +61,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
36
61
  - Improved `scripts/session-search-verify.mjs` with CLI/env args, safer parsing, and cleanup.
37
62
  - Updated READMEs to reflect npm-published status and setup command.
38
63
 
39
- [Unreleased]: https://github.com/Zehee/kimi-code-memory-mcp-server/compare/v0.1.1...HEAD
64
+ [Unreleased]: https://github.com/Zehee/kimi-code-memory-mcp-server/compare/v0.2.0...HEAD
65
+ [0.2.0]: https://github.com/Zehee/kimi-code-memory-mcp-server/releases/tag/v0.2.0
66
+ [0.1.2]: https://github.com/Zehee/kimi-code-memory-mcp-server/releases/tag/v0.1.2
40
67
  [0.1.1]: https://github.com/Zehee/kimi-code-memory-mcp-server/releases/tag/v0.1.1
41
68
  [0.1.0]: https://github.com/Zehee/kimi-code-memory-mcp-server/releases/tag/v0.1.0
package/README.en.md ADDED
@@ -0,0 +1,349 @@
1
+ # Kimi Code Memory MCP Server
2
+
3
+ [中文](./README.md)
4
+
5
+ [![CI](https://github.com/Zehee/kimi-code-memory-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/Zehee/kimi-code-memory-mcp-server/actions/workflows/ci.yml)
6
+ [![npm version](https://img.shields.io/npm/v/kimi-code-memory-mcp-server.svg?color=brightgreen)](https://www.npmjs.com/package/kimi-code-memory-mcp-server)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
8
+
9
+ A local stdio MCP server that gives [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code) cross-session memory.
10
+
11
+ > **Note:** This package is published to npm as `kimi-code-memory-mcp-server`. You can install it directly or run it from source.
12
+
13
+ ## Features
14
+
15
+ - **Markdown-first memories** — human-readable, git-friendly, LLM-compatible.
16
+ - **Structured long-term memory** — `memory/decisions/`, `memory/knowledge/`, `memory/rules/`, `memory/reference/`.
17
+ - **Workspace essence** — condensed digest (≤15 KB) generated from `memory/`.
18
+ - **Cross-session context recovery** — parses Kimi Code CLI's `wire.jsonl` directly.
19
+ - **Theme tracing** — associate conversation turns and memories with themes, then trace their evolution.
20
+ - **Refined turn summaries** — reusable turn-level atomic summaries shared across themes.
21
+ - **Rebuilding index** — `index.json` is a cache; `.md` files are the source of truth.
22
+ - **Theme & search-view deletion** — remove low-quality themes or saved search views, optionally purging their refined turns.
23
+ - **Dashboard enhancements** — dynamic workspace title, read-only Markdown viewer with lightweight rendering, delete actions.
24
+
25
+ ## Theme Tracing
26
+
27
+ Traditional context management only focuses on the **vertical** dimension: the closer in time, the clearer; the further away, the more it decays. But this misses a core feature of real work:
28
+
29
+ > **Multiple sessions in the same workspace are often not a single narrative, but several intertwined theme lines running in parallel.**
30
+
31
+ For example:
32
+
33
+ - Session A: developing auth authentication
34
+ - Session B: discussing orders table migration
35
+ - Session C: encryption RSA + decryption BCrypt + CAPTCHA + Cookie
36
+ - Session D: fix SQL error bug
37
+ - Session E: login Login API design
38
+
39
+ If you only look vertically, these sessions appear independent. But if you scan horizontally, you'll find that A, C, and E all belong to the "registration/login" theme.
40
+
41
+ **Theme tracing** is: treat each turn on the timeline as a cylinder, where the height represents the turn's computation/thinking depth, and the color/tag represents the theme. We can even mine from Kimi Code's already compressed and archived context, perform deep horizontal scanning, find cylinders (turns) of the same color, re-establish their associations, form a theme, and store it in memory. Three weeks later, when you're about to upgrade your "registration/login" module or fix a bug, you don't have to re-explain the original design rationale to an agent whose context has been compressed countless times. Instead, your agent can say: "I just traced the 'registration/login' theme. Based on the design decision from three weeks ago and the two adjustments made since then, we should use solution B for the current problem."
42
+
43
+ > The diagram below shows how `kimi-memory` views conversation history: vertical bars are turns on the timeline, thick horizontal lines are clusters, gray boxes are sessions, and colored brackets connect related turns/clusters across sessions into theme lines.
44
+
45
+ ![Turns, clusters, sessions, and theme tracing over time](./assets/contextFlow.svg)
46
+
47
+ The animated clip below is a real Kimi Code CLI session using `kimi-memory`. The user asks for two cross-session summaries — first the evolution history of the MCP memory server itself, then the evolution history of the E2E testing tools. The agent retrieves related memories and conversation turns, then synthesizes structured answers.
48
+
49
+ ![Kimi Memory MCP Server demo](https://github.com/user-attachments/assets/a8947676-1487-47ed-8e0c-8d15f8662618)
50
+
51
+ Tools: `tag_theme`, `trace_theme`, `list_themes`, `search_context`, `refine_session_turns`, `load_turn_context`.
52
+
53
+ ## Why Markdown?
54
+
55
+ Most agent memory systems default to vector databases. That works for fuzzy retrieval, but it also makes memories opaque, hard to audit, and hard to version-control.
56
+
57
+ This project starts from the opposite assumption:
58
+
59
+ > Memories should be **judged, structured, and owned by the user** before they are stored.
60
+
61
+ Markdown + YAML frontmatter gives you:
62
+
63
+ - Full readability and editability
64
+ - Native git diff support
65
+ - No required external database or cloud service
66
+ - Compatibility with any LLM that can read text
67
+
68
+ See [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md) for the design rationale.
69
+
70
+ ## Install
71
+
72
+ Node.js ≥ 18 is required.
73
+
74
+ ### From npm (recommended)
75
+
76
+ ```bash
77
+ npm install -g kimi-code-memory-mcp-server
78
+ ```
79
+
80
+ ### From source
81
+
82
+ ```bash
83
+ git clone https://github.com/Zehee/kimi-code-memory-mcp-server.git
84
+ cd kimi-code-memory-mcp-server
85
+ npm install
86
+ npm run build
87
+ ```
88
+
89
+ ## Quick Setup (recommended)
90
+
91
+ After installing from npm, run the setup command to configure Kimi Code CLI automatically:
92
+
93
+ ```bash
94
+ npx kimi-memory-setup
95
+ ```
96
+
97
+ This will:
98
+
99
+ 1. Detect your `~/.kimi-code` directory.
100
+ 2. Inject memory protocol rules at the top of `~/.kimi-code/AGENTS.md`.
101
+ 3. Install the `memory-manage` skill to `~/.kimi-code/skills/memory-manage`.
102
+ 4. Add the `kimi-memory` MCP server entry to `~/.kimi-code/mcp.json`.
103
+
104
+ Preview changes without writing anything:
105
+
106
+ ```bash
107
+ npx kimi-memory-setup --dry-run
108
+ ```
109
+
110
+ Remove the injected configuration later:
111
+
112
+ ```bash
113
+ npx kimi-memory-setup --undo
114
+ ```
115
+
116
+ ## Configure Kimi Code CLI (manual)
117
+
118
+ If you prefer to configure manually, edit `~/.kimi-code/mcp.json` and add the server.
119
+
120
+ If you installed from npm with `-g`, use the absolute path to `dist/server.js` inside your global `node_modules`:
121
+
122
+ ```json
123
+ {
124
+ "mcpServers": {
125
+ "kimi-memory": {
126
+ "command": "node",
127
+ "args": ["/absolute/path/to/global/node_modules/kimi-code-memory-mcp-server/dist/server.js"],
128
+ "enabled": true
129
+ }
130
+ }
131
+ }
132
+ ```
133
+
134
+ Or run it directly via `npx` (no install required):
135
+
136
+ ```json
137
+ {
138
+ "mcpServers": {
139
+ "kimi-memory": {
140
+ "command": "npx",
141
+ "args": ["-y", "kimi-code-memory-mcp-server"],
142
+ "enabled": true
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ If you built from source, point to your local `dist/server.js`:
149
+
150
+ ```json
151
+ {
152
+ "mcpServers": {
153
+ "kimi-memory": {
154
+ "command": "node",
155
+ "args": ["/absolute/path/to/kimi-code-memory-mcp-server/dist/server.js"],
156
+ "enabled": true
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
162
+ The server name **`kimi-memory`** is important because the bundled `AGENTS.md` rules call tools as `mcp__kimi-memory__*` (for example `mcp__kimi-memory__bootstrap_workspace`).
163
+
164
+ Restart Kimi Code CLI to load the server.
165
+
166
+ ## Optional: Install User-Level AGENTS.md Startup Hook
167
+
168
+ For automatic memory recovery and behavioral rules on every session start, copy the bundled `AGENTS.md` to your Kimi Code user directory:
169
+
170
+ ```bash
171
+ cp AGENTS.md ~/.kimi-code/AGENTS.md
172
+ ```
173
+
174
+ This installs a startup hook that tells Kimi Code CLI to call `bootstrap_workspace` at the beginning of every session, and to follow the memory classification and decision-guard rules. Because `AGENTS.md` is injected into **every** session, it is the right place for memory-related behavior protocols.
175
+
176
+ > **Note:** Keep `AGENTS.md` focused on memory-related conventions only. Do not include tool preferences that belong to other MCP servers.
177
+ >
178
+ > **Prerequisite:** The MCP server must be registered under the name `kimi-memory` in `~/.kimi-code/mcp.json`, otherwise the `mcp__kimi-memory__*` calls in `AGENTS.md` will fail.
179
+
180
+ ## Optional: Install the Memory Skill
181
+
182
+ This repository also includes a lightweight Skill (`skills/memory-manage/SKILL.md`) that reminds Kimi Code CLI to call the memory tools when the user expresses a memory-related intent.
183
+
184
+ ```bash
185
+ cp -r skills/memory-manage ~/.kimi-code/skills/memory-manage
186
+ ```
187
+
188
+ The Skill does **not** enforce behavior on its own; it is a dispatcher. The actual protocols (when to remember, decision guard, etc.) live in `AGENTS.md`.
189
+
190
+ ## Quick Start
191
+
192
+ After the server is loaded, the agent can call memory tools naturally (tool names are prefixed with the MCP server name you configured, e.g. `mcp__kimi-memory__*`):
193
+
194
+ ```text
195
+ User: Let's use SQLite for the cache layer.
196
+ Agent: [calls mcp__kimi-memory__remember] key=use-sqlite-cache, folder=memory/decisions
197
+
198
+ User: Why did we choose SQLite?
199
+ Agent: [calls mcp__kimi-memory__search] query=SQLite cache decision
200
+ [calls mcp__kimi-memory__recall] key=use-sqlite-cache, folder=memory/decisions
201
+ → "We chose SQLite over Redis because..."
202
+
203
+ User: How has the cache design evolved?
204
+ Agent: [calls mcp__kimi-memory__tag_theme] theme=cache-design
205
+ [calls mcp__kimi-memory__trace_theme] theme=cache-design
206
+ → shows related turns and decisions across sessions
207
+ ```
208
+
209
+ ## Storage Layout
210
+
211
+ The server stores data under `~/.kimi-code-memory/<workspace-id>/`:
212
+
213
+ ```text
214
+ ~/.kimi-code-memory/workspace-a1b2c3d4/
215
+ ├── index.json # v3-kv metadata cache (rebuildable)
216
+ ├── memory/
217
+ │ ├── decisions/ # architecture and product decisions
218
+ │ ├── knowledge/ # project-specific knowledge
219
+ │ ├── rules/ # conventions and guardrails
220
+ │ └── reference/ # external references
221
+ ├── essence/
222
+ │ └── essence.md # workspace digest (≤15 KB)
223
+ ├── notes/ # scratch notes
224
+ ├── themes/
225
+ │ └── my-theme.json # theme -> turn/memory refs
226
+ └── refined/
227
+ └── refined.sqlite # turn-level summaries
228
+ ```
229
+
230
+ You can override the storage root with the `MEMORY_STORE_ROOT` environment variable.
231
+
232
+ ### Environment Variables
233
+
234
+ | Variable | Purpose |
235
+ |----------|---------|
236
+ | `MEMORY_STORE_ROOT` | Override the default `~/.kimi-code-memory` storage root. |
237
+ | `MEMORY_SESSIONS_ROOT` | Override the default `~/.kimi-code/sessions` path used to discover `wire.jsonl` files. |
238
+ | `KIMI_CODE_HOME` | Alternative to `MEMORY_SESSIONS_ROOT`; sessions are read from `<KIMI_CODE_HOME>/sessions`. |
239
+
240
+ ## Tools
241
+
242
+ | Tool | Purpose |
243
+ |------|---------|
244
+ | `remember` | Write a Markdown memory |
245
+ | `recall` | Read a memory by key |
246
+ | `search` | Keyword search across memories |
247
+ | `list` | List memories, with optional folder / tag filter and limit |
248
+ | `list_tags` | List all tags |
249
+ | `delete` | Delete a memory |
250
+ | `move` | Move or rename a memory |
251
+ | `organize_memories` | Distill `memory/` into `essence/essence.md` |
252
+ | `sync_workspace_index` | Rebuild `index.json` from disk |
253
+ | `bootstrap_workspace` | Load context, essence, and memory tree |
254
+ | `load_workspace_context` | Load recent conversation context |
255
+ | `load_more_context` | Load older conversation rounds |
256
+ | `search_context` | Search across all session wires |
257
+ | `load_turn_context` | Load specific turn details |
258
+ | `tag_theme` | Associate a turn or memory with a theme |
259
+ | `trace_theme` | Trace a theme's evolution |
260
+ | `list_themes` | List themes |
261
+ | `delete_theme` | Delete a theme association file |
262
+ | `list_search_views` | List saved search views |
263
+ | `delete_search_view` | Delete a saved search view (optionally purge referenced refined turns) |
264
+ | `open_memory_dashboard` | Open the memory dashboard in the browser |
265
+ | `refine_session_turns` | Generate refined turn summaries |
266
+
267
+ ## Dashboard
268
+
269
+ A standalone web dashboard is available to visualize workspace memory, theme timelines, and recent decisions:
270
+
271
+ ```bash
272
+ npx kimi-memory-vis
273
+ ```
274
+
275
+ It starts on `http://127.0.0.1:58628` and opens the browser automatically.
276
+
277
+ The dashboard now renders Markdown documents in read-only mode by default; click **Edit** to modify. Other improvements include a scrollable Markdown preview, dynamic page title using the workspace folder name, and delete actions for themes and search views.
278
+
279
+ To auto-start the dashboard when the MCP server starts:
280
+
281
+ ```bash
282
+ export KIMI_MEMORY_AUTO_VIS=1
283
+ ```
284
+
285
+ Or ask the Agent to open it:
286
+
287
+ ```json
288
+ { "name": "open_memory_dashboard" }
289
+ ```
290
+
291
+ ## Development
292
+
293
+ ```bash
294
+ git clone https://github.com/Zehee/kimi-code-memory-mcp-server.git
295
+ cd kimi-code-memory-mcp-server
296
+ npm install
297
+ npm run build
298
+ npm test
299
+ npm run lint
300
+ ```
301
+
302
+ See [`docs/CONTRIBUTING.md`](./docs/CONTRIBUTING.md) for contribution guidelines.
303
+
304
+ ## Project Structure
305
+
306
+ ```text
307
+ src/
308
+ ├── server.ts # MCP server entry
309
+ ├── config.ts # defaults and paths
310
+ ├── theme-manager.ts # theme storage
311
+ ├── refined-manager.ts # refined turn storage
312
+ ├── dao/
313
+ │ ├── index.ts # index.json DAO (v3-kv)
314
+ │ └── memory-store.ts # Markdown file operations
315
+ ├── context/
316
+ │ └── wire-context.ts # wire.jsonl parsing
317
+ ├── tools/
318
+ │ ├── index.ts # tool schemas & dispatch
319
+ │ ├── memory-tools.ts # memory CRUD
320
+ │ ├── context-tools.ts # context recovery
321
+ │ ├── theme-tools.ts # theme tracing
322
+ │ └── system-tools.ts # organize/sync/bootstrap
323
+ └── utils/
324
+ ├── frontmatter.ts
325
+ ├── paths.ts
326
+ └── validation.ts
327
+ ```
328
+
329
+ ## Roadmap
330
+
331
+ - [x] Modular source structure
332
+ - [x] ESLint + Prettier
333
+ - [x] Basic integration tests
334
+ - [x] Core test coverage for context/theme tools
335
+ - [ ] Optional local embedding search
336
+ - [ ] Optional LLM-based turn refinement
337
+ - [ ] Pluggable wire format adapters
338
+ - [ ] Memory usage benchmarks
339
+
340
+ ## Related Documents
341
+
342
+ - [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md) — system design and data flow
343
+ - [`docs/three-layer-memory-model.md`](./docs/three-layer-memory-model.md) — the theoretical memory model behind this server
344
+ - [`docs/search-logic.md`](./docs/search-logic.md) — how `search` and `search_context` work
345
+ - [`docs/CONTRIBUTING.md`](./docs/CONTRIBUTING.md) — how to contribute
346
+
347
+ ## License
348
+
349
+ MIT