memory-journal-mcp 4.4.2 β†’ 5.0.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 (291) hide show
  1. package/.github/workflows/codeql.yml +1 -6
  2. package/.github/workflows/docker-publish.yml +15 -49
  3. package/.github/workflows/lint-and-test.yml +1 -1
  4. package/.github/workflows/secrets-scanning.yml +4 -3
  5. package/.github/workflows/security-update.yml +3 -3
  6. package/CHANGELOG.md +213 -0
  7. package/CONTRIBUTING.md +132 -97
  8. package/DOCKER_README.md +184 -235
  9. package/Dockerfile +27 -24
  10. package/README.md +218 -190
  11. package/SECURITY.md +27 -35
  12. package/dist/cli.js +16 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/constants/ServerInstructions.d.ts +5 -1
  15. package/dist/constants/ServerInstructions.d.ts.map +1 -1
  16. package/dist/constants/ServerInstructions.js +133 -73
  17. package/dist/constants/ServerInstructions.js.map +1 -1
  18. package/dist/constants/icons.d.ts +2 -2
  19. package/dist/constants/icons.d.ts.map +1 -1
  20. package/dist/constants/icons.js +7 -6
  21. package/dist/constants/icons.js.map +1 -1
  22. package/dist/database/SqliteAdapter.d.ts +37 -24
  23. package/dist/database/SqliteAdapter.d.ts.map +1 -1
  24. package/dist/database/SqliteAdapter.js +319 -157
  25. package/dist/database/SqliteAdapter.js.map +1 -1
  26. package/dist/database/schema.d.ts +45 -0
  27. package/dist/database/schema.d.ts.map +1 -0
  28. package/dist/database/schema.js +92 -0
  29. package/dist/database/schema.js.map +1 -0
  30. package/dist/filtering/ToolFilter.d.ts +1 -1
  31. package/dist/filtering/ToolFilter.d.ts.map +1 -1
  32. package/dist/filtering/ToolFilter.js +13 -2
  33. package/dist/filtering/ToolFilter.js.map +1 -1
  34. package/dist/github/GitHubIntegration.d.ts.map +1 -1
  35. package/dist/github/GitHubIntegration.js +1 -3
  36. package/dist/github/GitHubIntegration.js.map +1 -1
  37. package/dist/handlers/prompts/github.d.ts +12 -0
  38. package/dist/handlers/prompts/github.d.ts.map +1 -0
  39. package/dist/handlers/prompts/github.js +178 -0
  40. package/dist/handlers/prompts/github.js.map +1 -0
  41. package/dist/handlers/prompts/index.d.ts +23 -2
  42. package/dist/handlers/prompts/index.d.ts.map +1 -1
  43. package/dist/handlers/prompts/index.js +7 -432
  44. package/dist/handlers/prompts/index.js.map +1 -1
  45. package/dist/handlers/prompts/workflow.d.ts +12 -0
  46. package/dist/handlers/prompts/workflow.d.ts.map +1 -0
  47. package/dist/handlers/prompts/workflow.js +277 -0
  48. package/dist/handlers/prompts/workflow.js.map +1 -0
  49. package/dist/handlers/resources/core.d.ts +11 -0
  50. package/dist/handlers/resources/core.d.ts.map +1 -0
  51. package/dist/handlers/resources/core.js +433 -0
  52. package/dist/handlers/resources/core.js.map +1 -0
  53. package/dist/handlers/resources/github.d.ts +11 -0
  54. package/dist/handlers/resources/github.d.ts.map +1 -0
  55. package/dist/handlers/resources/github.js +314 -0
  56. package/dist/handlers/resources/github.js.map +1 -0
  57. package/dist/handlers/resources/graph.d.ts +11 -0
  58. package/dist/handlers/resources/graph.d.ts.map +1 -0
  59. package/dist/handlers/resources/graph.js +204 -0
  60. package/dist/handlers/resources/graph.js.map +1 -0
  61. package/dist/handlers/resources/index.d.ts +5 -20
  62. package/dist/handlers/resources/index.d.ts.map +1 -1
  63. package/dist/handlers/resources/index.js +16 -1278
  64. package/dist/handlers/resources/index.js.map +1 -1
  65. package/dist/handlers/resources/shared.d.ts +60 -0
  66. package/dist/handlers/resources/shared.d.ts.map +1 -0
  67. package/dist/handlers/resources/shared.js +49 -0
  68. package/dist/handlers/resources/shared.js.map +1 -0
  69. package/dist/handlers/resources/team.d.ts +13 -0
  70. package/dist/handlers/resources/team.d.ts.map +1 -0
  71. package/dist/handlers/resources/team.js +119 -0
  72. package/dist/handlers/resources/team.js.map +1 -0
  73. package/dist/handlers/resources/templates.d.ts +13 -0
  74. package/dist/handlers/resources/templates.d.ts.map +1 -0
  75. package/dist/handlers/resources/templates.js +310 -0
  76. package/dist/handlers/resources/templates.js.map +1 -0
  77. package/dist/handlers/tools/admin.d.ts +8 -0
  78. package/dist/handlers/tools/admin.d.ts.map +1 -0
  79. package/dist/handlers/tools/admin.js +270 -0
  80. package/dist/handlers/tools/admin.js.map +1 -0
  81. package/dist/handlers/tools/analytics.d.ts +8 -0
  82. package/dist/handlers/tools/analytics.d.ts.map +1 -0
  83. package/dist/handlers/tools/analytics.js +256 -0
  84. package/dist/handlers/tools/analytics.js.map +1 -0
  85. package/dist/handlers/tools/backup.d.ts +8 -0
  86. package/dist/handlers/tools/backup.d.ts.map +1 -0
  87. package/dist/handlers/tools/backup.js +224 -0
  88. package/dist/handlers/tools/backup.js.map +1 -0
  89. package/dist/handlers/tools/core.d.ts +9 -0
  90. package/dist/handlers/tools/core.d.ts.map +1 -0
  91. package/dist/handlers/tools/core.js +326 -0
  92. package/dist/handlers/tools/core.js.map +1 -0
  93. package/dist/handlers/tools/export.d.ts +8 -0
  94. package/dist/handlers/tools/export.d.ts.map +1 -0
  95. package/dist/handlers/tools/export.js +89 -0
  96. package/dist/handlers/tools/export.js.map +1 -0
  97. package/dist/handlers/tools/github/helpers.d.ts +34 -0
  98. package/dist/handlers/tools/github/helpers.d.ts.map +1 -0
  99. package/dist/handlers/tools/github/helpers.js +52 -0
  100. package/dist/handlers/tools/github/helpers.js.map +1 -0
  101. package/dist/handlers/tools/github/insights-tools.d.ts +8 -0
  102. package/dist/handlers/tools/github/insights-tools.d.ts.map +1 -0
  103. package/dist/handlers/tools/github/insights-tools.js +104 -0
  104. package/dist/handlers/tools/github/insights-tools.js.map +1 -0
  105. package/dist/handlers/tools/github/issue-tools.d.ts +8 -0
  106. package/dist/handlers/tools/github/issue-tools.d.ts.map +1 -0
  107. package/dist/handlers/tools/github/issue-tools.js +359 -0
  108. package/dist/handlers/tools/github/issue-tools.js.map +1 -0
  109. package/dist/handlers/tools/github/kanban-tools.d.ts +8 -0
  110. package/dist/handlers/tools/github/kanban-tools.d.ts.map +1 -0
  111. package/dist/handlers/tools/github/kanban-tools.js +108 -0
  112. package/dist/handlers/tools/github/kanban-tools.js.map +1 -0
  113. package/dist/handlers/tools/github/milestone-tools.d.ts +9 -0
  114. package/dist/handlers/tools/github/milestone-tools.d.ts.map +1 -0
  115. package/dist/handlers/tools/github/milestone-tools.js +302 -0
  116. package/dist/handlers/tools/github/milestone-tools.js.map +1 -0
  117. package/dist/handlers/tools/github/mutation-tools.d.ts +12 -0
  118. package/dist/handlers/tools/github/mutation-tools.d.ts.map +1 -0
  119. package/dist/handlers/tools/github/mutation-tools.js +15 -0
  120. package/dist/handlers/tools/github/mutation-tools.js.map +1 -0
  121. package/dist/handlers/tools/github/read-tools.d.ts +8 -0
  122. package/dist/handlers/tools/github/read-tools.d.ts.map +1 -0
  123. package/dist/handlers/tools/github/read-tools.js +260 -0
  124. package/dist/handlers/tools/github/read-tools.js.map +1 -0
  125. package/dist/handlers/tools/github/schemas.d.ts +467 -0
  126. package/dist/handlers/tools/github/schemas.d.ts.map +1 -0
  127. package/dist/handlers/tools/github/schemas.js +335 -0
  128. package/dist/handlers/tools/github/schemas.js.map +1 -0
  129. package/dist/handlers/tools/github.d.ts +14 -0
  130. package/dist/handlers/tools/github.d.ts.map +1 -0
  131. package/dist/handlers/tools/github.js +28 -0
  132. package/dist/handlers/tools/github.js.map +1 -0
  133. package/dist/handlers/tools/index.d.ts +15 -20
  134. package/dist/handlers/tools/index.d.ts.map +1 -1
  135. package/dist/handlers/tools/index.js +117 -2909
  136. package/dist/handlers/tools/index.js.map +1 -1
  137. package/dist/handlers/tools/relationships.d.ts +8 -0
  138. package/dist/handlers/tools/relationships.d.ts.map +1 -0
  139. package/dist/handlers/tools/relationships.js +308 -0
  140. package/dist/handlers/tools/relationships.js.map +1 -0
  141. package/dist/handlers/tools/schemas.d.ts +108 -0
  142. package/dist/handlers/tools/schemas.d.ts.map +1 -0
  143. package/dist/handlers/tools/schemas.js +122 -0
  144. package/dist/handlers/tools/schemas.js.map +1 -0
  145. package/dist/handlers/tools/search.d.ts +8 -0
  146. package/dist/handlers/tools/search.d.ts.map +1 -0
  147. package/dist/handlers/tools/search.js +282 -0
  148. package/dist/handlers/tools/search.js.map +1 -0
  149. package/dist/handlers/tools/team.d.ts +11 -0
  150. package/dist/handlers/tools/team.d.ts.map +1 -0
  151. package/dist/handlers/tools/team.js +239 -0
  152. package/dist/handlers/tools/team.js.map +1 -0
  153. package/dist/server/McpServer.d.ts +4 -0
  154. package/dist/server/McpServer.d.ts.map +1 -1
  155. package/dist/server/McpServer.js +48 -297
  156. package/dist/server/McpServer.js.map +1 -1
  157. package/dist/server/Scheduler.d.ts +91 -0
  158. package/dist/server/Scheduler.d.ts.map +1 -0
  159. package/dist/server/Scheduler.js +201 -0
  160. package/dist/server/Scheduler.js.map +1 -0
  161. package/dist/transports/http.d.ts +66 -0
  162. package/dist/transports/http.d.ts.map +1 -0
  163. package/dist/transports/http.js +519 -0
  164. package/dist/transports/http.js.map +1 -0
  165. package/dist/types/entities.d.ts +101 -0
  166. package/dist/types/entities.d.ts.map +1 -0
  167. package/dist/types/entities.js +5 -0
  168. package/dist/types/entities.js.map +1 -0
  169. package/dist/types/filtering.d.ts +34 -0
  170. package/dist/types/filtering.d.ts.map +1 -0
  171. package/dist/types/filtering.js +5 -0
  172. package/dist/types/filtering.js.map +1 -0
  173. package/dist/types/github.d.ts +166 -0
  174. package/dist/types/github.d.ts.map +1 -0
  175. package/dist/types/github.js +5 -0
  176. package/dist/types/github.js.map +1 -0
  177. package/dist/types/index.d.ts +35 -292
  178. package/dist/types/index.d.ts.map +1 -1
  179. package/dist/types/index.js +2 -2
  180. package/dist/types/index.js.map +1 -1
  181. package/dist/utils/error-helpers.d.ts +37 -0
  182. package/dist/utils/error-helpers.d.ts.map +1 -0
  183. package/dist/utils/error-helpers.js +47 -0
  184. package/dist/utils/error-helpers.js.map +1 -0
  185. package/dist/utils/logger.d.ts.map +1 -1
  186. package/dist/utils/logger.js +6 -3
  187. package/dist/utils/logger.js.map +1 -1
  188. package/dist/utils/security-utils.d.ts +0 -21
  189. package/dist/utils/security-utils.d.ts.map +1 -1
  190. package/dist/utils/security-utils.js +0 -47
  191. package/dist/utils/security-utils.js.map +1 -1
  192. package/dist/vector/VectorSearchManager.d.ts.map +1 -1
  193. package/dist/vector/VectorSearchManager.js +9 -32
  194. package/dist/vector/VectorSearchManager.js.map +1 -1
  195. package/docker-compose.yml +11 -2
  196. package/hooks/README.md +107 -0
  197. package/hooks/cursor/hooks.json +10 -0
  198. package/hooks/cursor/memory-journal.mdc +22 -0
  199. package/hooks/cursor/session-end.sh +19 -0
  200. package/hooks/kilo-code/session-end-mode.json +11 -0
  201. package/hooks/kiro/session-end.md +13 -0
  202. package/mcp-config-example.json +1 -0
  203. package/package.json +11 -9
  204. package/playwright.config.ts +29 -0
  205. package/releases/v4.5.0.md +116 -0
  206. package/releases/v5.0.0.md +105 -0
  207. package/scripts/generate-server-instructions.ts +176 -0
  208. package/scripts/server-instructions-function-body.ts +77 -0
  209. package/server.json +3 -3
  210. package/src/cli.ts +45 -1
  211. package/src/constants/ServerInstructions.ts +133 -73
  212. package/src/constants/icons.ts +8 -7
  213. package/src/constants/server-instructions.md +268 -0
  214. package/src/database/SqliteAdapter.ts +358 -192
  215. package/src/database/schema.ts +125 -0
  216. package/src/filtering/ToolFilter.ts +13 -2
  217. package/src/github/GitHubIntegration.ts +1 -3
  218. package/src/handlers/prompts/github.ts +209 -0
  219. package/src/handlers/prompts/index.ts +10 -499
  220. package/src/handlers/prompts/workflow.ts +314 -0
  221. package/src/handlers/resources/core.ts +528 -0
  222. package/src/handlers/resources/github.ts +358 -0
  223. package/src/handlers/resources/graph.ts +254 -0
  224. package/src/handlers/resources/index.ts +23 -1570
  225. package/src/handlers/resources/shared.ts +103 -0
  226. package/src/handlers/resources/team.ts +133 -0
  227. package/src/handlers/resources/templates.ts +374 -0
  228. package/src/handlers/tools/admin.ts +285 -0
  229. package/src/handlers/tools/analytics.ts +301 -0
  230. package/src/handlers/tools/backup.ts +242 -0
  231. package/src/handlers/tools/core.ts +350 -0
  232. package/src/handlers/tools/export.ts +115 -0
  233. package/src/handlers/tools/github/helpers.ts +86 -0
  234. package/src/handlers/tools/github/insights-tools.ts +119 -0
  235. package/src/handlers/tools/github/issue-tools.ts +439 -0
  236. package/src/handlers/tools/github/kanban-tools.ts +134 -0
  237. package/src/handlers/tools/github/milestone-tools.ts +392 -0
  238. package/src/handlers/tools/github/mutation-tools.ts +17 -0
  239. package/src/handlers/tools/github/read-tools.ts +328 -0
  240. package/src/handlers/tools/github/schemas.ts +369 -0
  241. package/src/handlers/tools/github.ts +36 -0
  242. package/src/handlers/tools/index.ts +144 -3325
  243. package/src/handlers/tools/relationships.ts +358 -0
  244. package/src/handlers/tools/schemas.ts +132 -0
  245. package/src/handlers/tools/search.ts +343 -0
  246. package/src/handlers/tools/team.ts +273 -0
  247. package/src/server/McpServer.ts +63 -358
  248. package/src/server/Scheduler.ts +278 -0
  249. package/src/transports/http.ts +635 -0
  250. package/src/types/entities.ts +145 -0
  251. package/src/types/filtering.ts +54 -0
  252. package/src/types/github.ts +180 -0
  253. package/src/types/index.ts +67 -375
  254. package/src/utils/error-helpers.ts +52 -0
  255. package/src/utils/logger.ts +6 -3
  256. package/src/utils/security-utils.ts +0 -52
  257. package/src/vector/VectorSearchManager.ts +9 -33
  258. package/tests/constants/icons.test.ts +1 -2
  259. package/tests/constants/server-instructions.test.ts +30 -4
  260. package/tests/database/sqlite-adapter.test.ts +91 -7
  261. package/tests/e2e/auth.spec.ts +154 -0
  262. package/tests/e2e/health.spec.ts +63 -0
  263. package/tests/e2e/protocols.spec.ts +134 -0
  264. package/tests/e2e/resources.spec.ts +103 -0
  265. package/tests/e2e/scheduler.spec.ts +79 -0
  266. package/tests/e2e/security.spec.ts +91 -0
  267. package/tests/e2e/sessions.spec.ts +95 -0
  268. package/tests/e2e/stateless.spec.ts +121 -0
  269. package/tests/e2e/tools.spec.ts +111 -0
  270. package/tests/filtering/tool-filter.test.ts +46 -0
  271. package/tests/handlers/error-path-coverage.test.ts +324 -0
  272. package/tests/handlers/github-resource-handlers.test.ts +453 -0
  273. package/tests/handlers/github-tool-handlers.test.ts +899 -0
  274. package/tests/handlers/prompt-handler-coverage.test.ts +106 -0
  275. package/tests/handlers/prompt-handlers.test.ts +40 -0
  276. package/tests/handlers/resource-handler-coverage.test.ts +181 -0
  277. package/tests/handlers/resource-handlers.test.ts +33 -9
  278. package/tests/handlers/search-tool-handlers.test.ts +272 -0
  279. package/tests/handlers/targeted-gap-closure.test.ts +387 -0
  280. package/tests/handlers/team-resource-handlers.test.ts +156 -0
  281. package/tests/handlers/team-tool-handlers.test.ts +301 -0
  282. package/tests/handlers/tool-handler-coverage.test.ts +469 -0
  283. package/tests/handlers/tool-handlers.test.ts +2 -2
  284. package/tests/security/sql-injection.test.ts +3 -54
  285. package/tests/server/mcp-server.test.ts +503 -8
  286. package/tests/server/scheduler.test.ts +400 -0
  287. package/tests/transports/http-transport.test.ts +620 -0
  288. package/tests/vector/vector-search-manager.test.ts +60 -0
  289. package/vitest.config.ts +4 -1
  290. package/.memory-journal-team.db +0 -0
  291. package/.vscode/settings.json +0 -84
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Memory Journal MCP Server
2
2
 
3
- **Last Updated February 27, 2026**
3
+ **Last Updated March 6, 2026**
4
4
 
5
5
  <!-- mcp-name: io.github.neverinfamous/memory-journal-mcp -->
6
6
 
@@ -12,12 +12,12 @@
12
12
  [![MCP Registry](https://img.shields.io/badge/MCP_Registry-Published-green)](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.neverinfamous/memory-journal-mcp)
13
13
  [![Security](https://img.shields.io/badge/Security-Enhanced-green.svg)](SECURITY.md)
14
14
  [![TypeScript](https://img.shields.io/badge/TypeScript-Strict-blue.svg)](https://github.com/neverinfamous/memory-journal-mcp)
15
- ![Coverage](https://img.shields.io/badge/Coverage-80.7%25-brightgreen.svg)
16
- ![Tests](https://img.shields.io/badge/Tests-479_passed-brightgreen.svg)
15
+ ![Coverage](https://img.shields.io/badge/Coverage-94%25-brightgreen.svg)
16
+ ![Tests](https://img.shields.io/badge/Tests-730_passed-brightgreen.svg)
17
17
 
18
- 🎯 **AI Context + Project Intelligence:** Bridge disconnected AI sessions with persistent project memory, while integrating your complete GitHub workflow β€” Issues, PRs, Actions, Kanban boards, Milestones, Repository Insights, and Knowledge Graphs β€” into every conversation.
18
+ 🎯 **AI Context + Project Intelligence:** Bridge disconnected AI sessions with persistent project memory and **automatic session handoff** β€” with full GitHub workflow integration.
19
19
 
20
- **[GitHub](https://github.com/neverinfamous/memory-journal-mcp)** β€’ **[Wiki](https://github.com/neverinfamous/memory-journal-mcp/wiki)** β€’ **[Changelog](https://github.com/neverinfamous/memory-journal-mcp/wiki/CHANGELOG)** β€’ **[Release Article](https://adamic.tech/articles/memory-journal-mcp-server)**
20
+ **[GitHub](https://github.com/neverinfamous/memory-journal-mcp)** β€’ **[Wiki](https://github.com/neverinfamous/memory-journal-mcp/wiki)** β€’ **[Changelog](https://github.com/neverinfamous/memory-journal-mcp/blob/main/CHANGELOG.md)** β€’ **[Release Article](https://adamic.tech/articles/memory-journal-mcp-server)**
21
21
 
22
22
  **πŸš€ Quick Deploy:**
23
23
 
@@ -28,13 +28,48 @@
28
28
 
29
29
  ### Key Benefits
30
30
 
31
+ **42 MCP Tools** Β· **15 Workflow Prompts** Β· **22 Resources** Β· **9 Tool Groups** Β· **GitHub Integration** (Issues, PRs, Actions, Kanban, Milestones, Insights)
32
+
31
33
  - 🧠 **Dynamic Context Management** - AI agents automatically query your project history and create entries at the right moments
32
34
  - πŸ“ **Auto-capture Git/GitHub context** (commits, branches, issues, milestones, PRs, projects)
33
- - πŸ”— **Build knowledge graphs** linking specs β†’ implementations β†’ tests β†’ PRs
34
- - πŸ” **Triple search** (full-text, semantic, date range)
35
+ - πŸ”— **Knowledge graphs** - 8 relationship types linking specs β†’ implementations β†’ tests β†’ PRs with Mermaid visualization
36
+ - πŸ” **Triple search** - full-text, semantic (AI-powered via `@xenova/transformers`), and date range
35
37
  - πŸ“Š **Generate reports** (standups, retrospectives, PR summaries, status)
36
38
  - πŸ“ˆ **Track repository insights** β€” stars, forks, clones, views, top referrers, and popular paths (14-day rolling)
37
39
  - πŸ—„οΈ **Backup & restore** your journal data with one command
40
+ - ⏰ **Automated maintenance** β€” scheduled backups, database optimization, and vector index rebuilds for long-running HTTP deployments
41
+ - 🌐 **Dual HTTP transport** β€” Streamable HTTP (`/mcp`) for modern clients + legacy SSE (`/sse`) for backward compatibility, with stateless mode for serverless deployments
42
+ - πŸ‘₯ **Team collaboration** β€” separate public team database with author attribution, cross-DB search, and dedicated team tools
43
+ - πŸ”„ **Session continuity** β€” automatic end-of-session summaries flow into the next session's briefing
44
+ - πŸ”§ **IDE Hooks** β€” ready-to-use session-end configs for Cursor, Kiro, and Kilo Code ([setup β†’](hooks/))
45
+ - πŸ’‘ **Rule & skill suggestions** β€” agents offer to codify your recurring patterns with your approval
46
+ - βœ… **Deterministic error handling** β€” every tool returns structured `{success, error}` responses β€” no raw exceptions, no silent failures. Agents get actionable context instead of cryptic stack traces
47
+
48
+ ---
49
+
50
+ ## 🎯 Why Memory Journal?
51
+
52
+ When managing large projects with AI assistance, you face a critical challenge:
53
+
54
+ - **Thread Amnesia** - Each new AI conversation starts from zero, unaware of previous work
55
+ - **Lost Context** - Decisions, implementations, and learnings scattered across disconnected threads
56
+ - **Repeated Work** - AI suggests solutions you've already tried or abandoned
57
+ - **Context Overload** - Manually copying project history into every new conversation
58
+
59
+ Memory Journal solves this by acting as your project's **long-term memory**, bridging the gap between fragmented AI sessions.
60
+
61
+ ---
62
+
63
+ **Ask Agent naturally:**
64
+
65
+ - "Show me my recent journal entries"
66
+ - "Create a backup of my journal"
67
+ - "Check the server health status"
68
+ - "Find entries related to performance"
69
+
70
+ **[See complete examples & prompts β†’](https://github.com/neverinfamous/memory-journal-mcp/wiki/Examples)**
71
+
72
+ ---
38
73
 
39
74
  ```mermaid
40
75
  flowchart TB
@@ -49,7 +84,7 @@ flowchart TB
49
84
  end
50
85
 
51
86
  subgraph Search["πŸ” Triple Search"]
52
- FTS["Full-Text (FTS5)"]
87
+ FTS["Full-Text"]
53
88
  Semantic["Semantic (Vector)"]
54
89
  DateRange["Date Range"]
55
90
  end
@@ -59,6 +94,7 @@ flowchart TB
59
94
  PRs["Pull Requests"]
60
95
  Actions["GitHub Actions"]
61
96
  Kanban["Kanban Boards"]
97
+ Insights["Repository Insights"]
62
98
  end
63
99
 
64
100
  subgraph Outputs["πŸ“Š Outputs"]
@@ -67,54 +103,109 @@ flowchart TB
67
103
  Timeline["Project Timelines"]
68
104
  end
69
105
 
106
+ subgraph SessionEnd["πŸ”„ Session End"]
107
+ Summary["Session Summary Entry<br/>(retrospective + session-summary tag)"]
108
+ end
109
+
70
110
  Session --> Core
71
111
  Core --> Search
72
112
  Core <--> GitHub
73
113
  Search --> Outputs
74
114
  GitHub --> Outputs
115
+ Core --> SessionEnd
116
+ SessionEnd -.->|"next session"| Briefing
75
117
  ```
76
118
 
77
- ### πŸ“ˆ **Current Capabilities**
119
+ ---
120
+
121
+ ### Tool Filtering
122
+
123
+ Control which tools are exposed via `MEMORY_JOURNAL_MCP_TOOL_FILTER` (or CLI: `--tool-filter`):
78
124
 
79
- - **39 MCP tools** - Complete development workflow + backup/restore + Kanban + Milestones + Insights + issue management
80
- - **15 workflow prompts** - Standups, retrospectives, PR workflows, CI/CD failure analysis, session acknowledgment
81
- - **21 MCP resources** - 14 static + 7 template (require parameters)
82
- - **GitHub Integration** - Projects, Issues, Pull Requests, Actions, **Kanban boards**, **Milestones**
83
- - **8 tool groups** - `core`, `search`, `analytics`, `relationships`, `export`, `admin`, `github`, `backup`
84
- - **Knowledge graphs** - 8 relationship types, Mermaid visualization
85
- - **Semantic search** - AI-powered conceptual search via `@xenova/transformers`
125
+ | Filter | Tools | Use Case |
126
+ | -------------------- | ----- | ----------------------- |
127
+ | `full` | 42 | All tools (default) |
128
+ | `starter` | ~10 | Core + search only |
129
+ | `essential` | ~6 | Minimal footprint |
130
+ | `readonly` | ~15 | Disable all mutations |
131
+ | `-github` | 27 | Exclude a group |
132
+ | `-github,-analytics` | 25 | Exclude multiple groups |
133
+
134
+ **Filter Syntax:** `-group` (disable group) Β· `-tool` (disable tool) Β· `+tool` (re-enable after group disable)
135
+
136
+ **Groups:** `core`, `search`, `analytics`, `relationships`, `export`, `admin`, `github`, `backup`, `team`
137
+
138
+ **[Complete tool filtering guide β†’](https://github.com/neverinfamous/memory-journal-mcp/wiki/Tool-Filtering)**
86
139
 
87
140
  ---
88
141
 
89
- ## 🎯 Why Memory Journal?
142
+ ## πŸ“‹ Core Capabilities
90
143
 
91
- ### **The Fragmented AI Context Problem**
144
+ ### πŸ› οΈ **42 MCP Tools** (9 Groups)
92
145
 
93
- When managing large projects with AI assistance, you face a critical challenge:
146
+ | Group | Tools | Description |
147
+ | --------------- | ----- | ------------------------------------------------------------------------------- |
148
+ | `core` | 6 | Entry CRUD, tags, test |
149
+ | `search` | 4 | Text search, date range, semantic, vector stats |
150
+ | `analytics` | 2 | Statistics, cross-project insights |
151
+ | `relationships` | 2 | Link entries, visualize graphs |
152
+ | `export` | 1 | JSON/Markdown export |
153
+ | `admin` | 5 | Update, delete, rebuild/add to vector index, merge tags |
154
+ | `github` | 15 | Issues, PRs, context, Kanban, **Milestones**, **Insights**, **issue lifecycle** |
155
+ | `backup` | 4 | Backup, list, restore, cleanup |
156
+ | `team` | 3 | Team create, get recent, search (requires `TEAM_DB_PATH`) |
94
157
 
95
- - **Thread Amnesia** - Each new AI conversation starts from zero, unaware of previous work
96
- - **Lost Context** - Decisions, implementations, and learnings scattered across disconnected threads
97
- - **Repeated Work** - AI suggests solutions you've already tried or abandoned
98
- - **Context Overload** - Manually copying project history into every new conversation
158
+ **[Complete tools reference β†’](https://github.com/neverinfamous/memory-journal-mcp/wiki/Tools)**
159
+
160
+ ### 🎯 **15 Workflow Prompts**
161
+
162
+ - `find-related` - Discover connected entries via semantic similarity
163
+ - `prepare-standup` - Daily standup summaries
164
+ - `prepare-retro` - Sprint retrospectives
165
+ - `weekly-digest` - Day-by-day weekly summaries
166
+ - `analyze-period` - Deep period analysis with insights
167
+ - `goal-tracker` - Milestone and achievement tracking
168
+ - `get-context-bundle` - Project context with Git/GitHub/Kanban
169
+ - `get-recent-entries` - Formatted recent entries
170
+ - `project-status-summary` - GitHub Project status reports
171
+ - `pr-summary` - Pull request journal activity summary
172
+ - `code-review-prep` - Comprehensive PR review preparation
173
+ - `pr-retrospective` - Completed PR analysis with learnings
174
+ - `actions-failure-digest` - CI/CD failure analysis
175
+ - `project-milestone-tracker` - Milestone progress tracking
176
+ - `confirm-briefing` - Acknowledge session context to user
99
177
 
100
- ### **The Solution: Persistent Project Memory**
178
+ **[Complete prompts guide β†’](https://github.com/neverinfamous/memory-journal-mcp/wiki/Prompts)**
101
179
 
102
- Memory Journal acts as your project's **long-term memory**, bridging the gap between fragmented AI threads:
180
+ ### πŸ“‘ **22 Resources** (15 Static + 7 Template)
103
181
 
104
- **For Developers:**
182
+ **Static Resources** (appear in resource lists):
105
183
 
106
- - πŸ“ **Automatic Context Capture** - Git commits, branches, GitHub issues, PRs, and project state captured with every entry
107
- - πŸ”— **Knowledge Graph** - Link related work (specs β†’ implementations β†’ tests β†’ PRs) to build a connected history
108
- - πŸ” **Intelligent Search** - Find past decisions, solutions, and context across your entire project timeline
109
- - πŸ“Š **Project Analytics** - Track progress from issues through PRs, generate reports for standups/retrospectives
184
+ - `memory://briefing` - **Session initialization**: compact context for AI agents (~300 tokens)
185
+ - `memory://instructions` - **Behavioral guidance**: complete server instructions for AI agents
186
+ - `memory://recent` - 10 most recent entries
187
+ - `memory://significant` - Significant milestones and breakthroughs
188
+ - `memory://graph/recent` - Live Mermaid diagram of recent relationships
189
+ - `memory://health` - Server health & diagnostics
190
+ - `memory://graph/actions` - CI/CD narrative graph
191
+ - `memory://actions/recent` - Recent workflow runs
192
+ - `memory://tags` - All tags with usage counts
193
+ - `memory://statistics` - Journal statistics
194
+ - `memory://github/status` - GitHub repository status overview
195
+ - `memory://github/insights` - Repository stars, forks, and 14-day traffic summary
196
+ - `memory://github/milestones` - Open milestones with completion percentages
197
+ - `memory://team/recent` - Recent team entries with author attribution
198
+ - `memory://team/statistics` - Team entry counts, types, and author breakdown
110
199
 
111
- **For AI-Assisted Work:**
200
+ **Template Resources** (require parameters, fetch directly by URI):
112
201
 
113
- - 🧠 **Dynamic Context Management** - Built-in guidance teaches AI agents when to query your project history and when to create entries
114
- - πŸ’‘ AI can query your **complete project history** in any conversation
115
- - πŸ” **Semantic search** finds conceptually related work, even without exact keywords
116
- - πŸ“– **Context bundles** provide AI with comprehensive project state instantly
117
- - πŸ”— **Relationship visualization** shows how different pieces of work connect
202
+ - `memory://projects/{number}/timeline` - Project activity timeline
203
+ - `memory://issues/{issue_number}/entries` - Entries linked to issue
204
+ - `memory://prs/{pr_number}/entries` - Entries linked to PR
205
+ - `memory://prs/{pr_number}/timeline` - Combined PR + journal timeline
206
+ - `memory://kanban/{project_number}` - GitHub Project Kanban board
207
+ - `memory://kanban/{project_number}/diagram` - Kanban Mermaid visualization
208
+ - `memory://milestones/{number}` - Milestone detail with completion progress
118
209
 
119
210
  ---
120
211
 
@@ -193,12 +284,27 @@ memory-journal-mcp --transport http --port 3000 --server-host 0.0.0.0
193
284
 
194
285
  **Endpoints:**
195
286
 
196
- - `POST /mcp` β€” JSON-RPC requests (initialize, tools/call, etc.)
197
- - `GET /mcp` β€” SSE stream for server-to-client notifications
198
- - `DELETE /mcp` β€” Session termination
287
+ | Endpoint | Description | Mode |
288
+ | ---------------- | ------------------------------------------------ | -------- |
289
+ | `GET /` | Server info and available endpoints | Both |
290
+ | `POST /mcp` | JSON-RPC requests (initialize, tools/call, etc.) | Both |
291
+ | `GET /mcp` | SSE stream for server-to-client notifications | Stateful |
292
+ | `DELETE /mcp` | Session termination | Stateful |
293
+ | `GET /sse` | Legacy SSE connection (MCP 2024-11-05) | Stateful |
294
+ | `POST /messages` | Legacy SSE message endpoint | Stateful |
295
+ | `GET /health` | Health check (`{ status, timestamp }`) | Both |
199
296
 
200
297
  **Session Management:** The server uses stateful sessions by default. Include the `mcp-session-id` header (returned from initialization) in subsequent requests.
201
298
 
299
+ **Security Features:**
300
+
301
+ - **6 Security Headers** β€” `X-Content-Type-Options`, `X-Frame-Options`, `Content-Security-Policy`, `Cache-Control`, `Referrer-Policy`, `Permissions-Policy`
302
+ - **Rate Limiting** β€” 100 requests/minute per IP (429 on excess)
303
+ - **CORS** β€” Configurable via `--cors-origin` or `MCP_CORS_ORIGIN` (default: `*`)
304
+ - **Body Size Limit** β€” 1 MB maximum
305
+ - **404 Handler** β€” Unknown paths return `{ error: "Not found" }`
306
+ - **Cross-Protocol Guard** β€” SSE session IDs rejected on `/mcp` and vice versa
307
+
202
308
  **Example with curl:**
203
309
 
204
310
  ```bash
@@ -225,10 +331,32 @@ For serverless deployments (Lambda, Workers, Vercel), use stateless mode:
225
331
  memory-journal-mcp --transport http --port 3000 --stateless
226
332
  ```
227
333
 
228
- | Mode | Progress Notifications | SSE Streaming | Serverless |
229
- | ------------------------- | ---------------------- | ------------- | ---------- |
230
- | Stateful (default) | βœ… Yes | βœ… Yes | ⚠️ Complex |
231
- | Stateless (`--stateless`) | ❌ No | ❌ No | βœ… Native |
334
+ | Mode | Progress Notifications | Legacy SSE | Serverless |
335
+ | ------------------------- | ---------------------- | ---------- | ---------- |
336
+ | Stateful (default) | βœ… Yes | βœ… Yes | ⚠️ Complex |
337
+ | Stateless (`--stateless`) | ❌ No | ❌ No | βœ… Native |
338
+
339
+ #### Automated Scheduling (HTTP Only)
340
+
341
+ When running in HTTP/SSE mode, enable periodic maintenance jobs with CLI flags. These jobs run in-process on `setInterval` β€” no external cron needed.
342
+
343
+ > **Note:** These flags are ignored for stdio transport because stdio sessions are short-lived (tied to your IDE session). For stdio, use OS-level scheduling (Task Scheduler, cron) or run the backup/cleanup tools manually.
344
+
345
+ ```bash
346
+ memory-journal-mcp --transport http --port 3000 \
347
+ --backup-interval 60 --keep-backups 10 \
348
+ --vacuum-interval 1440 \
349
+ --rebuild-index-interval 720
350
+ ```
351
+
352
+ | Flag | Default | Description |
353
+ | -------------------------------- | ------- | -------------------------------------------------------------------- |
354
+ | `--backup-interval <min>` | 0 (off) | Create timestamped database backups and prune old ones automatically |
355
+ | `--keep-backups <count>` | 5 | Max backups retained during automated cleanup |
356
+ | `--vacuum-interval <min>` | 0 (off) | Run `PRAGMA optimize` and flush database to disk |
357
+ | `--rebuild-index-interval <min>` | 0 (off) | Full vector index rebuild to maintain semantic search quality |
358
+
359
+ Each job is error-isolated β€” a failure in one job won't affect the others. Scheduler status (last run, result, next run) is visible via `memory://health`.
232
360
 
233
361
  ### GitHub Integration Configuration
234
362
 
@@ -250,13 +378,16 @@ The GitHub tools (`get_github_issues`, `get_github_prs`, etc.) can auto-detect t
250
378
  }
251
379
  ```
252
380
 
253
- | Environment Variable | Description |
254
- | ------------------------ | ---------------------------------------------------------------------- |
255
- | `GITHUB_TOKEN` | GitHub personal access token for API access |
256
- | `GITHUB_REPO_PATH` | Path to the git repository for auto-detecting owner/repo |
257
- | `DEFAULT_PROJECT_NUMBER` | Default GitHub Project number for auto-assignment when creating issues |
258
- | `AUTO_REBUILD_INDEX` | Set to `true` to rebuild vector index on server startup |
259
- | `MCP_HOST` | Server bind host (`0.0.0.0` for containers, default: `localhost`) |
381
+ | Environment Variable | Description |
382
+ | ------------------------ | ----------------------------------------------------------------------- |
383
+ | `DB_PATH` | Database file location (CLI: `--db`; default: `./memory_journal.db`) |
384
+ | `TEAM_DB_PATH` | Team database file location (CLI: `--team-db`) |
385
+ | `TEAM_AUTHOR` | Override author name for team entries (default: `git config user.name`) |
386
+ | `GITHUB_TOKEN` | GitHub personal access token for API access |
387
+ | `GITHUB_REPO_PATH` | Path to the git repository for auto-detecting owner/repo |
388
+ | `DEFAULT_PROJECT_NUMBER` | Default GitHub Project number for auto-assignment when creating issues |
389
+ | `AUTO_REBUILD_INDEX` | Set to `true` to rebuild vector index on server startup |
390
+ | `MCP_HOST` | Server bind host (`0.0.0.0` for containers, default: `localhost`) |
260
391
 
261
392
  **Without `GITHUB_REPO_PATH`**: You'll need to explicitly provide `owner` and `repo` parameters when calling GitHub tools.
262
393
 
@@ -284,85 +415,27 @@ When GitHub tools cannot auto-detect repository information:
284
415
 
285
416
  - **Listing MCP Resources**: If the agent has trouble listing resources, instruct it to call `ListMcpResources()` without specifying a server parameter, or with `server: "user-memory-journal-mcp"` (Cursor prefixes server names with `user-`).
286
417
 
287
- **Google AntiGravity IDE:**
288
-
289
- - **AntiGravity Users:** Server instructions are automatically sent to MCP clients during initialization. However, AntiGravity does not currently support MCP server instructions. For optimal usage in AntiGravity, manually provide the contents of [`src/constants/ServerInstructions.ts`](src/constants/ServerInstructions.ts) to the agent in your prompt or user rules.
290
-
291
- - **Session start**: Add to your user rules: "At session start, read `memory://briefing` from memory-journal-mcp."
418
+ ### πŸ”„ Session Management
292
419
 
293
- - **Full guidance**: If behaviors missing, read `memory://instructions` for complete Dynamic Context Management patterns.
420
+ Memory Journal bridges AI sessions automatically β€” the agent reads project context at session start and captures a summary at session end.
294
421
 
295
- - **Prompts not available**: AntiGravity does not currently support MCP prompts. The 15 workflow prompts are not accessible.
422
+ **How it works:**
296
423
 
297
- ---
298
-
299
- ## πŸ“‹ Core Capabilities
300
-
301
- ### πŸ› οΈ **39 MCP Tools** (8 Groups)
302
-
303
- | Group | Tools | Description |
304
- | --------------- | ----- | ------------------------------------------------------------------------------- |
305
- | `core` | 6 | Entry CRUD, tags, test |
306
- | `search` | 4 | Text search, date range, semantic, vector stats |
307
- | `analytics` | 2 | Statistics, cross-project insights |
308
- | `relationships` | 2 | Link entries, visualize graphs |
309
- | `export` | 1 | JSON/Markdown export |
310
- | `admin` | 5 | Update, delete, rebuild/add to vector index, merge tags |
311
- | `github` | 15 | Issues, PRs, context, Kanban, **Milestones**, **Insights**, **issue lifecycle** |
312
- | `backup` | 4 | Backup, list, restore, cleanup |
313
-
314
- **[Complete tools reference β†’](https://github.com/neverinfamous/memory-journal-mcp/wiki/Tools)**
315
-
316
- ### 🎯 **15 Workflow Prompts**
317
-
318
- - `find-related` - Discover connected entries via semantic similarity
319
- - `prepare-standup` - Daily standup summaries
320
- - `prepare-retro` - Sprint retrospectives
321
- - `weekly-digest` - Day-by-day weekly summaries
322
- - `analyze-period` - Deep period analysis with insights
323
- - `goal-tracker` - Milestone and achievement tracking
324
- - `get-context-bundle` - Project context with Git/GitHub/Kanban
325
- - `get-recent-entries` - Formatted recent entries
326
- - `project-status-summary` - GitHub Project status reports
327
- - `pr-summary` - Pull request journal activity summary
328
- - `code-review-prep` - Comprehensive PR review preparation
329
- - `pr-retrospective` - Completed PR analysis with learnings
330
- - `actions-failure-digest` - CI/CD failure analysis
331
- - `project-milestone-tracker` - Milestone progress tracking
332
- - `confirm-briefing` - Acknowledge session context to user
333
-
334
- **[Complete prompts guide β†’](https://github.com/neverinfamous/memory-journal-mcp/wiki/Prompts)**
335
-
336
- ### πŸ“‘ **21 Resources** (14 Static + 7 Template)
424
+ 1. Session starts β†’ agent reads `memory://briefing` and shows you a project context summary
425
+ 2. Session ends β†’ agent creates a `retrospective` entry tagged `session-summary`
426
+ 3. Next session's briefing includes the previous summary β€” context flows seamlessly
337
427
 
338
- **Static Resources** (appear in resource lists):
339
-
340
- - `memory://briefing` - **Session initialization**: compact context for AI agents (~300 tokens)
341
- - `memory://instructions` - **Behavioral guidance**: complete server instructions for AI agents
342
- - `memory://recent` - 10 most recent entries
343
- - `memory://significant` - Significant milestones and breakthroughs
344
- - `memory://graph/recent` - Live Mermaid diagram of recent relationships
345
- - `memory://team/recent` - Recent team-shared entries
346
- - `memory://health` - Server health & diagnostics
347
- - `memory://graph/actions` - CI/CD narrative graph
348
- - `memory://actions/recent` - Recent workflow runs
349
- - `memory://tags` - All tags with usage counts
350
- - `memory://statistics` - Journal statistics
351
- - `memory://github/status` - GitHub repository status overview
352
- - `memory://github/insights` - Repository stars, forks, and 14-day traffic summary
353
- - `memory://github/milestones` - Open milestones with completion percentages
428
+ **Setup by IDE:** Ready-to-use rules and hooks in [`hooks/`](hooks/):
354
429
 
355
- **Template Resources** (require parameters, fetch directly by URI):
430
+ | Client | Primary (agent behavior) | Optional (audit/logging) |
431
+ | -------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
432
+ | **Cursor** | Copy [`hooks/cursor/memory-journal.mdc`](hooks/cursor/memory-journal.mdc) to `.cursor/rules/` | Copy [`hooks/cursor/hooks.json`](hooks/cursor/hooks.json) + `session-end.sh` to `.cursor/` |
433
+ | **Kiro (AWS)** | Server instructions (automatic) | Copy [`hooks/kiro/session-end.md`](hooks/kiro/session-end.md) to `.kiro/hooks/` |
434
+ | **Kilo Code** | Server instructions (automatic) | Import [`hooks/kilo-code/session-end-mode.json`](hooks/kilo-code/session-end-mode.json) |
356
435
 
357
- - `memory://projects/{number}/timeline` - Project activity timeline
358
- - `memory://issues/{issue_number}/entries` - Entries linked to issue
359
- - `memory://prs/{pr_number}/entries` - Entries linked to PR
360
- - `memory://prs/{pr_number}/timeline` - Combined PR + journal timeline
361
- - `memory://kanban/{project_number}` - GitHub Project Kanban board
362
- - `memory://kanban/{project_number}/diagram` - Kanban Mermaid visualization
363
- - `memory://milestones/{number}` - Milestone detail with completion progress
436
+ **No rules or hooks?** The built-in server instructions handle both session start and end in any MCP client. The Cursor rule improves reliability by giving the agent explicit always-on instructions. This is **opt-out**: tell the agent "skip the summary" to disable session-end entries.
364
437
 
365
- ---
438
+ See [`hooks/README.md`](hooks/README.md) for detailed setup instructions.
366
439
 
367
440
  ## πŸ”§ Configuration
368
441
 
@@ -394,70 +467,10 @@ Memory Journal provides a **hybrid approach** to GitHub management:
394
467
  - `get_repo_insights` - **Repository traffic & analytics** (stars, clones, views, referrers, popular paths)
395
468
  - `create_github_issue_with_entry` / `close_github_issue_with_entry` - **Issue lifecycle with journal linking**
396
469
 
397
- **Agent Operations (via gh CLI):**
398
-
399
- ```bash
400
- # Issues
401
- gh issue create --title "Bug fix" --body "Description"
402
- gh issue close 42
403
-
404
- # Pull Requests
405
- gh pr create --fill
406
- gh pr merge 123
407
-
408
- # Projects
409
- gh project item-add 5 --owner neverinfamous --url "issue-url"
410
-
411
- # Releases
412
- gh release create v1.0.0 --generate-notes
413
- ```
414
-
415
- > **Why this design?** The MCP server focuses on value-added features that integrate journal entries with GitHub (Kanban views, timeline resources, context linking). Standard GitHub operations are already excellently handled by `gh` CLI, which agents can invoke directly.
470
+ > **Why this design?** The MCP server focuses on value-added features that integrate journal entries with GitHub (Kanban views, Milestones, timeline resources, context linking). Standard GitHub mutations (create/close issues, merge PRs, manage releases) are handled directly by agents via `gh` CLI.
416
471
 
417
472
  **[Complete GitHub integration guide β†’](https://github.com/neverinfamous/memory-journal-mcp/wiki/Git-Integration)**
418
473
 
419
- ### Tool Filtering (Optional)
420
-
421
- Control which tools are exposed using `MEMORY_JOURNAL_MCP_TOOL_FILTER`:
422
-
423
- ```bash
424
- export MEMORY_JOURNAL_MCP_TOOL_FILTER="-analytics,-github"
425
- ```
426
-
427
- **Filter Syntax:**
428
-
429
- - `-group` - Disable all tools in a group
430
- - `-tool` - Disable a specific tool
431
- - `+tool` - Re-enable after group disable
432
- - Meta-groups: `starter`, `essential`, `full`, `readonly`
433
-
434
- **Example Configurations:**
435
-
436
- ```json
437
- {
438
- "mcpServers": {
439
- "memory-journal-mcp": {
440
- "command": "memory-journal-mcp",
441
- "env": {
442
- "MEMORY_JOURNAL_MCP_TOOL_FILTER": "starter",
443
- "GITHUB_TOKEN": "your_token"
444
- }
445
- }
446
- }
447
- }
448
- ```
449
-
450
- | Configuration | Filter String | Tools |
451
- | -------------- | ------------- | ----- |
452
- | Starter | `starter` | ~10 |
453
- | Essential | `essential` | ~6 |
454
- | Full (default) | `full` | 39 |
455
- | Read-only | `readonly` | ~15 |
456
-
457
- **[Complete tool filtering guide β†’](https://github.com/neverinfamous/memory-journal-mcp/wiki/Tool-Filtering)**
458
-
459
- ---
460
-
461
474
  ## πŸ—οΈ Architecture
462
475
 
463
476
  ### Data Flow
@@ -467,8 +480,8 @@ flowchart TB
467
480
  AI["πŸ€– AI Agent<br/>(Cursor, Windsurf, Claude)"]
468
481
 
469
482
  subgraph MCP["Memory Journal MCP Server"]
470
- Tools["πŸ› οΈ 39 Tools"]
471
- Resources["πŸ“‘ 21 Resources"]
483
+ Tools["πŸ› οΈ 42 Tools"]
484
+ Resources["πŸ“‘ 22 Resources"]
472
485
  Prompts["πŸ’¬ 15 Prompts"]
473
486
  end
474
487
 
@@ -496,7 +509,7 @@ flowchart TB
496
509
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
497
510
  β”‚ MCP Server Layer (TypeScript) β”‚
498
511
  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
499
- β”‚ β”‚ Tools (39) β”‚ β”‚ Resources (21) β”‚ β”‚ Prompts (15)β”‚ β”‚
512
+ β”‚ β”‚ Tools (42) β”‚ β”‚ Resources (22) β”‚ β”‚ Prompts (15)β”‚ β”‚
500
513
  β”‚ β”‚ with Annotationsβ”‚ β”‚ with Annotationsβ”‚ β”‚ β”‚ β”‚
501
514
  β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
502
515
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
@@ -529,9 +542,9 @@ flowchart TB
529
542
 
530
543
  Memory Journal is designed for extremely low overhead during AI task execution. We include a `vitest bench` suite to maintain these baseline guarantees:
531
544
 
532
- - **Database Reads**: Operations execute in fractions of a millisecond. `calculateImportance` is ~55x faster than retrieving 50 recent entries.
533
- - **Vector Search Engine**: Semantic searches via `vectra` perform significantly faster than parallel entry indexing (>190x faster locally).
534
- - **Core MCP Routines**: Complex operations exhibit negligible latency when executed through standard MCP tools. Calling tools natively adds ~1.4x overhead compared to direct function execution.
545
+ - **Database Reads**: Operations execute in fractions of a millisecond. `calculateImportance` is ~42x faster than retrieving 50 recent entries.
546
+ - **Vector Search Engine**: Semantic searches via `vectra` perform significantly faster than parallel entry indexing (>131x faster locally).
547
+ - **Core MCP Routines**: Tool dispatch via `callTool` uses cached O(1) lookup. `create_entry` and `search_entries` execute at >730 ops/sec through the MCP layer.
535
548
 
536
549
  To run the benchmarking suite locally:
537
550
 
@@ -539,13 +552,28 @@ To run the benchmarking suite locally:
539
552
  npm run bench
540
553
  ```
541
554
 
555
+ ### Testing
556
+
557
+ **777 tests** across two test frameworks:
558
+
559
+ | Suite | Tests | Command | Covers |
560
+ | ------------------------- | ----- | ------------------ | --------------------------------------------------------------------- |
561
+ | Vitest (unit/integration) | 730 | `npm test` | Database, tools, resources, handlers, security, GitHub, vector search |
562
+ | Playwright (e2e) | 47 | `npm run test:e2e` | HTTP/SSE transport, auth, sessions, CORS, security headers, scheduler |
563
+
564
+ ```bash
565
+ npm test # Unit + integration tests
566
+ npm run test:e2e # End-to-end HTTP/SSE transport tests
567
+ ```
568
+
542
569
  ### Security
543
570
 
571
+ - **Deterministic error handling** - Every tool returns structured `{success, error}` responses with actionable context β€” no raw exceptions, no silent failures, no misleading messages
544
572
  - **Local-first** - All data stored locally, no external API calls (except optional GitHub)
545
573
  - **Input validation** - Zod schemas, content size limits, SQL injection prevention
546
574
  - **Path traversal protection** - Backup filenames validated
547
575
  - **MCP 2025-11-25 annotations** - Behavioral hints (`readOnlyHint`, `destructiveHint`, etc.)
548
- - **HTTP transport hardening** - Configurable CORS, 1MB body limit, security headers, 30-min session timeout
576
+ - **HTTP transport hardening** - 6 security headers (`X-Content-Type-Options`, `X-Frame-Options`, `CSP`, `Cache-Control`, `Referrer-Policy`, `Permissions-Policy`), configurable CORS, 1MB body limit, rate limiting (100 req/min), 30-min session timeout, 404 handler, cross-protocol guard
549
577
  - **Token scrubbing** - GitHub tokens and credentials automatically redacted from error logs
550
578
 
551
579
  ### Data & Privacy