memory-journal-mcp 4.5.0 → 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 (256) hide show
  1. package/.github/workflows/codeql.yml +1 -6
  2. package/.github/workflows/docker-publish.yml +15 -49
  3. package/.github/workflows/secrets-scanning.yml +4 -3
  4. package/.github/workflows/security-update.yml +2 -2
  5. package/CHANGELOG.md +135 -2
  6. package/CONTRIBUTING.md +132 -97
  7. package/DOCKER_README.md +152 -253
  8. package/Dockerfile +11 -8
  9. package/README.md +172 -203
  10. package/dist/cli.js +6 -1
  11. package/dist/cli.js.map +1 -1
  12. package/dist/constants/ServerInstructions.d.ts.map +1 -1
  13. package/dist/constants/ServerInstructions.js +38 -32
  14. package/dist/constants/ServerInstructions.js.map +1 -1
  15. package/dist/constants/icons.d.ts +2 -2
  16. package/dist/constants/icons.d.ts.map +1 -1
  17. package/dist/constants/icons.js +7 -6
  18. package/dist/constants/icons.js.map +1 -1
  19. package/dist/database/SqliteAdapter.d.ts +35 -23
  20. package/dist/database/SqliteAdapter.d.ts.map +1 -1
  21. package/dist/database/SqliteAdapter.js +304 -149
  22. package/dist/database/SqliteAdapter.js.map +1 -1
  23. package/dist/database/schema.d.ts +45 -0
  24. package/dist/database/schema.d.ts.map +1 -0
  25. package/dist/database/schema.js +92 -0
  26. package/dist/database/schema.js.map +1 -0
  27. package/dist/filtering/ToolFilter.d.ts +1 -1
  28. package/dist/filtering/ToolFilter.d.ts.map +1 -1
  29. package/dist/filtering/ToolFilter.js +13 -2
  30. package/dist/filtering/ToolFilter.js.map +1 -1
  31. package/dist/github/GitHubIntegration.d.ts.map +1 -1
  32. package/dist/github/GitHubIntegration.js +1 -3
  33. package/dist/github/GitHubIntegration.js.map +1 -1
  34. package/dist/handlers/prompts/github.d.ts +12 -0
  35. package/dist/handlers/prompts/github.d.ts.map +1 -0
  36. package/dist/handlers/prompts/github.js +178 -0
  37. package/dist/handlers/prompts/github.js.map +1 -0
  38. package/dist/handlers/prompts/index.d.ts +23 -2
  39. package/dist/handlers/prompts/index.d.ts.map +1 -1
  40. package/dist/handlers/prompts/index.js +7 -432
  41. package/dist/handlers/prompts/index.js.map +1 -1
  42. package/dist/handlers/prompts/workflow.d.ts +12 -0
  43. package/dist/handlers/prompts/workflow.d.ts.map +1 -0
  44. package/dist/handlers/prompts/workflow.js +277 -0
  45. package/dist/handlers/prompts/workflow.js.map +1 -0
  46. package/dist/handlers/resources/core.d.ts +11 -0
  47. package/dist/handlers/resources/core.d.ts.map +1 -0
  48. package/dist/handlers/resources/core.js +433 -0
  49. package/dist/handlers/resources/core.js.map +1 -0
  50. package/dist/handlers/resources/github.d.ts +11 -0
  51. package/dist/handlers/resources/github.d.ts.map +1 -0
  52. package/dist/handlers/resources/github.js +314 -0
  53. package/dist/handlers/resources/github.js.map +1 -0
  54. package/dist/handlers/resources/graph.d.ts +11 -0
  55. package/dist/handlers/resources/graph.d.ts.map +1 -0
  56. package/dist/handlers/resources/graph.js +204 -0
  57. package/dist/handlers/resources/graph.js.map +1 -0
  58. package/dist/handlers/resources/index.d.ts +4 -21
  59. package/dist/handlers/resources/index.d.ts.map +1 -1
  60. package/dist/handlers/resources/index.js +16 -1281
  61. package/dist/handlers/resources/index.js.map +1 -1
  62. package/dist/handlers/resources/shared.d.ts +60 -0
  63. package/dist/handlers/resources/shared.d.ts.map +1 -0
  64. package/dist/handlers/resources/shared.js +49 -0
  65. package/dist/handlers/resources/shared.js.map +1 -0
  66. package/dist/handlers/resources/team.d.ts +13 -0
  67. package/dist/handlers/resources/team.d.ts.map +1 -0
  68. package/dist/handlers/resources/team.js +119 -0
  69. package/dist/handlers/resources/team.js.map +1 -0
  70. package/dist/handlers/resources/templates.d.ts +13 -0
  71. package/dist/handlers/resources/templates.d.ts.map +1 -0
  72. package/dist/handlers/resources/templates.js +310 -0
  73. package/dist/handlers/resources/templates.js.map +1 -0
  74. package/dist/handlers/tools/admin.d.ts +8 -0
  75. package/dist/handlers/tools/admin.d.ts.map +1 -0
  76. package/dist/handlers/tools/admin.js +270 -0
  77. package/dist/handlers/tools/admin.js.map +1 -0
  78. package/dist/handlers/tools/analytics.d.ts +8 -0
  79. package/dist/handlers/tools/analytics.d.ts.map +1 -0
  80. package/dist/handlers/tools/analytics.js +256 -0
  81. package/dist/handlers/tools/analytics.js.map +1 -0
  82. package/dist/handlers/tools/backup.d.ts +8 -0
  83. package/dist/handlers/tools/backup.d.ts.map +1 -0
  84. package/dist/handlers/tools/backup.js +224 -0
  85. package/dist/handlers/tools/backup.js.map +1 -0
  86. package/dist/handlers/tools/core.d.ts +9 -0
  87. package/dist/handlers/tools/core.d.ts.map +1 -0
  88. package/dist/handlers/tools/core.js +326 -0
  89. package/dist/handlers/tools/core.js.map +1 -0
  90. package/dist/handlers/tools/export.d.ts +8 -0
  91. package/dist/handlers/tools/export.d.ts.map +1 -0
  92. package/dist/handlers/tools/export.js +89 -0
  93. package/dist/handlers/tools/export.js.map +1 -0
  94. package/dist/handlers/tools/github/helpers.d.ts +34 -0
  95. package/dist/handlers/tools/github/helpers.d.ts.map +1 -0
  96. package/dist/handlers/tools/github/helpers.js +52 -0
  97. package/dist/handlers/tools/github/helpers.js.map +1 -0
  98. package/dist/handlers/tools/github/insights-tools.d.ts +8 -0
  99. package/dist/handlers/tools/github/insights-tools.d.ts.map +1 -0
  100. package/dist/handlers/tools/github/insights-tools.js +104 -0
  101. package/dist/handlers/tools/github/insights-tools.js.map +1 -0
  102. package/dist/handlers/tools/github/issue-tools.d.ts +8 -0
  103. package/dist/handlers/tools/github/issue-tools.d.ts.map +1 -0
  104. package/dist/handlers/tools/github/issue-tools.js +359 -0
  105. package/dist/handlers/tools/github/issue-tools.js.map +1 -0
  106. package/dist/handlers/tools/github/kanban-tools.d.ts +8 -0
  107. package/dist/handlers/tools/github/kanban-tools.d.ts.map +1 -0
  108. package/dist/handlers/tools/github/kanban-tools.js +108 -0
  109. package/dist/handlers/tools/github/kanban-tools.js.map +1 -0
  110. package/dist/handlers/tools/github/milestone-tools.d.ts +9 -0
  111. package/dist/handlers/tools/github/milestone-tools.d.ts.map +1 -0
  112. package/dist/handlers/tools/github/milestone-tools.js +302 -0
  113. package/dist/handlers/tools/github/milestone-tools.js.map +1 -0
  114. package/dist/handlers/tools/github/mutation-tools.d.ts +12 -0
  115. package/dist/handlers/tools/github/mutation-tools.d.ts.map +1 -0
  116. package/dist/handlers/tools/github/mutation-tools.js +15 -0
  117. package/dist/handlers/tools/github/mutation-tools.js.map +1 -0
  118. package/dist/handlers/tools/github/read-tools.d.ts +8 -0
  119. package/dist/handlers/tools/github/read-tools.d.ts.map +1 -0
  120. package/dist/handlers/tools/github/read-tools.js +260 -0
  121. package/dist/handlers/tools/github/read-tools.js.map +1 -0
  122. package/dist/handlers/tools/github/schemas.d.ts +467 -0
  123. package/dist/handlers/tools/github/schemas.d.ts.map +1 -0
  124. package/dist/handlers/tools/github/schemas.js +335 -0
  125. package/dist/handlers/tools/github/schemas.js.map +1 -0
  126. package/dist/handlers/tools/github.d.ts +14 -0
  127. package/dist/handlers/tools/github.d.ts.map +1 -0
  128. package/dist/handlers/tools/github.js +28 -0
  129. package/dist/handlers/tools/github.js.map +1 -0
  130. package/dist/handlers/tools/index.d.ts +15 -20
  131. package/dist/handlers/tools/index.d.ts.map +1 -1
  132. package/dist/handlers/tools/index.js +117 -2956
  133. package/dist/handlers/tools/index.js.map +1 -1
  134. package/dist/handlers/tools/relationships.d.ts +8 -0
  135. package/dist/handlers/tools/relationships.d.ts.map +1 -0
  136. package/dist/handlers/tools/relationships.js +308 -0
  137. package/dist/handlers/tools/relationships.js.map +1 -0
  138. package/dist/handlers/tools/schemas.d.ts +108 -0
  139. package/dist/handlers/tools/schemas.d.ts.map +1 -0
  140. package/dist/handlers/tools/schemas.js +122 -0
  141. package/dist/handlers/tools/schemas.js.map +1 -0
  142. package/dist/handlers/tools/search.d.ts +8 -0
  143. package/dist/handlers/tools/search.d.ts.map +1 -0
  144. package/dist/handlers/tools/search.js +282 -0
  145. package/dist/handlers/tools/search.js.map +1 -0
  146. package/dist/handlers/tools/team.d.ts +11 -0
  147. package/dist/handlers/tools/team.d.ts.map +1 -0
  148. package/dist/handlers/tools/team.js +239 -0
  149. package/dist/handlers/tools/team.js.map +1 -0
  150. package/dist/server/McpServer.d.ts +2 -0
  151. package/dist/server/McpServer.d.ts.map +1 -1
  152. package/dist/server/McpServer.js +33 -323
  153. package/dist/server/McpServer.js.map +1 -1
  154. package/dist/transports/http.d.ts +66 -0
  155. package/dist/transports/http.d.ts.map +1 -0
  156. package/dist/transports/http.js +519 -0
  157. package/dist/transports/http.js.map +1 -0
  158. package/dist/types/entities.d.ts +101 -0
  159. package/dist/types/entities.d.ts.map +1 -0
  160. package/dist/types/entities.js +5 -0
  161. package/dist/types/entities.js.map +1 -0
  162. package/dist/types/filtering.d.ts +34 -0
  163. package/dist/types/filtering.d.ts.map +1 -0
  164. package/dist/types/filtering.js +5 -0
  165. package/dist/types/filtering.js.map +1 -0
  166. package/dist/types/github.d.ts +166 -0
  167. package/dist/types/github.d.ts.map +1 -0
  168. package/dist/types/github.js +5 -0
  169. package/dist/types/github.js.map +1 -0
  170. package/dist/types/index.d.ts +35 -292
  171. package/dist/types/index.d.ts.map +1 -1
  172. package/dist/types/index.js +2 -2
  173. package/dist/types/index.js.map +1 -1
  174. package/dist/utils/error-helpers.d.ts +37 -0
  175. package/dist/utils/error-helpers.d.ts.map +1 -0
  176. package/dist/utils/error-helpers.js +47 -0
  177. package/dist/utils/error-helpers.js.map +1 -0
  178. package/dist/vector/VectorSearchManager.d.ts.map +1 -1
  179. package/dist/vector/VectorSearchManager.js +9 -32
  180. package/dist/vector/VectorSearchManager.js.map +1 -1
  181. package/docker-compose.yml +11 -2
  182. package/mcp-config-example.json +1 -0
  183. package/package.json +6 -4
  184. package/playwright.config.ts +29 -0
  185. package/releases/v5.0.0.md +105 -0
  186. package/src/cli.ts +19 -1
  187. package/src/constants/ServerInstructions.ts +38 -32
  188. package/src/constants/icons.ts +8 -7
  189. package/src/constants/server-instructions.md +38 -32
  190. package/src/database/SqliteAdapter.ts +336 -184
  191. package/src/database/schema.ts +125 -0
  192. package/src/filtering/ToolFilter.ts +13 -2
  193. package/src/github/GitHubIntegration.ts +1 -3
  194. package/src/handlers/prompts/github.ts +209 -0
  195. package/src/handlers/prompts/index.ts +10 -499
  196. package/src/handlers/prompts/workflow.ts +314 -0
  197. package/src/handlers/resources/core.ts +528 -0
  198. package/src/handlers/resources/github.ts +358 -0
  199. package/src/handlers/resources/graph.ts +254 -0
  200. package/src/handlers/resources/index.ts +21 -1574
  201. package/src/handlers/resources/shared.ts +103 -0
  202. package/src/handlers/resources/team.ts +133 -0
  203. package/src/handlers/resources/templates.ts +374 -0
  204. package/src/handlers/tools/admin.ts +285 -0
  205. package/src/handlers/tools/analytics.ts +301 -0
  206. package/src/handlers/tools/backup.ts +242 -0
  207. package/src/handlers/tools/core.ts +350 -0
  208. package/src/handlers/tools/export.ts +115 -0
  209. package/src/handlers/tools/github/helpers.ts +86 -0
  210. package/src/handlers/tools/github/insights-tools.ts +119 -0
  211. package/src/handlers/tools/github/issue-tools.ts +439 -0
  212. package/src/handlers/tools/github/kanban-tools.ts +134 -0
  213. package/src/handlers/tools/github/milestone-tools.ts +392 -0
  214. package/src/handlers/tools/github/mutation-tools.ts +17 -0
  215. package/src/handlers/tools/github/read-tools.ts +328 -0
  216. package/src/handlers/tools/github/schemas.ts +369 -0
  217. package/src/handlers/tools/github.ts +36 -0
  218. package/src/handlers/tools/index.ts +144 -3375
  219. package/src/handlers/tools/relationships.ts +358 -0
  220. package/src/handlers/tools/schemas.ts +132 -0
  221. package/src/handlers/tools/search.ts +343 -0
  222. package/src/handlers/tools/team.ts +273 -0
  223. package/src/server/McpServer.ts +40 -393
  224. package/src/transports/http.ts +635 -0
  225. package/src/types/entities.ts +145 -0
  226. package/src/types/filtering.ts +54 -0
  227. package/src/types/github.ts +180 -0
  228. package/src/types/index.ts +67 -375
  229. package/src/utils/error-helpers.ts +52 -0
  230. package/src/vector/VectorSearchManager.ts +9 -33
  231. package/tests/constants/icons.test.ts +1 -2
  232. package/tests/constants/server-instructions.test.ts +4 -4
  233. package/tests/database/sqlite-adapter.test.ts +7 -7
  234. package/tests/e2e/auth.spec.ts +154 -0
  235. package/tests/e2e/health.spec.ts +63 -0
  236. package/tests/e2e/protocols.spec.ts +134 -0
  237. package/tests/e2e/resources.spec.ts +103 -0
  238. package/tests/e2e/scheduler.spec.ts +79 -0
  239. package/tests/e2e/security.spec.ts +91 -0
  240. package/tests/e2e/sessions.spec.ts +95 -0
  241. package/tests/e2e/stateless.spec.ts +121 -0
  242. package/tests/e2e/tools.spec.ts +111 -0
  243. package/tests/handlers/error-path-coverage.test.ts +324 -0
  244. package/tests/handlers/prompt-handler-coverage.test.ts +106 -0
  245. package/tests/handlers/resource-handler-coverage.test.ts +181 -0
  246. package/tests/handlers/resource-handlers.test.ts +1 -9
  247. package/tests/handlers/search-tool-handlers.test.ts +272 -0
  248. package/tests/handlers/targeted-gap-closure.test.ts +387 -0
  249. package/tests/handlers/team-resource-handlers.test.ts +156 -0
  250. package/tests/handlers/team-tool-handlers.test.ts +301 -0
  251. package/tests/handlers/tool-handler-coverage.test.ts +469 -0
  252. package/tests/handlers/tool-handlers.test.ts +0 -11
  253. package/tests/server/mcp-server.test.ts +12 -3
  254. package/tests/transports/http-transport.test.ts +620 -0
  255. package/vitest.config.ts +4 -1
  256. package/.memory-journal-team.db +0 -0
@@ -8,9 +8,6 @@ on:
8
8
  schedule:
9
9
  - cron: '23 2 * * 1'
10
10
 
11
- env:
12
- CODEQL_ACTION_FEATURE_SANDWICH: false
13
-
14
11
  jobs:
15
12
  analyze:
16
13
  name: Analyze
@@ -23,7 +20,7 @@ jobs:
23
20
  strategy:
24
21
  fail-fast: false
25
22
  matrix:
26
- language: ['javascript-typescript']
23
+ language: ['javascript-typescript', 'actions']
27
24
 
28
25
  steps:
29
26
  - name: Checkout repository
@@ -33,7 +30,6 @@ jobs:
33
30
  uses: github/codeql-action/init@v4
34
31
  with:
35
32
  languages: ${{ matrix.language }}
36
- db-location: ${{ runner.temp }}/codeql_databases
37
33
 
38
34
  - name: Autobuild
39
35
  uses: github/codeql-action/autobuild@v4
@@ -42,4 +38,3 @@ jobs:
42
38
  uses: github/codeql-action/analyze@v4
43
39
  with:
44
40
  upload: always
45
- wait-for-processing: false
@@ -50,56 +50,22 @@ jobs:
50
50
  cache-from: type=gha,scope=linux/amd64
51
51
  cache-to: type=gha,scope=linux/amd64,mode=max
52
52
 
53
+ - name: Log in to Docker Hub (for Scout)
54
+ uses: docker/login-action@v3
55
+ with:
56
+ registry: ${{ env.REGISTRY }}
57
+ username: ${{ secrets.DOCKER_USERNAME }}
58
+ password: ${{ secrets.DOCKER_PASSWORD }}
59
+
53
60
  - name: Docker Scout security scan
61
+ uses: docker/scout-action@v1.18.2
54
62
  timeout-minutes: 10
55
- env:
56
- DOCKER_SCOUT_HUB_USER: ${{ secrets.DOCKER_USERNAME }}
57
- DOCKER_SCOUT_HUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
58
- run: |
59
- curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s --
60
- docker images local-scan:latest
61
- echo "🔍 Running Docker Scout security scan for local-scan:latest"
62
-
63
- # Define CVEs to ignore (upstream issues with NO fix available)
64
- # CVE-2026-22184: Alpine zlib - no fix version released yet
65
- # CVE-2025-60876: Alpine busybox wget - patch not in release yet
66
- IGNORE_CVES="CVE-2026-22184|CVE-2025-60876"
67
-
68
- echo "⏱️ Running Docker Scout scan for FIXABLE vulnerabilities..."
69
-
70
- # Use --only-fixed to find CVEs that HAVE fixes available
71
- # This ensures we block on things we CAN fix while allowing unfixable upstream CVEs
72
- if timeout 480 docker scout cves local-scan:latest --only-fixed --only-severity critical,high > scout_fixable.txt 2>&1; then
73
- echo "📊 Scan completed"
74
-
75
- # Check if any fixable critical/high CVEs were found
76
- if grep -qE "(CRITICAL|HIGH)" scout_fixable.txt 2>/dev/null; then
77
- echo "❌ Fixable CRITICAL/HIGH CVEs detected - blocking deploy"
78
- cat scout_fixable.txt
79
- echo ""
80
- echo "🚨 Deploy blocked: These vulnerabilities have available fixes."
81
- echo " Update dependencies or Dockerfile to resolve."
82
- exit 1
83
- else
84
- echo "✅ No fixable critical/high CVEs found"
85
- fi
86
- else
87
- exit_code=$?
88
- if [ $exit_code -eq 2 ]; then
89
- # Exit code 2 means vulnerabilities found
90
- echo "❌ Fixable CVEs detected by Docker Scout"
91
- cat scout_fixable.txt
92
- exit 1
93
- elif [ $exit_code -eq 124 ]; then
94
- echo "⚠️ Docker Scout scan timed out"
95
- echo "🔄 Continuing build - scan timeout is not a security failure"
96
- else
97
- echo "⚠️ Docker Scout scan failed with exit code $exit_code"
98
- echo "🔄 Continuing build - will rely on Trivy for security validation"
99
- fi
100
- fi
101
-
102
- echo "✅ Security gate passed - images will now be built and pushed"
63
+ with:
64
+ command: cves
65
+ image: local-scan:latest
66
+ only-fixed: true
67
+ only-severities: critical,high
68
+ exit-code: true
103
69
 
104
70
  # Build each platform on native architecture (only runs if security scan passes)
105
71
  build-platform:
@@ -271,7 +237,7 @@ jobs:
271
237
  password: ${{ secrets.DOCKER_PASSWORD }}
272
238
  repository: ${{ env.IMAGE_NAME }}
273
239
  readme-filepath: ./DOCKER_README.md
274
- short-description: 'AI Project Memory- Triple Search, Knowledge Graphs, GitHub Integration, HTTP/SSE & Tool Filtering.'
240
+ short-description: 'MCP server Persistent AI project memory with GitHub integration, knowledge graphs & search.'
275
241
 
276
242
  - name: Deployment Summary
277
243
  if: github.ref == 'refs/heads/main'
@@ -19,7 +19,7 @@ jobs:
19
19
  fetch-depth: 0
20
20
 
21
21
  - name: TruffleHog Secret Scanning
22
- uses: trufflesecurity/trufflehog@main
22
+ uses: trufflesecurity/trufflehog@v3.93.7
23
23
  with:
24
24
  path: ./
25
25
  base: ${{ github.event.before || 'HEAD~1' }}
@@ -27,5 +27,6 @@ jobs:
27
27
  extra_args: --only-verified
28
28
 
29
29
  - name: GITLEAKS Secret Scanning
30
- uses: gitleaks/gitleaks-action@v2
31
- continue-on-error: true
30
+ uses: gitleaks/gitleaks-action@v2.3.9
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -48,7 +48,7 @@ jobs:
48
48
 
49
49
  # Run SARIF scan first (non-blocking) to always generate the file
50
50
  - name: Run Trivy scanner for SARIF output
51
- uses: aquasecurity/trivy-action@0.34.0
51
+ uses: aquasecurity/trivy-action@0.34.1
52
52
  with:
53
53
  image-ref: security-test:latest
54
54
  format: 'sarif'
@@ -67,7 +67,7 @@ jobs:
67
67
 
68
68
  # Run table scan (blocking) after SARIF is uploaded
69
69
  - name: Run Trivy vulnerability scanner
70
- uses: aquasecurity/trivy-action@0.34.0
70
+ uses: aquasecurity/trivy-action@0.34.1
71
71
  with:
72
72
  image-ref: security-test:latest
73
73
  format: 'table'
package/CHANGELOG.md CHANGED
@@ -5,6 +5,139 @@ All notable changes to Memory Journal MCP will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [5.0.0] - 2026-03-06
11
+
12
+ ### Added
13
+
14
+ - **Playwright E2E Test Suite** — 8 spec files testing HTTP/SSE transport layer end-to-end with Playwright:
15
+ - `health.spec.ts` — Health endpoint, root info, MCP initialization
16
+ - `protocols.spec.ts` — Streamable HTTP and Legacy SSE protocol error handling
17
+ - `security.spec.ts` — Security headers (6), CORS, HSTS, body size limits, 404 handler
18
+ - `auth.spec.ts` — Bearer token authentication enforcement (separate server with `--auth-token`)
19
+ - `sessions.spec.ts` — Session lifecycle: init → use → terminate → reject stale
20
+ - `tools.spec.ts` — MCP SDK client tool execution via Streamable HTTP (`test_simple`, `create_entry_minimal`, validation errors)
21
+ - `resources.spec.ts` — MCP SDK client resource reads via Streamable HTTP (`memory://health`, `memory://briefing`, etc.)
22
+ - `stateless.spec.ts` — Stateless mode: SSE disabled (405), DELETE no-op (204), no legacy SSE
23
+ - `scheduler.spec.ts` — Scheduler activation verification via `memory://health` resource
24
+ - New `test:e2e` npm script (`playwright test`)
25
+ - New devDependency: `@playwright/test`
26
+
27
+ ### Fixed
28
+
29
+ - **Legacy SSE transport `start()` redundancy** — `setupLegacySSE` called `sseTransport.start()` after `server.connect()` which already auto-calls `start()`, causing "SSEServerTransport already started!" errors and preventing SDK clients from using Legacy SSE
30
+
31
+ - **Legacy SSE Transport** — HTTP transport now supports both Streamable HTTP (MCP 2025-03-26) and Legacy SSE (MCP 2024-11-05) protocols simultaneously (stateful mode only)
32
+ - `GET /sse` — Opens Legacy SSE connection for backward-compatible clients
33
+ - `POST /messages?sessionId=<id>` — Routes messages to Legacy SSE transport
34
+ - Cross-protocol guard: SSE session IDs rejected on `/mcp` and vice versa
35
+ - **Health Endpoint** — `GET /health` returns `{ status: "healthy", timestamp }` for monitoring and load balancer probes
36
+ - **Root Info Endpoint** — `GET /` returns server name, version, description, all available endpoints, and documentation link
37
+ - **404 Handler** — Unknown paths now return `404 { error: "Not found" }` instead of Express default HTML
38
+ - **`DB_PATH` Environment Variable** — CLI `--db` flag now accepts `DB_PATH` as a fallback (precedence: CLI flag > `DB_PATH` env > `./memory_journal.db`). Enables database path configuration via MCP client env blocks without needing CLI args.
39
+ - **Team Collaboration (Redesign)** — Rebuilt team collaboration from scratch with proper architecture:
40
+ - **Separate team database** — `TEAM_DB_PATH` env var / `--team-db` CLI flag for a public, git-tracked `.db` file
41
+ - **Author attribution** — Auto-detected from `TEAM_AUTHOR` env or `git config user.name`
42
+ - **3 dedicated tools** — `team_create_entry`, `team_get_recent`, `team_search` (new `team` tool group)
43
+ - **`share_with_team`** — Optional parameter on `create_entry` to copy entries to team DB
44
+ - **Cross-database search** — `search_entries` and `search_by_date_range` auto-merge team results with `source` marker
45
+ - **2 team resources** — `memory://team/recent` (author-enriched entries), `memory://team/statistics` (author breakdown)
46
+ - **Briefing integration** — `memory://briefing` shows team entry count when team DB configured
47
+ - **Health integration** — `memory://health` includes team database status block
48
+ - **Server instructions** — Team collaboration section + team tool reference at standard+ level
49
+ - **`ICON_TEAM`** — Users group SVG icon for team tools
50
+ - Tool count: 39 → 42, tool groups: 8 → 9, resources: 20 → 22
51
+
52
+ ### Removed
53
+
54
+ - **Legacy Team Collaboration System** — Removed non-functional team collaboration feature (remnant of Python-era architecture), then rebuilt from scratch (see Added > Team Collaboration)
55
+ - Removed old `share_with_team` parameter, `memory://team/recent` resource, and `ICON_TEAM` constant
56
+ - Deleted unused `.memory-journal-team.db` file
57
+ - Database files reorganized into `data/` directory
58
+ - **Database Files Reorganized** — Moved `memory_journal.db` and `backups/` into `data/` directory for cleaner project structure
59
+ - **Tool Handler Modularized** — Replaced 3,428-line monolith `src/handlers/tools/index.ts` with 12 focused modules + barrel file (~140 lines):
60
+ - `core.ts` (6), `search.ts` (4), `analytics.ts` (2), `relationships.ts` (2), `export.ts` (1), `admin.ts` (5), `backup.ts` (4)
61
+ - `github/` sub-directory: `read-tools.ts` (5), `mutation-tools.ts` (4), `milestone-tools.ts` (5), `insights-tools.ts` (1), `schemas.ts`
62
+ - Shared Zod output schemas extracted to `schemas.ts` and `github/schemas.ts`
63
+ - Public API (`getTools`, `callTool`) unchanged — zero breaking changes for `McpServer.ts`
64
+ - **Types Modularized** — Split `types/index.ts` (652 lines) into `types/filtering.ts`, `types/entities.ts`, `types/github.ts` with barrel re-exports
65
+ - **Database Schema Extracted** — Extracted SQL DDL + `CreateEntryInput` from `SqliteAdapter.ts` into `database/schema.ts`
66
+ - **Resource Handlers Modularized** — Split `resources/index.ts` (1,692 lines) into 5 sub-modules + barrel (~120 lines):
67
+ - `shared.ts` (types/helpers), `core.ts` (8 resources), `graph.ts` (3), `github.ts` (4), `templates.ts` (6)
68
+ - **Prompt Handlers Modularized** — Split `prompts/index.ts` (587 lines) into `workflow.ts` (9 prompts), `github.ts` (6 prompts) + barrel (~95 lines)
69
+ - **Mutation Tools Modularized** — Split `mutation-tools.ts` (660 lines) into `helpers.ts`, `kanban-tools.ts` (2 tools), `issue-tools.ts` (2 tools) + barrel
70
+ - **Deterministic Error Handling** — All 42 tool handlers wrapped with `try/catch` + `formatHandlerError()` returning `{ success: false, error }` instead of throwing raw MCP errors. Matches the error handling standard from mysql-mcp.
71
+ - New utility: `src/utils/error-helpers.ts` — `formatHandlerError()`, `formatZodError()`
72
+ - `ToolDefinition.handler` return type changed from `Promise<unknown>` to `unknown` (supports both sync and async handlers)
73
+ - GitHub `resolveOwnerRepo()` helpers now return validated `github` instance, eliminating all non-null assertions
74
+ - **`Permissions-Policy` Header** — Added `Permissions-Policy: camera=(), microphone=(), geolocation=()` to security headers (6 headers total)
75
+ - **`--auth-token` CLI Option** — New `--auth-token <token>` CLI flag and `MCP_AUTH_TOKEN` environment variable for optional bearer token authentication on the HTTP transport. When configured, all endpoints except `GET /health` require `Authorization: Bearer <token>`. Backward compatible — no auth required when not set.
76
+
77
+ ### Security
78
+
79
+ - **Trigger Name Validation in `migrateSchema()` (H-1)** — Added `SAFE_IDENTIFIER_RE` regex check (`/^[a-zA-Z_][a-zA-Z0-9_]*$/`) before interpolating trigger names into DDL during legacy FTS5 trigger cleanup. Prevents potential SQL injection if a legacy database contains a crafted trigger name. Unsafe names are now logged and skipped.
80
+ - **Query Limit Caps (M-4)** — All `limit` parameters across tool handlers now enforce `.max(500)` via Zod schema validation, preventing unbounded memory-loading queries. Applied to 10 schemas across `core.ts`, `search.ts`, `team.ts`, `relationships.ts`, and `export.ts`.
81
+ - **TruffleHog Pinned to Release Tag (M-2)** — `trufflesecurity/trufflehog@main` → `@v3.93.7` in `secrets-scanning.yml` to eliminate supply-chain risk from floating `@main` tag.
82
+ - **Docker Scout Official Action (M-3)** — Replaced `curl | sh` Docker Scout CLI installer with `docker/scout-action@v1.18.2` in `docker-publish.yml`, eliminating supply-chain risk from executing arbitrary remote scripts in CI with elevated permissions.
83
+ - **Gitleaks Blocking on Failure (L-4)** — Removed `continue-on-error: true` from Gitleaks step in `secrets-scanning.yml` so detected secret leaks now fail the workflow.
84
+ - **HTTP Bearer Token Authentication (F-1)** — Optional bearer token middleware for HTTP transport. Logs a warning when HTTP mode starts without authentication configured.
85
+ - **Gitleaks Pinned to Release Tag (F-3)** — `gitleaks/gitleaks-action@v2` → `@v2.3.9` in `secrets-scanning.yml` to eliminate supply-chain risk from floating major version tag.
86
+ - **SSE Session Timeout Sweep (F-4)** — Legacy SSE sessions are now tracked in `sessionLastActivity` and expired by the 30-minute idle sweep, matching the behavior of Streamable HTTP sessions. Previously SSE sessions were only cleaned up on client disconnect.
87
+ - **`searchByDateRange` Query Limit (F-6)** — Added `LIMIT` clause (default: 500, max: 500) to `searchByDateRange` SQL query to prevent unbounded result sets from broad date ranges. New `limit` parameter on `search_by_date_range` tool.
88
+ - **Docker Production-Only Dependencies (I-2)** — Production image now runs `npm ci --omit=dev` instead of copying the full builder `node_modules`. Removes devDependencies (vitest, eslint, typescript, etc.) from the production image, reducing attack surface.
89
+ - **CORS `Authorization` Header** — Added `Authorization` to `Access-Control-Allow-Headers` for bearer token authentication support.
90
+ - **Timing-Safe Auth Token Comparison (L-1)** — Replaced string `!==` comparison with `crypto.timingSafeEqual()` for bearer token authentication, eliminating a timing side-channel that could theoretically leak token contents character-by-character.
91
+ - **HSTS Header for Reverse Proxy (L-2)** — Added conditional `Strict-Transport-Security: max-age=31536000; includeSubDomains` header when `X-Forwarded-Proto: https` is detected, preventing downgrade attacks in TLS-terminating reverse proxy deployments.
92
+ - **Docker Compose Auth Token (L-3)** — Added commented `MCP_AUTH_TOKEN` environment variable to the HTTP service in `docker-compose.yml`, making authentication configuration discoverable for production deployments.
93
+ - **Shell-Free Git Author Detection (I-1)** — Replaced `execSync('git config user.name')` with `execFileSync('git', ['config', 'user.name'])` in `core.ts` and `team.ts` to avoid implicit shell invocation, reducing the surface for potential command injection if the call site were ever modified.
94
+ - **Docker Compose Read-Only Filesystem** — Added `read_only: true` and `tmpfs: /tmp:noexec,nosuid,nodev` to both Docker Compose services. Limits container write surface to the `/app/data` volume and `/tmp` tmpfs, preventing filesystem-based persistence attacks.
95
+ - **Docker Compose Generic Token Placeholder** — Replaced `ghp_your_token_here` placeholder with `<your-github-token>` to avoid false positive noise in secret scanners.
96
+ - **Docker Compose Explicit `NODE_ENV`** — Added `NODE_ENV=production` to the HTTP service environment block for visibility and to prevent accidental override.
97
+ - **CVE-2026-27171 (zlib)** — Explicitly install zlib from Alpine edge in Dockerfile builder and production stages to fix MEDIUM severity denial of service via infinite loop in CRC32 combine functions.
98
+ - **Gitleaks `GITHUB_TOKEN`** — Pass `GITHUB_TOKEN` to `gitleaks/gitleaks-action@v2.3.9` in `secrets-scanning.yml` as now required for PR scanning.
99
+
100
+ ### Improved
101
+
102
+ - **Batch Tag Fetching (N+1 Elimination)** — Multi-row methods (`getRecentEntries`, `getEntriesPage`, `searchEntries`, `searchByDateRange`) now batch-fetch tags in a single `IN (...)` query via `batchGetTagsForEntries()` + `rowsToEntries()`, eliminating the N+1 per-row `getTagsForEntry` pattern. `getRecentEntries(50)` reduced from 51 queries to 2.
103
+ - **Batch Tag Linking** — `linkTagsToEntry()` batches tag inserts and lookups: single `INSERT OR IGNORE` for all tags, single `SELECT ... WHERE name IN (...)` for IDs, reducing from 4N to 2+2N SQL statements per entry.
104
+ - **Tool Dispatch Cache** — `callTool()` now caches tool definitions in a `Map` for O(1) lookup instead of rebuilding all 42 `ToolDefinition` objects and doing a linear scan on every call. Cache invalidates when context parameters change.
105
+ - **Conditional JOIN in `searchByDateRange`** — Tag tables (`entry_tags`, `tags`) are only JOINed when a tag filter is provided, avoiding unnecessary `DISTINCT` and row multiplication for the common no-tag-filter case.
106
+ - **Consolidated `getStatistics` Queries** — Reduced from 5 sequential `db.exec()` calls to 3 using multi-statement `exec()`: combined total+type counts, period+density via `SUM(CASE ...)`, and relationship+causal counts.
107
+ - **Simplified `rebuildIndex` Cleanup** — Removed redundant orphan detection pass that preceded a delete-all pass. Now performs a single delete-all before re-indexing.
108
+ - **Dual-Schema Validation for Structured Errors** — All tools now use a dual-schema pattern to ensure Zod validation errors produce structured `{ success: false, error }` responses instead of raw MCP `-32602` error frames. Relaxed schemas (`z.string()`) are passed to the SDK's `inputSchema` for type-level validation, while strict schemas (`z.enum()`, `z.string().regex()`) are used inside handlers via `.parse()` with `formatHandlerError()` catch. Applied across 8 tool files covering 13 enum fields and 8 date regex fields: `core.ts`, `search.ts`, `export.ts`, `analytics.ts`, `admin.ts`, `relationships.ts`, `github/read-tools.ts`, `github/milestone-tools.ts`.
109
+
110
+ ### Fixed
111
+
112
+ - **Entry Type Enum Completeness** — Added 6 missing entry types to the `EntryType` union and `ENTRY_TYPES` Zod enum: `technical_note`, `development_note`, `enhancement`, `milestone`, `system_integration_test`, `test_entry`. These types existed in the database (from prior usage) but were rejected by input validation, preventing creation of entries with these types. Updated `server-instructions.md` Entry Types section accordingly.
113
+
114
+ - **`get_github_milestones` State Filter** — Fixed `state: "all"` parameter being converted to `undefined` before passing to the GitHub REST API, causing the API to default to `"open"` and silently exclude closed milestones. The GitHub REST API natively supports `"all"` as a valid state value; the conversion was unnecessary.
115
+
116
+ - **Legacy Database Schema Migration** — Added `migrateSchema()` to `SqliteAdapter.initialize()` that checks for missing columns via `PRAGMA table_info` and adds them with `ALTER TABLE`. `CREATE TABLE IF NOT EXISTS` is a no-op on existing tables, so columns added after initial creation (e.g., `significance_type`, `auto_context`, `deleted_at`, GitHub fields) were never added to databases created before those columns existed. Also drops legacy FTS5 triggers from the Python era that cause `no such module: fts5` on INSERT/UPDATE/DELETE (sql.js WASM does not include FTS5; the TypeScript codebase uses LIKE queries).
117
+ - **`list_tags` Null Usage Count** — Fixed `list_tags` output schema validation failure (`expected number, received null`) on databases with corrupted `usage_count` values. `listTags()` query now uses `COALESCE(usage_count, 0)` and `TagOutputSchema.count` is `z.number().nullable()`. Also added data repair in `migrateSchema()` to fix null `usage_count` values in the `tags` table.
118
+ - **Output Schema Validation for Error Responses** — All tool output schemas now accept error responses (`{ success: false, error: "..." }`) from `formatHandlerError()`. Previously, schemas with required success-path fields (e.g., `entries`, `count`, `relationship`, `entry`) rejected error responses with output validation `-32602` errors. Made success-path fields optional and added `success`/`error` fields across 9 schema files: `schemas.ts`, `core.ts`, `search.ts`, `export.ts`, `analytics.ts`, `admin.ts`, `relationships.ts`, `github/schemas.ts`.
119
+ - **Multi-Session Connect Crash** — Fixed `Already connected to a transport` error when creating 2+ concurrent Streamable HTTP sessions
120
+ - SDK's `McpServer.connect()` only supports one active transport; second `connect()` threw
121
+ - Added close-before-reconnect pattern wrapping `server.connect()` in try-catch
122
+ - **Backup Tool Error Path Output Schema** — Backup tool error responses from `formatHandlerError()` (returning `{ success: false, error }`) now pass Zod output validation. Previously, `BackupResultOutputSchema`, `BackupsListOutputSchema`, `RestoreResultOutputSchema`, and `CleanupBackupsOutputSchema` required non-optional fields (`message`, `filename`, `path`, `sizeBytes`, etc.) that error responses don't include, causing raw MCP `-32602` errors on error paths like path traversal in backup names.
123
+ - **Vector Benchmark `beforeAll` Timeout** — Added `benchmark.hookTimeout: 30000` to `vitest.config.ts` to accommodate transformer model loading in benchmark `beforeAll` hooks.
124
+ - **Mermaid Arrow Inconsistency for `caused`** — Fixed `memory://graph/recent` using `-.->` (two-dot Mermaid syntax) for `caused` relationship type instead of `-.->` (single-dot), which is the canonical style used by `visualize_relationships` tool. Both now consistently use `-.->`.
125
+
126
+ ### Changed
127
+
128
+ - **HTTP Transport Modularized** — Extracted HTTP transport code from `McpServer.ts` (813 → ~450 lines) into a dedicated `src/transports/http.ts` module with `HttpTransport` class, matching the architecture of mysql-mcp, postgres-mcp, and db-mcp
129
+
130
+ - **Dependency Updates**
131
+ - `@types/node`: 25.3.3 → 25.3.5 (patch)
132
+ - `express-rate-limit`: 8.2.1 → 8.3.0 (minor)
133
+ - `sql.js`: 1.14.0 → 1.14.1 (patch)
134
+
135
+ ### CI/CD
136
+
137
+ - **CodeQL Default Setup Disabled** — Disabled GitHub's CodeQL "Default Setup" to resolve persistent "Error when processing the SARIF file" warning. Both the Default Setup and the custom `codeql.yml` workflow were uploading SARIF results for `javascript-typescript`, causing a conflict during ingestion. The custom workflow is now the sole CodeQL scanner.
138
+ - **CodeQL `actions` Language Coverage** — Added `actions` to the CodeQL workflow language matrix to replace coverage previously provided by the Default Setup. The workflow now scans both `javascript-typescript` and `actions`.
139
+ - **Trivy Action Update** — Updated `aquasecurity/trivy-action` 0.34.0 → 0.34.1 in `security-update.yml` (bundles Trivy scanner 0.69.2)
140
+
8
141
  ## [4.5.0] - 2026-03-02
9
142
 
10
143
  ### Fixed
@@ -54,7 +187,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
54
187
  - `Referrer-Policy: no-referrer` — prevents referrer leakage
55
188
  - **PRAGMA foreign_keys = ON (F-005)** — SQLite foreign key enforcement now enabled on database initialization. `ON DELETE CASCADE` constraints in `entry_tags`, `relationships`, and `embeddings` tables are now enforced at the database level.
56
189
  - **CORS Wildcard Warning (F-006)** — Server now logs a warning when HTTP transport CORS origin is `*` (the default), advising operators to set `--cors-origin` or `MCP_CORS_ORIGIN` for production deployments.
57
- - **Constrain `entry_type` / `significance_type` to Enums** — `entry_type` now validated against 13 allowed values and `significance_type` against 7 allowed values via Zod enums. Previously accepted arbitrary strings; invalid types now rejected at schema validation. Removes unsafe `as EntryType` / `as SignificanceType` casts.
190
+ - **Constrain `entry_type` / `significance_type` to Enums** — `entry_type` now validated against 19 allowed values and `significance_type` against 7 allowed values via Zod enums. Previously accepted arbitrary strings; invalid types now rejected at schema validation. Removes unsafe `as EntryType` / `as SignificanceType` casts.
58
191
  - **Date Format Validation** — All date string fields (`start_date`, `end_date`) across `SearchByDateRangeSchema`, `GetStatisticsSchema`, `ExportEntriesSchema`, and `CrossProjectInsightsSchema` now validate `YYYY-MM-DD` format via regex. Prevents malformed dates from reaching the database layer.
59
192
  - **HTTP Rate Limiting** — Added `express-rate-limit` middleware for HTTP transport (100 requests/minute per IP). Returns `429 Too Many Requests` on excess. Only applies to HTTP mode; stdio transport unaffected.
60
193
  - **Remove Dead SQL Injection Detection Code** — Removed `containsSqlInjection()`, `assertNoSqlInjection()`, `SqlInjectionError`, and `SQL_INJECTION_PATTERNS` from `security-utils.ts`. These regex-based detection functions were never called anywhere and provided a false sense of security. Parameterized queries (used consistently throughout) are the actual defense.
@@ -73,7 +206,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
73
206
  - **Updated Session Management in README.md and DOCKER_README.md** — Session Management sections now lead with the Cursor rule as the primary setup mechanism, with a three-column table showing primary (agent behavior) vs optional (audit/logging) configurations per IDE.
74
207
  - **SECURITY.md Accuracy (F-004)** — Rewrote Database Security section to accurately reflect sql.js in-memory architecture. Removed false claims about WAL mode and 7 PRAGMAs that are not applicable to sql.js. Updated security checklist to reference actual function names (`assertNoPathTraversal`, `sanitizeSearchQuery`, `validateDateFormatPattern`). Updated HTTP security headers list to include CSP, Cache-Control, and Referrer-Policy.
75
208
  - **SECURITY.md Tag Filtering Correction** — Replaced inaccurate claim that dangerous characters are blocked in tags with accurate statement that tags are safely handled via parameterized queries.
76
- - **Team Collaboration in READMEs** — Added team collaboration feature to Key Benefits in both `README.md` and `DOCKER_README.md`, with links to the wiki [Team-Collaboration](https://github.com/neverinfamous/memory-journal-mcp/wiki/Team-Collaboration) page. DOCKER_README notes that team collaboration requires npm installation.
209
+ - **Team Collaboration in READMEs** — Added team collaboration feature to Key Benefits in both `README.md` and `DOCKER_README.md`.
77
210
  - **Wiki Security Page Updates** — Added LIKE pattern sanitization, path traversal protection, HTTP security headers, rate limiting, and team database security note to the wiki Security.md page. Expanded self-audit checklist from 10 to 16 items.
78
211
  - **Rate Limiting Documentation** — Added rate limiting mention to README.md Security section.
79
212