memory-journal-mcp 4.3.0 → 4.4.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 (109) hide show
  1. package/.dockerignore +131 -122
  2. package/.gitattributes +29 -0
  3. package/.github/workflows/docker-publish.yml +1 -1
  4. package/.github/workflows/lint-and-test.yml +1 -2
  5. package/.github/workflows/secrets-scanning.yml +0 -1
  6. package/.github/workflows/security-update.yml +6 -6
  7. package/.vscode/settings.json +17 -15
  8. package/CHANGELOG.md +1065 -11
  9. package/DOCKER_README.md +51 -33
  10. package/Dockerfile +14 -12
  11. package/README.md +68 -33
  12. package/SECURITY.md +225 -220
  13. package/dist/cli.js +7 -0
  14. package/dist/cli.js.map +1 -1
  15. package/dist/constants/ServerInstructions.d.ts +1 -1
  16. package/dist/constants/ServerInstructions.d.ts.map +1 -1
  17. package/dist/constants/ServerInstructions.js +70 -26
  18. package/dist/constants/ServerInstructions.js.map +1 -1
  19. package/dist/constants/icons.d.ts +2 -0
  20. package/dist/constants/icons.d.ts.map +1 -1
  21. package/dist/constants/icons.js +6 -0
  22. package/dist/constants/icons.js.map +1 -1
  23. package/dist/database/SqliteAdapter.d.ts +51 -10
  24. package/dist/database/SqliteAdapter.d.ts.map +1 -1
  25. package/dist/database/SqliteAdapter.js +143 -43
  26. package/dist/database/SqliteAdapter.js.map +1 -1
  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 +7 -1
  30. package/dist/filtering/ToolFilter.js.map +1 -1
  31. package/dist/github/GitHubIntegration.d.ts +74 -2
  32. package/dist/github/GitHubIntegration.d.ts.map +1 -1
  33. package/dist/github/GitHubIntegration.js +508 -7
  34. package/dist/github/GitHubIntegration.js.map +1 -1
  35. package/dist/handlers/prompts/index.js +1 -0
  36. package/dist/handlers/prompts/index.js.map +1 -1
  37. package/dist/handlers/resources/index.d.ts.map +1 -1
  38. package/dist/handlers/resources/index.js +257 -13
  39. package/dist/handlers/resources/index.js.map +1 -1
  40. package/dist/handlers/tools/index.d.ts.map +1 -1
  41. package/dist/handlers/tools/index.js +595 -8
  42. package/dist/handlers/tools/index.js.map +1 -1
  43. package/dist/server/McpServer.d.ts +2 -0
  44. package/dist/server/McpServer.d.ts.map +1 -1
  45. package/dist/server/McpServer.js +69 -26
  46. package/dist/server/McpServer.js.map +1 -1
  47. package/dist/types/index.d.ts +97 -0
  48. package/dist/types/index.d.ts.map +1 -1
  49. package/dist/types/index.js.map +1 -1
  50. package/dist/utils/logger.d.ts +1 -0
  51. package/dist/utils/logger.d.ts.map +1 -1
  52. package/dist/utils/logger.js +8 -1
  53. package/dist/utils/logger.js.map +1 -1
  54. package/dist/utils/progress-utils.d.ts +18 -3
  55. package/dist/utils/progress-utils.d.ts.map +1 -1
  56. package/dist/utils/progress-utils.js.map +1 -1
  57. package/dist/utils/security-utils.d.ts +91 -0
  58. package/dist/utils/security-utils.d.ts.map +1 -0
  59. package/dist/utils/security-utils.js +184 -0
  60. package/dist/utils/security-utils.js.map +1 -0
  61. package/dist/vector/VectorSearchManager.d.ts +2 -1
  62. package/dist/vector/VectorSearchManager.d.ts.map +1 -1
  63. package/dist/vector/VectorSearchManager.js +100 -34
  64. package/dist/vector/VectorSearchManager.js.map +1 -1
  65. package/docker-compose.yml +46 -37
  66. package/mcp-config-example.json +0 -2
  67. package/package.json +21 -14
  68. package/releases/v4.3.1.md +69 -0
  69. package/releases/v4.4.0.md +120 -0
  70. package/server.json +3 -3
  71. package/src/cli.ts +11 -0
  72. package/src/constants/ServerInstructions.ts +70 -26
  73. package/src/constants/icons.ts +7 -0
  74. package/src/database/SqliteAdapter.ts +165 -44
  75. package/src/filtering/ToolFilter.ts +7 -1
  76. package/src/github/GitHubIntegration.ts +588 -8
  77. package/src/handlers/prompts/index.ts +1 -0
  78. package/src/handlers/resources/index.ts +318 -12
  79. package/src/handlers/tools/index.ts +686 -13
  80. package/src/server/McpServer.ts +79 -37
  81. package/src/types/index.ts +98 -0
  82. package/src/utils/logger.ts +10 -1
  83. package/src/utils/progress-utils.ts +17 -6
  84. package/src/utils/security-utils.ts +205 -0
  85. package/src/vector/VectorSearchManager.ts +110 -39
  86. package/tests/constants/icons.test.ts +102 -0
  87. package/tests/constants/server-instructions.test.ts +549 -0
  88. package/tests/database/sqlite-adapter.bench.ts +63 -0
  89. package/tests/database/sqlite-adapter.test.ts +555 -0
  90. package/tests/filtering/tool-filter.test.ts +266 -0
  91. package/tests/github/github-integration.test.ts +1024 -0
  92. package/tests/handlers/github-resource-handlers.test.ts +473 -0
  93. package/tests/handlers/github-tool-handlers.test.ts +556 -0
  94. package/tests/handlers/prompt-handlers.test.ts +91 -0
  95. package/tests/handlers/resource-handlers.test.ts +339 -0
  96. package/tests/handlers/tool-handlers.test.ts +497 -0
  97. package/tests/handlers/vector-tool-handlers.test.ts +238 -0
  98. package/tests/security/sql-injection.test.ts +347 -0
  99. package/tests/server/mcp-server.bench.ts +55 -0
  100. package/tests/server/mcp-server.test.ts +675 -0
  101. package/tests/utils/logger.test.ts +180 -0
  102. package/tests/utils/mcp-logger.test.ts +212 -0
  103. package/tests/utils/progress-utils.test.ts +156 -0
  104. package/tests/utils/security-utils.test.ts +82 -0
  105. package/tests/vector/vector-search-manager.test.ts +335 -0
  106. package/tests/vector/vector-search.bench.ts +53 -0
  107. package/vitest.config.ts +15 -0
  108. package/.github/workflows/DOCKER_DEPLOYMENT_SETUP.md +0 -387
  109. package/.github/workflows/dependabot-auto-merge.yml +0 -42
@@ -1,387 +0,0 @@
1
- # Docker Deployment Setup Guide
2
-
3
- _Last Updated: December 8, 2025 - Production/Stable v2.2.0_
4
-
5
- ## 🚀 Automated Docker Deployment
6
-
7
- This repository is configured for **automatic Docker image deployment** to Docker Hub on every push to the `main` branch and on tagged releases.
8
-
9
- ## 📋 Current Status
10
-
11
- ### ✅ Production-Ready Deployment
12
-
13
- - **Version**: v2.2.0 (Production/Stable)
14
- - **Base Image**: `python:3.13-alpine` (Alpine Linux 3.22)
15
- - **Docker Hub**: `writenotenow/memory-journal-mcp`
16
- - **Image Size**: ~225MB (Alpine-based with full ML capabilities)
17
- - **Platforms**: `linux/amd64`, `linux/arm64` (Apple Silicon support)
18
-
19
- ### 🔒 Security Posture
20
-
21
- - **OpenSSL**: 3.5.4-r0 (latest)
22
- - **curl**: 8.14.1-r2 (latest)
23
- - **expat**: 2.7.3-r0 (latest)
24
- - **pip**: ≥25.0
25
- - **setuptools**: ≥78.1.1
26
-
27
- ## 📦 Required GitHub Secrets
28
-
29
- Before the Docker deployment workflow can run, you need to add these secrets to your GitHub repository:
30
-
31
- ### 1. Navigate to Repository Settings
32
-
33
- 1. Go to your repository on GitHub: https://github.com/neverinfamous/memory-journal-mcp
34
- 2. Click **Settings** → **Secrets and variables** → **Actions**
35
- 3. Click **New repository secret**
36
-
37
- ### 2. Required Secrets
38
-
39
- #### `DOCKER_USERNAME`
40
-
41
- - **Value**: `writenotenow` (Docker Hub username)
42
- - **Description**: Docker Hub username for authentication
43
- - **Status**: ✅ Configured
44
-
45
- #### `DOCKER_PASSWORD`
46
-
47
- - **Value**: Docker Hub access token (NOT your password)
48
- - **Description**: Docker Hub access token for secure authentication
49
- - **Status**: ✅ Configured
50
-
51
- ### 3. Generate Docker Hub Access Token (If Needed)
52
-
53
- 1. Go to [Docker Hub](https://hub.docker.com)
54
- 2. Click your avatar → **Account Settings**
55
- 3. Go to **Security** → **Personal Access Tokens**
56
- 4. Click **Generate New Token**
57
- 5. Name: `GitHub-Actions-memory-journal-mcp`
58
- 6. Permissions: **Read, Write, Delete**
59
- 7. Copy the token and use it as `DOCKER_PASSWORD`
60
-
61
- ## 🏗️ What Gets Built
62
-
63
- ### Image Configuration
64
-
65
- - **Single Variant**: Alpine-based full-featured image (225MB)
66
- - **ML Support**: Optional semantic search with graceful degradation
67
- - ARM64: ML dependencies fail to install, continues without semantic search ✅
68
- - AMD64: Full ML support with PyTorch, FAISS, sentence-transformers ✅
69
- - **Base**: Python 3.13 on Alpine Linux 3.22
70
-
71
- ### Supported Platforms
72
-
73
- - **linux/amd64** - x86_64 architecture (full features)
74
- - **linux/arm64** - Apple Silicon / ARM64 (core features, optional ML)
75
-
76
- ### Tags Generated on Each Push
77
-
78
- When you push to `main` branch, the workflow automatically creates:
79
-
80
- - `latest` - Always points to most recent main branch build
81
- - `v2.2.0` - Current version from pyproject.toml (automatically extracted)
82
- - `sha-XXXXXXX` - Git commit SHA pinned tag (short format)
83
-
84
- ## 🔄 Deployment Triggers
85
-
86
- ### Automatic Deployment
87
-
88
- - ✅ **Push to main** → Builds and pushes all tags
89
- - ✅ **Create git tag** → Builds and pushes versioned tags (e.g., `v1.1.3`)
90
- - ✅ **Pull requests** → Builds images for testing (doesn't push to Docker Hub)
91
-
92
- ### Manual Deployment
93
-
94
- ```bash
95
- # Create and push a release tag
96
- git tag v2.2.0
97
- git push origin v2.2.0
98
-
99
- # This will trigger deployment with tags:
100
- # - v2.2.0
101
- # - latest
102
- # - sha-XXXXXXX
103
- ```
104
-
105
- ## 🛡️ Security Features
106
-
107
- ### Multi-Layer Security Scanning
108
-
109
- 1. **Docker Scout CLI** - Runs during build, blocks critical/high vulnerabilities
110
- - Scans single-platform (linux/amd64) image locally
111
- - 8-minute timeout for efficient CI/CD
112
- - Blocks deployment if critical/high CVEs detected
113
- - Allows low/medium severity (acceptable risk)
114
-
115
- 2. **Trivy Scanner** (Weekly scheduled scan)
116
- - Runs every Sunday at 2 AM UTC
117
- - Creates GitHub issues for vulnerabilities
118
- - Uploads SARIF results to Security tab
119
- - Exit code 1 on critical/high/medium issues
120
-
121
- ### Image Optimization
122
-
123
- - **Multi-stage builds** keep images lean (225MB)
124
- - **Layer caching** speeds up builds significantly
125
- - **GitHub Actions cache** reduces build times by ~60%
126
- - **Non-root user** (appuser:appgroup) for container security
127
- - **WAL mode** for better concurrency and crash recovery
128
-
129
- ### Supply Chain Security
130
-
131
- - **Attestations**: Enabled for all images
132
- - **Provenance**: Full build provenance tracking
133
- - **SBOM**: Software Bill of Materials generated
134
- - **Signature**: Docker content trust compatible
135
-
136
- ## 📦 What's Excluded from Docker Images
137
-
138
- The `.dockerignore` file filters out development files:
139
-
140
- ```
141
- .github/ # GitHub workflows and templates
142
- .git/ # Git history
143
- __pycache__/ # Python cache
144
- *.pyc # Compiled Python
145
- *.pyo # Optimized Python
146
- *.db # Database files
147
- .venv/ # Virtual environments
148
- dist/ # Build artifacts
149
- *.egg-info/ # Package metadata
150
- .pytest_cache/ # Test cache
151
- htmlcov/ # Coverage reports
152
- ```
153
-
154
- ## 🎯 Docker Hub Integration
155
-
156
- ### Automatic Updates
157
-
158
- - **Tags**: Automatically created and pushed
159
- - **Attestations**: Supply chain metadata attached to all tags
160
- - **SBOM**: Software Bill of Materials for each build
161
- - **Multi-arch manifests**: Single tag works on AMD64 and ARM64
162
-
163
- ### Repository Information
164
-
165
- - **Repository**: `writenotenow/memory-journal-mcp`
166
- - **Visibility**: Public
167
- - **URL**: https://hub.docker.com/r/writenotenow/memory-journal-mcp
168
- - **Pulls**: Tracked by Docker Hub analytics
169
-
170
- ## ⚡ Build Performance
171
-
172
- ### Optimizations Implemented
173
-
174
- - **Parallel builds** for AMD64 and ARM64
175
- - **GitHub Actions cache** for Docker layers
176
- - **Multi-platform builds** using QEMU and Buildx
177
- - **Graceful ML fallback** (continues without ML on ARM64)
178
- - **Strategic layer ordering** (requirements → dependencies → code)
179
-
180
- ### Build Times (Actual)
181
-
182
- - **AMD64 build**: ~3-4 minutes (with cache)
183
- - **ARM64 build**: ~2-3 minutes (without ML dependencies)
184
- - **Multi-platform total**: ~5-7 minutes
185
- - **Security scanning**: ~30-60 seconds
186
- - **First build (no cache)**: ~10-15 minutes
187
-
188
- ### Caching Strategy
189
-
190
- - **Layer caching**: Maximizes Docker layer reuse
191
- - **Package caching**: pip packages cached between builds
192
- - **Base image caching**: Python Alpine image cached locally
193
-
194
- ## 🧪 Testing
195
-
196
- ### Automated CI/CD Tests
197
-
198
- #### Test Matrix (Python 3.10, 3.11, 3.12)
199
-
200
- - ✅ **Dependency installation** - All required packages
201
- - ✅ **Linting** - flake8 code quality checks
202
- - ✅ **Server import** - Python module loads correctly
203
- - ✅ **Database schema** - SQLite schema validation
204
-
205
- #### Docker Image Tests
206
-
207
- - ✅ **Security scan** - Docker Scout CVE detection
208
- - ✅ **Import test** - Server imports successfully in container
209
- - ✅ **Multi-platform** - Both AMD64 and ARM64 verified
210
- - ✅ **ML graceful degradation** - Continues without ML on ARM64
211
-
212
- ### Manual Testing
213
-
214
- #### Quick Verification
215
-
216
- ```bash
217
- # Test latest build
218
- docker pull writenotenow/memory-journal-mcp:latest
219
- docker run --rm writenotenow/memory-journal-mcp:latest python -c "import sys; sys.path.append('src'); import server; print('✅ Works!')"
220
- ```
221
-
222
- #### Full Functional Test
223
-
224
- ```bash
225
- # Create data directory
226
- mkdir -p data
227
-
228
- # Run server with volume mount
229
- docker run --rm -i \
230
- -v ./data:/app/data \
231
- writenotenow/memory-journal-mcp:latest \
232
- python src/server.py
233
- ```
234
-
235
- #### Test Specific Version
236
-
237
- ```bash
238
- # Test by version tag
239
- docker pull writenotenow/memory-journal-mcp:v2.2.0
240
- docker run --rm writenotenow/memory-journal-mcp:v2.2.0 python -c "print('v2.2.0 works!')"
241
-
242
- # Test by commit SHA
243
- docker pull writenotenow/memory-journal-mcp:sha-XXXXXXX
244
- ```
245
-
246
- ## 🚨 Troubleshooting
247
-
248
- ### Common Issues
249
-
250
- #### 1. Build fails with authentication error
251
-
252
- **Symptoms**: `Error saving credentials: error storing credentials`
253
- **Solution**:
254
-
255
- - Verify `DOCKER_USERNAME` and `DOCKER_PASSWORD` secrets in GitHub
256
- - Check Docker Hub access token hasn't expired
257
- - Ensure token has Read, Write, Delete permissions
258
-
259
- #### 2. ARM64 build warnings about ML dependencies
260
-
261
- **Status**: ✅ Expected behavior, not an error
262
- **Details**:
263
-
264
- - PyTorch CPU builds not available for ARM64 Alpine
265
- - Server continues without semantic search features
266
- - Core functionality fully operational
267
-
268
- #### 3. Security scan fails
269
-
270
- **Symptoms**: Build blocked with "Critical or high severity vulnerabilities detected"
271
- **Solution**:
272
-
273
- 1. Review Docker Scout output in Actions logs
274
- 2. Update base image in Dockerfile (`FROM python:3.13-alpine`)
275
- 3. Update pinned packages (openssl, curl, expat)
276
- 4. Commit and push changes to trigger new build
277
-
278
- #### 4. Cache-related build failures
279
-
280
- **Symptoms**: "Failed to save: Unable to reserve cache"
281
- **Status**: ✅ Informational warning, not an error
282
- **Details**: Another concurrent job may be writing to cache, image still builds successfully
283
-
284
- ### Monitoring
285
-
286
- #### GitHub Actions
287
-
288
- - **Build Status**: https://github.com/neverinfamous/memory-journal-mcp/actions
289
- - **Workflow File**: `.github/workflows/docker-publish.yml`
290
- - **Security Scans**: `.github/workflows/security-update.yml`
291
-
292
- #### Docker Hub
293
-
294
- - **Repository**: https://hub.docker.com/r/writenotenow/memory-journal-mcp
295
- - **Tags**: View all available tags
296
- - **Image Layers**: Inspect layer sizes and contents
297
- - **Security**: Docker Scout recommendations
298
-
299
- #### GitHub Security Tab
300
-
301
- - **SARIF Results**: Trivy scanner uploads
302
- - **Dependabot Alerts**: Dependency vulnerabilities
303
- - **Code Scanning**: Security analysis results
304
-
305
- ## 📈 Usage Analytics
306
-
307
- ### Metrics to Monitor
308
-
309
- #### Docker Hub (Public)
310
-
311
- - **Pull count** - Total downloads
312
- - **Tag popularity** - Most-used versions
313
- - **Geographic distribution** - User locations
314
-
315
- #### GitHub (Private)
316
-
317
- - **Build success rate** - CI/CD health
318
- - **Build duration trends** - Performance monitoring
319
- - **Security scan results** - Vulnerability tracking
320
-
321
- ## 🔄 Update Process
322
-
323
- ### Regular Updates (Recommended Monthly)
324
-
325
- 1. **Check for base image updates**
326
-
327
- ```bash
328
- docker pull python:3.13-alpine
329
- docker inspect python:3.13-alpine --format '{{.Created}}'
330
- ```
331
-
332
- 2. **Update pinned packages in Dockerfile**
333
-
334
- ```bash
335
- # Check latest Alpine package versions
336
- docker run --rm python:3.13-alpine sh -c "apk update && apk info openssl curl expat"
337
- ```
338
-
339
- 3. **Update Dockerfile with new versions**
340
-
341
- ```dockerfile
342
- RUN apk add --no-cache --upgrade openssl=<version> curl=<version> expat=<version>
343
- ```
344
-
345
- 4. **Commit and push to trigger rebuild**
346
-
347
- ```bash
348
- git add Dockerfile
349
- git commit -m "Update Docker base image with security fixes"
350
- git push origin main
351
- ```
352
-
353
- 5. **Monitor GitHub Actions** for successful build
354
- ```bash
355
- gh run list --limit 3
356
- gh run watch <run-id>
357
- ```
358
-
359
- ### Emergency Security Updates
360
-
361
- If Docker Scout or Trivy detects critical vulnerabilities:
362
-
363
- 1. **Immediate action required** - Block deployments
364
- 2. **Review CVE details** in Actions logs or Security tab
365
- 3. **Update affected packages** in Dockerfile
366
- 4. **Test locally** before pushing
367
- 5. **Deploy fix immediately** to main branch
368
-
369
- ## 📚 Additional Resources
370
-
371
- - **GitHub Wiki**: https://github.com/neverinfamous/memory-journal-mcp/wiki
372
- - **PyPI Package**: https://pypi.org/project/memory-journal-mcp/
373
- - **MCP Registry**: https://registry.modelcontextprotocol.io/
374
- - **Docker Hub**: https://hub.docker.com/r/writenotenow/memory-journal-mcp
375
- - **GitHub Gists**: https://gist.github.com/neverinfamous/ffedec3bdb5da08376a381733b80c1a7
376
-
377
- ---
378
-
379
- ## 🏆 Current Build Status
380
-
381
- ✅ **Production/Stable** - All systems operational
382
-
383
- - Latest version: v2.2.0
384
- - Docker Scout: ✅ No critical/high vulnerabilities
385
- - Multi-platform: ✅ AMD64 + ARM64 support
386
- - Security packages: ✅ All at latest versions
387
- - Image size: 225MB (optimized for deployment)
@@ -1,42 +0,0 @@
1
- name: Dependabot auto-merge
2
-
3
- on:
4
- pull_request:
5
- paths:
6
- - 'package*.json'
7
- - '.github/workflows/dependabot-auto-merge.yml'
8
-
9
- permissions:
10
- pull-requests: write
11
- contents: write
12
-
13
- jobs:
14
- dependabot:
15
- runs-on: ubuntu-latest
16
- if: ${{ github.actor == 'dependabot[bot]' }}
17
- steps:
18
- - name: Dependabot metadata
19
- id: metadata
20
- uses: dependabot/fetch-metadata@v2
21
- with:
22
- github-token: '${{ secrets.GITHUB_TOKEN }}'
23
-
24
- - name: Enable auto-merge for Dependabot PRs
25
- if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
26
- run: gh pr merge --auto --squash "$PR_URL"
27
- env:
28
- PR_URL: ${{ github.event.pull_request.html_url }}
29
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
-
31
- - name: Comment on major version updates
32
- if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-major' }}
33
- uses: actions/github-script@v8
34
- with:
35
- github-token: ${{ secrets.GITHUB_TOKEN }}
36
- script: |
37
- github.rest.issues.createComment({
38
- issue_number: context.issue.number,
39
- owner: context.repo.owner,
40
- repo: context.repo.repo,
41
- body: '⚠️ This is a major version update. Please review carefully before merging.'
42
- })