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.
- package/.github/workflows/codeql.yml +1 -6
- package/.github/workflows/docker-publish.yml +15 -49
- package/.github/workflows/lint-and-test.yml +1 -1
- package/.github/workflows/secrets-scanning.yml +4 -3
- package/.github/workflows/security-update.yml +3 -3
- package/CHANGELOG.md +213 -0
- package/CONTRIBUTING.md +132 -97
- package/DOCKER_README.md +184 -235
- package/Dockerfile +27 -24
- package/README.md +218 -190
- package/SECURITY.md +27 -35
- package/dist/cli.js +16 -1
- package/dist/cli.js.map +1 -1
- package/dist/constants/ServerInstructions.d.ts +5 -1
- package/dist/constants/ServerInstructions.d.ts.map +1 -1
- package/dist/constants/ServerInstructions.js +133 -73
- package/dist/constants/ServerInstructions.js.map +1 -1
- package/dist/constants/icons.d.ts +2 -2
- package/dist/constants/icons.d.ts.map +1 -1
- package/dist/constants/icons.js +7 -6
- package/dist/constants/icons.js.map +1 -1
- package/dist/database/SqliteAdapter.d.ts +37 -24
- package/dist/database/SqliteAdapter.d.ts.map +1 -1
- package/dist/database/SqliteAdapter.js +319 -157
- package/dist/database/SqliteAdapter.js.map +1 -1
- package/dist/database/schema.d.ts +45 -0
- package/dist/database/schema.d.ts.map +1 -0
- package/dist/database/schema.js +92 -0
- package/dist/database/schema.js.map +1 -0
- package/dist/filtering/ToolFilter.d.ts +1 -1
- package/dist/filtering/ToolFilter.d.ts.map +1 -1
- package/dist/filtering/ToolFilter.js +13 -2
- package/dist/filtering/ToolFilter.js.map +1 -1
- package/dist/github/GitHubIntegration.d.ts.map +1 -1
- package/dist/github/GitHubIntegration.js +1 -3
- package/dist/github/GitHubIntegration.js.map +1 -1
- package/dist/handlers/prompts/github.d.ts +12 -0
- package/dist/handlers/prompts/github.d.ts.map +1 -0
- package/dist/handlers/prompts/github.js +178 -0
- package/dist/handlers/prompts/github.js.map +1 -0
- package/dist/handlers/prompts/index.d.ts +23 -2
- package/dist/handlers/prompts/index.d.ts.map +1 -1
- package/dist/handlers/prompts/index.js +7 -432
- package/dist/handlers/prompts/index.js.map +1 -1
- package/dist/handlers/prompts/workflow.d.ts +12 -0
- package/dist/handlers/prompts/workflow.d.ts.map +1 -0
- package/dist/handlers/prompts/workflow.js +277 -0
- package/dist/handlers/prompts/workflow.js.map +1 -0
- package/dist/handlers/resources/core.d.ts +11 -0
- package/dist/handlers/resources/core.d.ts.map +1 -0
- package/dist/handlers/resources/core.js +433 -0
- package/dist/handlers/resources/core.js.map +1 -0
- package/dist/handlers/resources/github.d.ts +11 -0
- package/dist/handlers/resources/github.d.ts.map +1 -0
- package/dist/handlers/resources/github.js +314 -0
- package/dist/handlers/resources/github.js.map +1 -0
- package/dist/handlers/resources/graph.d.ts +11 -0
- package/dist/handlers/resources/graph.d.ts.map +1 -0
- package/dist/handlers/resources/graph.js +204 -0
- package/dist/handlers/resources/graph.js.map +1 -0
- package/dist/handlers/resources/index.d.ts +5 -20
- package/dist/handlers/resources/index.d.ts.map +1 -1
- package/dist/handlers/resources/index.js +16 -1278
- package/dist/handlers/resources/index.js.map +1 -1
- package/dist/handlers/resources/shared.d.ts +60 -0
- package/dist/handlers/resources/shared.d.ts.map +1 -0
- package/dist/handlers/resources/shared.js +49 -0
- package/dist/handlers/resources/shared.js.map +1 -0
- package/dist/handlers/resources/team.d.ts +13 -0
- package/dist/handlers/resources/team.d.ts.map +1 -0
- package/dist/handlers/resources/team.js +119 -0
- package/dist/handlers/resources/team.js.map +1 -0
- package/dist/handlers/resources/templates.d.ts +13 -0
- package/dist/handlers/resources/templates.d.ts.map +1 -0
- package/dist/handlers/resources/templates.js +310 -0
- package/dist/handlers/resources/templates.js.map +1 -0
- package/dist/handlers/tools/admin.d.ts +8 -0
- package/dist/handlers/tools/admin.d.ts.map +1 -0
- package/dist/handlers/tools/admin.js +270 -0
- package/dist/handlers/tools/admin.js.map +1 -0
- package/dist/handlers/tools/analytics.d.ts +8 -0
- package/dist/handlers/tools/analytics.d.ts.map +1 -0
- package/dist/handlers/tools/analytics.js +256 -0
- package/dist/handlers/tools/analytics.js.map +1 -0
- package/dist/handlers/tools/backup.d.ts +8 -0
- package/dist/handlers/tools/backup.d.ts.map +1 -0
- package/dist/handlers/tools/backup.js +224 -0
- package/dist/handlers/tools/backup.js.map +1 -0
- package/dist/handlers/tools/core.d.ts +9 -0
- package/dist/handlers/tools/core.d.ts.map +1 -0
- package/dist/handlers/tools/core.js +326 -0
- package/dist/handlers/tools/core.js.map +1 -0
- package/dist/handlers/tools/export.d.ts +8 -0
- package/dist/handlers/tools/export.d.ts.map +1 -0
- package/dist/handlers/tools/export.js +89 -0
- package/dist/handlers/tools/export.js.map +1 -0
- package/dist/handlers/tools/github/helpers.d.ts +34 -0
- package/dist/handlers/tools/github/helpers.d.ts.map +1 -0
- package/dist/handlers/tools/github/helpers.js +52 -0
- package/dist/handlers/tools/github/helpers.js.map +1 -0
- package/dist/handlers/tools/github/insights-tools.d.ts +8 -0
- package/dist/handlers/tools/github/insights-tools.d.ts.map +1 -0
- package/dist/handlers/tools/github/insights-tools.js +104 -0
- package/dist/handlers/tools/github/insights-tools.js.map +1 -0
- package/dist/handlers/tools/github/issue-tools.d.ts +8 -0
- package/dist/handlers/tools/github/issue-tools.d.ts.map +1 -0
- package/dist/handlers/tools/github/issue-tools.js +359 -0
- package/dist/handlers/tools/github/issue-tools.js.map +1 -0
- package/dist/handlers/tools/github/kanban-tools.d.ts +8 -0
- package/dist/handlers/tools/github/kanban-tools.d.ts.map +1 -0
- package/dist/handlers/tools/github/kanban-tools.js +108 -0
- package/dist/handlers/tools/github/kanban-tools.js.map +1 -0
- package/dist/handlers/tools/github/milestone-tools.d.ts +9 -0
- package/dist/handlers/tools/github/milestone-tools.d.ts.map +1 -0
- package/dist/handlers/tools/github/milestone-tools.js +302 -0
- package/dist/handlers/tools/github/milestone-tools.js.map +1 -0
- package/dist/handlers/tools/github/mutation-tools.d.ts +12 -0
- package/dist/handlers/tools/github/mutation-tools.d.ts.map +1 -0
- package/dist/handlers/tools/github/mutation-tools.js +15 -0
- package/dist/handlers/tools/github/mutation-tools.js.map +1 -0
- package/dist/handlers/tools/github/read-tools.d.ts +8 -0
- package/dist/handlers/tools/github/read-tools.d.ts.map +1 -0
- package/dist/handlers/tools/github/read-tools.js +260 -0
- package/dist/handlers/tools/github/read-tools.js.map +1 -0
- package/dist/handlers/tools/github/schemas.d.ts +467 -0
- package/dist/handlers/tools/github/schemas.d.ts.map +1 -0
- package/dist/handlers/tools/github/schemas.js +335 -0
- package/dist/handlers/tools/github/schemas.js.map +1 -0
- package/dist/handlers/tools/github.d.ts +14 -0
- package/dist/handlers/tools/github.d.ts.map +1 -0
- package/dist/handlers/tools/github.js +28 -0
- package/dist/handlers/tools/github.js.map +1 -0
- package/dist/handlers/tools/index.d.ts +15 -20
- package/dist/handlers/tools/index.d.ts.map +1 -1
- package/dist/handlers/tools/index.js +117 -2909
- package/dist/handlers/tools/index.js.map +1 -1
- package/dist/handlers/tools/relationships.d.ts +8 -0
- package/dist/handlers/tools/relationships.d.ts.map +1 -0
- package/dist/handlers/tools/relationships.js +308 -0
- package/dist/handlers/tools/relationships.js.map +1 -0
- package/dist/handlers/tools/schemas.d.ts +108 -0
- package/dist/handlers/tools/schemas.d.ts.map +1 -0
- package/dist/handlers/tools/schemas.js +122 -0
- package/dist/handlers/tools/schemas.js.map +1 -0
- package/dist/handlers/tools/search.d.ts +8 -0
- package/dist/handlers/tools/search.d.ts.map +1 -0
- package/dist/handlers/tools/search.js +282 -0
- package/dist/handlers/tools/search.js.map +1 -0
- package/dist/handlers/tools/team.d.ts +11 -0
- package/dist/handlers/tools/team.d.ts.map +1 -0
- package/dist/handlers/tools/team.js +239 -0
- package/dist/handlers/tools/team.js.map +1 -0
- package/dist/server/McpServer.d.ts +4 -0
- package/dist/server/McpServer.d.ts.map +1 -1
- package/dist/server/McpServer.js +48 -297
- package/dist/server/McpServer.js.map +1 -1
- package/dist/server/Scheduler.d.ts +91 -0
- package/dist/server/Scheduler.d.ts.map +1 -0
- package/dist/server/Scheduler.js +201 -0
- package/dist/server/Scheduler.js.map +1 -0
- package/dist/transports/http.d.ts +66 -0
- package/dist/transports/http.d.ts.map +1 -0
- package/dist/transports/http.js +519 -0
- package/dist/transports/http.js.map +1 -0
- package/dist/types/entities.d.ts +101 -0
- package/dist/types/entities.d.ts.map +1 -0
- package/dist/types/entities.js +5 -0
- package/dist/types/entities.js.map +1 -0
- package/dist/types/filtering.d.ts +34 -0
- package/dist/types/filtering.d.ts.map +1 -0
- package/dist/types/filtering.js +5 -0
- package/dist/types/filtering.js.map +1 -0
- package/dist/types/github.d.ts +166 -0
- package/dist/types/github.d.ts.map +1 -0
- package/dist/types/github.js +5 -0
- package/dist/types/github.js.map +1 -0
- package/dist/types/index.d.ts +35 -292
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/utils/error-helpers.d.ts +37 -0
- package/dist/utils/error-helpers.d.ts.map +1 -0
- package/dist/utils/error-helpers.js +47 -0
- package/dist/utils/error-helpers.js.map +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +6 -3
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/security-utils.d.ts +0 -21
- package/dist/utils/security-utils.d.ts.map +1 -1
- package/dist/utils/security-utils.js +0 -47
- package/dist/utils/security-utils.js.map +1 -1
- package/dist/vector/VectorSearchManager.d.ts.map +1 -1
- package/dist/vector/VectorSearchManager.js +9 -32
- package/dist/vector/VectorSearchManager.js.map +1 -1
- package/docker-compose.yml +11 -2
- package/hooks/README.md +107 -0
- package/hooks/cursor/hooks.json +10 -0
- package/hooks/cursor/memory-journal.mdc +22 -0
- package/hooks/cursor/session-end.sh +19 -0
- package/hooks/kilo-code/session-end-mode.json +11 -0
- package/hooks/kiro/session-end.md +13 -0
- package/mcp-config-example.json +1 -0
- package/package.json +11 -9
- package/playwright.config.ts +29 -0
- package/releases/v4.5.0.md +116 -0
- package/releases/v5.0.0.md +105 -0
- package/scripts/generate-server-instructions.ts +176 -0
- package/scripts/server-instructions-function-body.ts +77 -0
- package/server.json +3 -3
- package/src/cli.ts +45 -1
- package/src/constants/ServerInstructions.ts +133 -73
- package/src/constants/icons.ts +8 -7
- package/src/constants/server-instructions.md +268 -0
- package/src/database/SqliteAdapter.ts +358 -192
- package/src/database/schema.ts +125 -0
- package/src/filtering/ToolFilter.ts +13 -2
- package/src/github/GitHubIntegration.ts +1 -3
- package/src/handlers/prompts/github.ts +209 -0
- package/src/handlers/prompts/index.ts +10 -499
- package/src/handlers/prompts/workflow.ts +314 -0
- package/src/handlers/resources/core.ts +528 -0
- package/src/handlers/resources/github.ts +358 -0
- package/src/handlers/resources/graph.ts +254 -0
- package/src/handlers/resources/index.ts +23 -1570
- package/src/handlers/resources/shared.ts +103 -0
- package/src/handlers/resources/team.ts +133 -0
- package/src/handlers/resources/templates.ts +374 -0
- package/src/handlers/tools/admin.ts +285 -0
- package/src/handlers/tools/analytics.ts +301 -0
- package/src/handlers/tools/backup.ts +242 -0
- package/src/handlers/tools/core.ts +350 -0
- package/src/handlers/tools/export.ts +115 -0
- package/src/handlers/tools/github/helpers.ts +86 -0
- package/src/handlers/tools/github/insights-tools.ts +119 -0
- package/src/handlers/tools/github/issue-tools.ts +439 -0
- package/src/handlers/tools/github/kanban-tools.ts +134 -0
- package/src/handlers/tools/github/milestone-tools.ts +392 -0
- package/src/handlers/tools/github/mutation-tools.ts +17 -0
- package/src/handlers/tools/github/read-tools.ts +328 -0
- package/src/handlers/tools/github/schemas.ts +369 -0
- package/src/handlers/tools/github.ts +36 -0
- package/src/handlers/tools/index.ts +144 -3325
- package/src/handlers/tools/relationships.ts +358 -0
- package/src/handlers/tools/schemas.ts +132 -0
- package/src/handlers/tools/search.ts +343 -0
- package/src/handlers/tools/team.ts +273 -0
- package/src/server/McpServer.ts +63 -358
- package/src/server/Scheduler.ts +278 -0
- package/src/transports/http.ts +635 -0
- package/src/types/entities.ts +145 -0
- package/src/types/filtering.ts +54 -0
- package/src/types/github.ts +180 -0
- package/src/types/index.ts +67 -375
- package/src/utils/error-helpers.ts +52 -0
- package/src/utils/logger.ts +6 -3
- package/src/utils/security-utils.ts +0 -52
- package/src/vector/VectorSearchManager.ts +9 -33
- package/tests/constants/icons.test.ts +1 -2
- package/tests/constants/server-instructions.test.ts +30 -4
- package/tests/database/sqlite-adapter.test.ts +91 -7
- package/tests/e2e/auth.spec.ts +154 -0
- package/tests/e2e/health.spec.ts +63 -0
- package/tests/e2e/protocols.spec.ts +134 -0
- package/tests/e2e/resources.spec.ts +103 -0
- package/tests/e2e/scheduler.spec.ts +79 -0
- package/tests/e2e/security.spec.ts +91 -0
- package/tests/e2e/sessions.spec.ts +95 -0
- package/tests/e2e/stateless.spec.ts +121 -0
- package/tests/e2e/tools.spec.ts +111 -0
- package/tests/filtering/tool-filter.test.ts +46 -0
- package/tests/handlers/error-path-coverage.test.ts +324 -0
- package/tests/handlers/github-resource-handlers.test.ts +453 -0
- package/tests/handlers/github-tool-handlers.test.ts +899 -0
- package/tests/handlers/prompt-handler-coverage.test.ts +106 -0
- package/tests/handlers/prompt-handlers.test.ts +40 -0
- package/tests/handlers/resource-handler-coverage.test.ts +181 -0
- package/tests/handlers/resource-handlers.test.ts +33 -9
- package/tests/handlers/search-tool-handlers.test.ts +272 -0
- package/tests/handlers/targeted-gap-closure.test.ts +387 -0
- package/tests/handlers/team-resource-handlers.test.ts +156 -0
- package/tests/handlers/team-tool-handlers.test.ts +301 -0
- package/tests/handlers/tool-handler-coverage.test.ts +469 -0
- package/tests/handlers/tool-handlers.test.ts +2 -2
- package/tests/security/sql-injection.test.ts +3 -54
- package/tests/server/mcp-server.test.ts +503 -8
- package/tests/server/scheduler.test.ts +400 -0
- package/tests/transports/http-transport.test.ts +620 -0
- package/tests/vector/vector-search-manager.test.ts +60 -0
- package/vitest.config.ts +4 -1
- package/.memory-journal-team.db +0 -0
- package/.vscode/settings.json +0 -84
|
@@ -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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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: '
|
|
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@
|
|
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
|
-
|
|
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.
|
|
51
|
+
uses: aquasecurity/trivy-action@0.34.1
|
|
52
52
|
with:
|
|
53
53
|
image-ref: security-test:latest
|
|
54
54
|
format: 'sarif'
|
|
@@ -61,13 +61,13 @@ jobs:
|
|
|
61
61
|
|
|
62
62
|
- name: Upload Trivy scan results
|
|
63
63
|
uses: github/codeql-action/upload-sarif@v4
|
|
64
|
-
if: always()
|
|
64
|
+
if: always() && hashFiles('trivy-results.sarif') != ''
|
|
65
65
|
with:
|
|
66
66
|
sarif_file: 'trivy-results.sarif'
|
|
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.
|
|
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
|
@@ -7,6 +7,219 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
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
|
+
|
|
141
|
+
## [4.5.0] - 2026-03-02
|
|
142
|
+
|
|
143
|
+
### Fixed
|
|
144
|
+
|
|
145
|
+
- **Session Start briefing in Cursor** — Added Cursor-specific `FetchMcpResource` server name (`user-memory-journal-mcp`) to the Session Start instructions. Cursor prefixes MCP server names with `user-`, so agents using the generic name would get "Server not found" errors when fetching `memory://briefing`.
|
|
146
|
+
- **`deleteOldBackups` Test Isolation** — Fixed flaky `should delete old backups keeping only keepCount` test by cleaning up pre-existing backups before creating test backups. Previously, leftover backups from other tests caused the assertion to fail non-deterministically.
|
|
147
|
+
- **`deleteOldBackups` NaN Guard** — `keepCount` parameter now rejects `NaN` values. Previously, `NaN < 1` evaluated to `false`, bypassing the guard. With `NaN`, `backups.slice(0, NaN)` returns an empty array and `backups.slice(NaN)` returns all backups, causing every backup to be deleted.
|
|
148
|
+
- **`restoreFromFile` Foreign Key Enforcement** — `PRAGMA foreign_keys = ON` is now applied after restoring a database from backup. Previously, `restoreFromFile()` bypassed `initialize()`, so `ON DELETE CASCADE` constraints in `entry_tags`, `relationships`, and `embeddings` tables were silently unenforced for the rest of the server's lifetime.
|
|
149
|
+
|
|
150
|
+
### Improved
|
|
151
|
+
|
|
152
|
+
- **Test Coverage → 92%** — Expanded test suite from 549 → 590 tests, raising line coverage from 88.59% → 92.06%. Key areas covered:
|
|
153
|
+
- SIGINT shutdown handlers for stdio, stateless HTTP, and stateful HTTP transports
|
|
154
|
+
- Prompt handlers with proper arguments (`analyze-period`, `find-related`, `goal-tracker`, `get-context-bundle`, `prepare-retro`)
|
|
155
|
+
- `SqliteAdapter` backup edge cases (missing backups dir, invalid keepCount, missing backup file)
|
|
156
|
+
- `create_github_milestone` no-GitHub integration error path
|
|
157
|
+
- Kanban diagram resource no-GitHub fallback
|
|
158
|
+
|
|
159
|
+
### Added
|
|
160
|
+
|
|
161
|
+
- **Automated Scheduler (HTTP/SSE only)** — New in-process scheduler runs periodic maintenance jobs for long-running HTTP/SSE server processes. Configured via CLI flags:
|
|
162
|
+
- `--backup-interval <minutes>` — Automated backup interval (0 = disabled, default: 0). Backups are created with `exportToFile()` and old backups cleaned up automatically.
|
|
163
|
+
- `--keep-backups <count>` — Max backups to retain during automated cleanup (default: 5).
|
|
164
|
+
- `--vacuum-interval <minutes>` — Database optimize interval (0 = disabled, default: 0). Runs `PRAGMA optimize` and flushes the database to disk.
|
|
165
|
+
- `--rebuild-index-interval <minutes>` — Vector index rebuild interval (0 = disabled, default: 0). Full vector index rebuild from all entries.
|
|
166
|
+
- Scheduler status is reported in the `memory://health` resource under the `scheduler` field.
|
|
167
|
+
- Stdio transport ignores scheduler options with a warning log — use OS-level scheduling for stdio.
|
|
168
|
+
- Each job is error-isolated: failures are logged but don't affect other scheduled jobs.
|
|
169
|
+
- New module: `src/server/Scheduler.ts` — clean separation from `McpServer.ts`.
|
|
170
|
+
|
|
171
|
+
### Changed
|
|
172
|
+
|
|
173
|
+
- **Dependency Updates**
|
|
174
|
+
- `@types/node`: 25.3.2 → 25.3.3 (patch)
|
|
175
|
+
- `globals`: 17.3.0 → 17.4.0 (minor)
|
|
176
|
+
- `minimatch` override: 10.2.3 → 10.2.4 (patch) — npm + Docker layers
|
|
177
|
+
- `tar` override: 7.5.8 → 7.5.9 (patch) — npm + Docker layers
|
|
178
|
+
|
|
179
|
+
### Security
|
|
180
|
+
|
|
181
|
+
- **Wire Dead-Code Security Utilities (F-001)** — `sanitizeSearchQuery()` and `assertNoPathTraversal()` from `security-utils.ts` were defined but never imported or called. Now wired into active code paths:
|
|
182
|
+
- `SqliteAdapter.searchEntries()` applies `sanitizeSearchQuery()` to LIKE patterns with `ESCAPE '\\\\'` clause, preventing wildcard injection (F-002)
|
|
183
|
+
- `SqliteAdapter.restoreFromFile()` uses `assertNoPathTraversal()` instead of inline checks, throwing `PathTraversalError`
|
|
184
|
+
- **HTTP Security Headers (F-003)** — Added three additional security headers to HTTP transport middleware:
|
|
185
|
+
- `Content-Security-Policy: default-src 'none'; frame-ancestors 'none'` — prevents XSS and framing
|
|
186
|
+
- `Cache-Control: no-store` — prevents caching of sensitive journal data
|
|
187
|
+
- `Referrer-Policy: no-referrer` — prevents referrer leakage
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
194
|
+
- **`exportToFile()` Path Traversal Protection** — Added `assertNoPathTraversal()` check to backup export, matching the pattern already used in `restoreFromFile()`. Rejects malicious backup names containing `/`, `\\`, or `..`.
|
|
195
|
+
- **`getRawDb()` Safety Documentation** — Added `@internal` JSDoc tag warning callers to use parameterized queries when accessing the raw database handle.
|
|
196
|
+
- **Logger `LOG_LEVEL` Validation (L1)** — `LOG_LEVEL` environment variable is now validated against known levels (`debug`, `info`, `notice`, `warning`, `error`, `critical`). Invalid values fall back to `info` instead of silently setting `minLevel` to `undefined`, which would disable all logging.
|
|
197
|
+
- **Logger `setLevel()` Guard (L2)** — `Logger.setLevel()` now validates the level parameter before applying, preventing invalid values from disabling logging.
|
|
198
|
+
- **CI `security-scan` Node Version Alignment (L3)** — Updated Node.js version in `security-scan` job from 22.x to 24.x to match `engines.node: >=24.0.0`.
|
|
199
|
+
- **CI Trivy SARIF Upload Guard** — `security-update.yml` upload-sarif step now checks that `trivy-results.sarif` exists before attempting upload. Previously, `if: always()` caused the step to fail when the Docker build failed upstream and no SARIF file was produced.
|
|
200
|
+
|
|
201
|
+
### Documentation
|
|
202
|
+
|
|
203
|
+
- **Cursor Rule for Session Management** — Added `hooks/cursor/memory-journal.mdc`, an `alwaysApply` Cursor rule that instructs agents to read `memory://briefing` at session start and create a retrospective summary at session end. This is the most reliable mechanism for session behavior in Cursor, replacing the previous reliance on MCP server instructions alone.
|
|
204
|
+
- **Fixed Cursor sessionEnd Hook Format** — Rewrote `hooks/cursor/hooks.json` from a non-standard format to Cursor's documented `version: 1` schema. Added companion `hooks/cursor/session-end.sh` audit script. Corrected documentation: Cursor's `sessionEnd` hook is fire-and-forget (cannot inject messages); session summary creation is handled by the Cursor rule and server instructions.
|
|
205
|
+
- **Revised hooks/README.md** — Rewritten to accurately describe progressive enhancement: Cursor rule (primary) > server instructions (fallback) > hooks (audit only). Removed incorrect claim that Cursor `sessionEnd` does message injection. Added rule setup as Step 1 for Cursor users.
|
|
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.
|
|
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.
|
|
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.
|
|
209
|
+
- **Team Collaboration in READMEs** — Added team collaboration feature to Key Benefits in both `README.md` and `DOCKER_README.md`.
|
|
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.
|
|
211
|
+
- **Rate Limiting Documentation** — Added rate limiting mention to README.md Security section.
|
|
212
|
+
|
|
213
|
+
### Fixed
|
|
214
|
+
|
|
215
|
+
- **Path Traversal Test Assertion** — Updated `sql-injection.test.ts` to assert `PathTraversalError` type instead of old inline error message string, matching refactored `assertNoPathTraversal()` usage.
|
|
216
|
+
- **Tool Handler Test Fix** — Updated `tool-handlers.test.ts` to use valid entry_type enum value (`project_decision` instead of `decision`), matching the new enum constraint.
|
|
217
|
+
- **`share_with_team` Not Setting `isPersonal`** — `create_entry` with `share_with_team: true` now correctly sets `isPersonal: false`, making the entry visible in team-scoped resources like `memory://team/recent`. Previously, the `share_with_team` parameter was parsed but never applied to the `isPersonal` field.
|
|
218
|
+
|
|
219
|
+
### Removed
|
|
220
|
+
|
|
221
|
+
- **Unused `cors` Dependency** — Removed `cors` and `@types/cors` packages. CORS is handled by custom middleware in `McpServer.ts`.
|
|
222
|
+
|
|
10
223
|
## [4.4.2] - 2026-02-27
|
|
11
224
|
|
|
12
225
|
### Security
|