memory-journal-mcp 4.3.1 → 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.
- package/.dockerignore +131 -122
- package/.gitattributes +29 -0
- package/.github/workflows/docker-publish.yml +1 -1
- package/.github/workflows/lint-and-test.yml +1 -2
- package/.github/workflows/secrets-scanning.yml +0 -1
- package/.github/workflows/security-update.yml +6 -6
- package/.vscode/settings.json +17 -15
- package/CHANGELOG.md +1065 -11
- package/DOCKER_README.md +51 -33
- package/Dockerfile +12 -11
- package/README.md +68 -33
- package/SECURITY.md +225 -158
- package/dist/cli.js +7 -0
- package/dist/cli.js.map +1 -1
- package/dist/constants/ServerInstructions.d.ts +1 -1
- package/dist/constants/ServerInstructions.d.ts.map +1 -1
- package/dist/constants/ServerInstructions.js +70 -26
- package/dist/constants/ServerInstructions.js.map +1 -1
- package/dist/constants/icons.d.ts +2 -0
- package/dist/constants/icons.d.ts.map +1 -1
- package/dist/constants/icons.js +6 -0
- package/dist/constants/icons.js.map +1 -1
- package/dist/database/SqliteAdapter.d.ts +51 -10
- package/dist/database/SqliteAdapter.d.ts.map +1 -1
- package/dist/database/SqliteAdapter.js +140 -31
- package/dist/database/SqliteAdapter.js.map +1 -1
- package/dist/filtering/ToolFilter.d.ts +1 -1
- package/dist/filtering/ToolFilter.d.ts.map +1 -1
- package/dist/filtering/ToolFilter.js +7 -1
- package/dist/filtering/ToolFilter.js.map +1 -1
- package/dist/github/GitHubIntegration.d.ts +74 -2
- package/dist/github/GitHubIntegration.d.ts.map +1 -1
- package/dist/github/GitHubIntegration.js +508 -7
- package/dist/github/GitHubIntegration.js.map +1 -1
- package/dist/handlers/prompts/index.js +1 -0
- package/dist/handlers/prompts/index.js.map +1 -1
- package/dist/handlers/resources/index.d.ts.map +1 -1
- package/dist/handlers/resources/index.js +257 -13
- package/dist/handlers/resources/index.js.map +1 -1
- package/dist/handlers/tools/index.d.ts.map +1 -1
- package/dist/handlers/tools/index.js +590 -7
- package/dist/handlers/tools/index.js.map +1 -1
- package/dist/server/McpServer.d.ts +2 -0
- package/dist/server/McpServer.d.ts.map +1 -1
- package/dist/server/McpServer.js +69 -26
- package/dist/server/McpServer.js.map +1 -1
- package/dist/types/index.d.ts +97 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +8 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/security-utils.d.ts +8 -0
- package/dist/utils/security-utils.d.ts.map +1 -1
- package/dist/utils/security-utils.js +32 -0
- package/dist/utils/security-utils.js.map +1 -1
- package/dist/vector/VectorSearchManager.d.ts +2 -1
- package/dist/vector/VectorSearchManager.d.ts.map +1 -1
- package/dist/vector/VectorSearchManager.js +100 -34
- package/dist/vector/VectorSearchManager.js.map +1 -1
- package/docker-compose.yml +46 -37
- package/mcp-config-example.json +0 -2
- package/package.json +12 -11
- package/releases/v4.3.1.md +69 -0
- package/releases/v4.4.0.md +120 -0
- package/server.json +3 -3
- package/src/cli.ts +11 -0
- package/src/constants/ServerInstructions.ts +70 -26
- package/src/constants/icons.ts +7 -0
- package/src/database/SqliteAdapter.ts +162 -32
- package/src/filtering/ToolFilter.ts +7 -1
- package/src/github/GitHubIntegration.ts +588 -8
- package/src/handlers/prompts/index.ts +1 -0
- package/src/handlers/resources/index.ts +318 -12
- package/src/handlers/tools/index.ts +681 -12
- package/src/server/McpServer.ts +79 -37
- package/src/types/index.ts +98 -0
- package/src/utils/logger.ts +10 -1
- package/src/utils/security-utils.ts +35 -0
- package/src/vector/VectorSearchManager.ts +110 -39
- package/tests/constants/icons.test.ts +102 -0
- package/tests/constants/server-instructions.test.ts +549 -0
- package/tests/database/sqlite-adapter.bench.ts +63 -0
- package/tests/database/sqlite-adapter.test.ts +555 -0
- package/tests/filtering/tool-filter.test.ts +266 -0
- package/tests/github/github-integration.test.ts +1024 -0
- package/tests/handlers/github-resource-handlers.test.ts +473 -0
- package/tests/handlers/github-tool-handlers.test.ts +556 -0
- package/tests/handlers/prompt-handlers.test.ts +91 -0
- package/tests/handlers/resource-handlers.test.ts +339 -0
- package/tests/handlers/tool-handlers.test.ts +497 -0
- package/tests/handlers/vector-tool-handlers.test.ts +238 -0
- package/tests/server/mcp-server.bench.ts +55 -0
- package/tests/server/mcp-server.test.ts +675 -0
- package/tests/utils/logger.test.ts +180 -0
- package/tests/utils/mcp-logger.test.ts +212 -0
- package/tests/utils/progress-utils.test.ts +156 -0
- package/tests/utils/security-utils.test.ts +82 -0
- package/tests/vector/vector-search-manager.test.ts +335 -0
- package/tests/vector/vector-search.bench.ts +53 -0
- package/.github/workflows/DOCKER_DEPLOYMENT_SETUP.md +0 -387
- package/.github/workflows/dependabot-auto-merge.yml +0 -42
package/SECURITY.md
CHANGED
|
@@ -1,158 +1,225 @@
|
|
|
1
|
-
# 🔒 Security Guide
|
|
2
|
-
|
|
3
|
-
The Memory Journal MCP server implements comprehensive security measures to protect your personal journal data.
|
|
4
|
-
|
|
5
|
-
## 🛡️ **Database Security**
|
|
6
|
-
|
|
7
|
-
### **WAL Mode Enabled**
|
|
8
|
-
|
|
9
|
-
- ✅ **Write-Ahead Logging (WAL)** enabled for better concurrency and crash recovery
|
|
10
|
-
- ✅ **Atomic transactions** ensure data consistency
|
|
11
|
-
- ✅ **Better performance** with concurrent read/write operations
|
|
12
|
-
|
|
13
|
-
### **Optimized PRAGMA Settings**
|
|
14
|
-
|
|
15
|
-
```sql
|
|
16
|
-
PRAGMA foreign_keys = ON -- Enforce referential integrity
|
|
17
|
-
PRAGMA journal_mode = WAL -- Enable WAL mode
|
|
18
|
-
PRAGMA synchronous = NORMAL -- Balance safety and performance
|
|
19
|
-
PRAGMA cache_size = -64000 -- 64MB cache for better performance
|
|
20
|
-
PRAGMA mmap_size = 268435456 -- 256MB memory-mapped I/O
|
|
21
|
-
PRAGMA temp_store = MEMORY -- Store temp tables in memory
|
|
22
|
-
PRAGMA busy_timeout = 30000 -- 30-second timeout for busy database
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### **File Permissions**
|
|
26
|
-
|
|
27
|
-
- ✅ **Database files**: `600` (read/write for owner only)
|
|
28
|
-
- ✅ **Data directory**: `700` (full access for owner only)
|
|
29
|
-
- ✅ **Automatic permission setting** on database creation
|
|
30
|
-
|
|
31
|
-
## 🔐 **Input Validation**
|
|
32
|
-
|
|
33
|
-
### **Content Limits**
|
|
34
|
-
|
|
35
|
-
- **Journal entries**: 50,000 characters maximum
|
|
36
|
-
- **Tags**: 100 characters maximum
|
|
37
|
-
- **Entry types**: 50 characters maximum
|
|
38
|
-
- **Significance types**: 50 characters maximum
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- ✅ **
|
|
50
|
-
- ✅ **
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- ✅ **
|
|
58
|
-
- ✅ **
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
### **
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
#
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
- **
|
|
154
|
-
- **
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
1
|
+
# 🔒 Security Guide
|
|
2
|
+
|
|
3
|
+
The Memory Journal MCP server implements comprehensive security measures to protect your personal journal data.
|
|
4
|
+
|
|
5
|
+
## 🛡️ **Database Security**
|
|
6
|
+
|
|
7
|
+
### **WAL Mode Enabled**
|
|
8
|
+
|
|
9
|
+
- ✅ **Write-Ahead Logging (WAL)** enabled for better concurrency and crash recovery
|
|
10
|
+
- ✅ **Atomic transactions** ensure data consistency
|
|
11
|
+
- ✅ **Better performance** with concurrent read/write operations
|
|
12
|
+
|
|
13
|
+
### **Optimized PRAGMA Settings**
|
|
14
|
+
|
|
15
|
+
```sql
|
|
16
|
+
PRAGMA foreign_keys = ON -- Enforce referential integrity
|
|
17
|
+
PRAGMA journal_mode = WAL -- Enable WAL mode
|
|
18
|
+
PRAGMA synchronous = NORMAL -- Balance safety and performance
|
|
19
|
+
PRAGMA cache_size = -64000 -- 64MB cache for better performance
|
|
20
|
+
PRAGMA mmap_size = 268435456 -- 256MB memory-mapped I/O
|
|
21
|
+
PRAGMA temp_store = MEMORY -- Store temp tables in memory
|
|
22
|
+
PRAGMA busy_timeout = 30000 -- 30-second timeout for busy database
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### **File Permissions**
|
|
26
|
+
|
|
27
|
+
- ✅ **Database files**: `600` (read/write for owner only)
|
|
28
|
+
- ✅ **Data directory**: `700` (full access for owner only)
|
|
29
|
+
- ✅ **Automatic permission setting** on database creation
|
|
30
|
+
|
|
31
|
+
## 🔐 **Input Validation**
|
|
32
|
+
|
|
33
|
+
### **Content Limits**
|
|
34
|
+
|
|
35
|
+
- **Journal entries**: 50,000 characters maximum
|
|
36
|
+
- **Tags**: 100 characters maximum
|
|
37
|
+
- **Entry types**: 50 characters maximum
|
|
38
|
+
- **Significance types**: 50 characters maximum
|
|
39
|
+
- **HTTP request body**: 1MB maximum (prevents memory exhaustion)
|
|
40
|
+
|
|
41
|
+
### **Character Filtering**
|
|
42
|
+
|
|
43
|
+
Dangerous characters are blocked in tags:
|
|
44
|
+
|
|
45
|
+
- `<` `>` `"` `'` `&` `\x00`
|
|
46
|
+
|
|
47
|
+
### **SQL Injection Prevention**
|
|
48
|
+
|
|
49
|
+
- ✅ **Parameterized queries** used throughout
|
|
50
|
+
- ✅ **Input validation** via Zod schemas before database operations
|
|
51
|
+
- ✅ **Warning system** for potentially dangerous content patterns
|
|
52
|
+
- ✅ **LIKE pattern sanitization** (escapes `%`, `_`, `\` wildcards)
|
|
53
|
+
- ✅ **Date format whitelisting** (prevents strftime injection)
|
|
54
|
+
|
|
55
|
+
### **Path Traversal Protection**
|
|
56
|
+
|
|
57
|
+
- ✅ **Backup filenames validated** - rejects `/`, `\`, `..` in paths
|
|
58
|
+
- ✅ **Typed security errors** with consistent error codes
|
|
59
|
+
|
|
60
|
+
## 🌐 **HTTP Transport Security**
|
|
61
|
+
|
|
62
|
+
When running in HTTP mode (`--transport http`), the following security measures apply:
|
|
63
|
+
|
|
64
|
+
### **CORS Configuration**
|
|
65
|
+
|
|
66
|
+
- ✅ **Configurable origin** via `--cors-origin` flag or `MCP_CORS_ORIGIN` environment variable
|
|
67
|
+
- ⚠️ **Default: `*`** (allow all origins) for backward compatibility
|
|
68
|
+
- 🔒 **Recommended**: Set a specific origin for production deployments
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Restrict CORS to specific origin
|
|
72
|
+
memory-journal-mcp --transport http --cors-origin "http://localhost:3000"
|
|
73
|
+
|
|
74
|
+
# Or via environment variable
|
|
75
|
+
export MCP_CORS_ORIGIN="http://localhost:3000"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### **Security Headers**
|
|
79
|
+
|
|
80
|
+
- ✅ **X-Content-Type-Options: nosniff** - prevents MIME sniffing
|
|
81
|
+
- ✅ **X-Frame-Options: DENY** - prevents clickjacking
|
|
82
|
+
|
|
83
|
+
### **Session Management (Stateful Mode)**
|
|
84
|
+
|
|
85
|
+
- ✅ **UUID-based session IDs** (cryptographically random)
|
|
86
|
+
- ✅ **30-minute session timeout** - idle sessions automatically expired
|
|
87
|
+
- ✅ **5-minute sweep interval** - periodic cleanup of abandoned sessions
|
|
88
|
+
- ✅ **Explicit session termination** via `DELETE /mcp`
|
|
89
|
+
|
|
90
|
+
### **Request Size Limits**
|
|
91
|
+
|
|
92
|
+
- ✅ **1MB body limit** on JSON requests (prevents memory exhaustion DoS)
|
|
93
|
+
|
|
94
|
+
## 🐙 **GitHub Token Security**
|
|
95
|
+
|
|
96
|
+
### **Token Handling**
|
|
97
|
+
|
|
98
|
+
- ✅ **Environment variables only** - tokens never stored in config files
|
|
99
|
+
- ✅ **Error message scrubbing** - Authorization headers stripped from error logs
|
|
100
|
+
- ✅ **Optional integration** - server works fully offline without GitHub token
|
|
101
|
+
- ✅ **Minimal scopes** - only requires `repo`, `project`, `read:org`
|
|
102
|
+
|
|
103
|
+
### **Environment Variables**
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Required for GitHub features
|
|
107
|
+
GITHUB_TOKEN=ghp_... # GitHub personal access token
|
|
108
|
+
|
|
109
|
+
# Optional
|
|
110
|
+
GITHUB_ORG_TOKEN=ghp_... # For organization projects
|
|
111
|
+
GITHUB_REPO_PATH=/path/to/repo # For auto-detecting owner/repo
|
|
112
|
+
DEFAULT_PROJECT_NUMBER=1 # Default project for issue assignment
|
|
113
|
+
MCP_CORS_ORIGIN=* # CORS origin (default: *)
|
|
114
|
+
MCP_HOST=localhost # Server bind host
|
|
115
|
+
AUTO_REBUILD_INDEX=true # Rebuild vector index on startup
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 🐳 **Docker Security**
|
|
119
|
+
|
|
120
|
+
### **Non-Root User**
|
|
121
|
+
|
|
122
|
+
- ✅ **Dedicated user**: `appuser` (UID 1001) with minimal privileges
|
|
123
|
+
- ✅ **Restricted group**: `appgroup` (GID 1001)
|
|
124
|
+
- ✅ **Restricted data directory**: `700` permissions
|
|
125
|
+
|
|
126
|
+
### **Container Hardening**
|
|
127
|
+
|
|
128
|
+
- ✅ **Minimal base image**: `node:24-alpine`
|
|
129
|
+
- ✅ **Multi-stage build**: Build dependencies not in production image
|
|
130
|
+
- ✅ **Process isolation** from host system
|
|
131
|
+
- ✅ **No shell access needed** for production
|
|
132
|
+
|
|
133
|
+
### **Volume Mounting Security**
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Secure volume mounting
|
|
137
|
+
docker run -v ./data:/app/data:rw,noexec,nosuid,nodev memory-journal-mcp
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### **Resource Limits**
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Apply resource limits
|
|
144
|
+
docker run --memory=1g --cpus=1 memory-journal-mcp
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 🔍 **Data Privacy**
|
|
148
|
+
|
|
149
|
+
### **Local-First Architecture**
|
|
150
|
+
|
|
151
|
+
- ✅ **No external services**: All processing happens locally
|
|
152
|
+
- ✅ **No telemetry**: No data sent to external servers
|
|
153
|
+
- ✅ **Full data ownership**: SQLite database stays on your machine
|
|
154
|
+
- ✅ **Semantic search**: ML model runs locally via `@xenova/transformers`
|
|
155
|
+
|
|
156
|
+
### **Context Security**
|
|
157
|
+
|
|
158
|
+
- ✅ **Git context**: Only reads local repository information
|
|
159
|
+
- ✅ **No sensitive data**: Doesn't access private keys or credentials
|
|
160
|
+
- ✅ **Optional GitHub integration**: Only if explicitly configured with token
|
|
161
|
+
|
|
162
|
+
## 🔄 **CI/CD Security**
|
|
163
|
+
|
|
164
|
+
- ✅ **CodeQL analysis** - automated static analysis on push/PR
|
|
165
|
+
- ✅ **Trivy container scanning** - Docker image vulnerability detection
|
|
166
|
+
- ✅ **TruffleHog + Gitleaks** - secret scanning on push/PR
|
|
167
|
+
- ✅ **npm audit** - dependency vulnerability checking
|
|
168
|
+
- ✅ **Dependabot** - automated dependency update PRs
|
|
169
|
+
|
|
170
|
+
## 🚨 **Security Best Practices**
|
|
171
|
+
|
|
172
|
+
### **For Users**
|
|
173
|
+
|
|
174
|
+
1. **Set a CORS origin** when exposing the HTTP transport on a network
|
|
175
|
+
2. **Keep Node.js updated**: Use Node.js 24+ (LTS)
|
|
176
|
+
3. **Secure host system**: Ensure your host machine is secure
|
|
177
|
+
4. **Regular backups**: Use the `backup_journal` tool or back up your `.db` file
|
|
178
|
+
5. **Limit network access**: Don't expose the HTTP transport to untrusted networks
|
|
179
|
+
6. **Use resource limits**: Apply Docker `--memory` and `--cpus` limits
|
|
180
|
+
|
|
181
|
+
### **For Developers**
|
|
182
|
+
|
|
183
|
+
1. **Regular updates**: Keep Node.js and npm dependencies updated
|
|
184
|
+
2. **Security scanning**: Regularly scan Docker images for vulnerabilities
|
|
185
|
+
3. **Code review**: All database operations use parameterized queries
|
|
186
|
+
4. **Input validation**: All tool inputs validated via Zod schemas
|
|
187
|
+
|
|
188
|
+
## 📋 **Security Checklist**
|
|
189
|
+
|
|
190
|
+
- [x] WAL mode enabled for database consistency
|
|
191
|
+
- [x] Proper file permissions (600/700)
|
|
192
|
+
- [x] Input validation and length limits (Zod schemas)
|
|
193
|
+
- [x] Parameterized SQL queries
|
|
194
|
+
- [x] SQL injection detection heuristics
|
|
195
|
+
- [x] Path traversal protection
|
|
196
|
+
- [x] LIKE pattern sanitization
|
|
197
|
+
- [x] Date format whitelisting
|
|
198
|
+
- [x] HTTP body size limit (1MB)
|
|
199
|
+
- [x] Configurable CORS origin
|
|
200
|
+
- [x] Security headers (X-Content-Type-Options, X-Frame-Options)
|
|
201
|
+
- [x] Session timeout (30 minutes)
|
|
202
|
+
- [x] Non-root Docker user
|
|
203
|
+
- [x] Multi-stage Docker build
|
|
204
|
+
- [x] Local-first data architecture
|
|
205
|
+
- [x] GitHub token error scrubbing
|
|
206
|
+
- [x] CI/CD security pipeline (CodeQL, Trivy, secret scanning)
|
|
207
|
+
- [x] Comprehensive security documentation
|
|
208
|
+
|
|
209
|
+
## 🚨 **Reporting Security Issues**
|
|
210
|
+
|
|
211
|
+
If you discover a security vulnerability, please:
|
|
212
|
+
|
|
213
|
+
1. **Do not** open a public GitHub issue
|
|
214
|
+
2. **Contact** the maintainers privately
|
|
215
|
+
3. **Provide** detailed information about the vulnerability
|
|
216
|
+
4. **Allow** time for the issue to be addressed before public disclosure
|
|
217
|
+
|
|
218
|
+
## 🔄 **Security Updates**
|
|
219
|
+
|
|
220
|
+
- **Container updates**: Rebuild Docker images when base images are updated
|
|
221
|
+
- **Dependency updates**: Keep npm packages updated via `npm audit` and Dependabot
|
|
222
|
+
- **Database maintenance**: Run `ANALYZE` and `PRAGMA optimize` regularly
|
|
223
|
+
- **Security patches**: Apply host system security updates
|
|
224
|
+
|
|
225
|
+
The Memory Journal MCP server is designed with **security-first principles** to protect your personal journal data while maintaining excellent performance and usability.
|
package/dist/cli.js
CHANGED
|
@@ -12,25 +12,31 @@ program
|
|
|
12
12
|
.version(pkg.version)
|
|
13
13
|
.option('--transport <type>', 'Transport type: stdio or http', 'stdio')
|
|
14
14
|
.option('--port <number>', 'HTTP port (for http transport)', '3000')
|
|
15
|
+
.option('--server-host <host>', 'Server bind host for HTTP transport (default: localhost)')
|
|
15
16
|
.option('--stateless', 'Use stateless HTTP mode (no session management)')
|
|
16
17
|
.option('--db <path>', 'Database path', './memory_journal.db')
|
|
17
18
|
.option('--tool-filter <filter>', 'Tool filter string (e.g., "starter", "core,search")')
|
|
18
19
|
.option('--default-project <number>', 'Default GitHub Project number')
|
|
19
20
|
.option('--auto-rebuild-index', 'Rebuild vector index on server startup')
|
|
21
|
+
.option('--cors-origin <origin>', 'CORS allowed origin for HTTP transport (default: *)')
|
|
20
22
|
.option('--log-level <level>', 'Log level: debug, info, warning, error', 'info')
|
|
21
23
|
.action(async (options) => {
|
|
22
24
|
// Set log level
|
|
23
25
|
logger.setLevel(options.logLevel);
|
|
26
|
+
// Resolve host: CLI flag > env var > default (localhost)
|
|
27
|
+
const host = options.serverHost ?? process.env['MCP_HOST'] ?? process.env['HOST'] ?? undefined;
|
|
24
28
|
logger.info('Starting Memory Journal MCP Server', {
|
|
25
29
|
module: 'CLI',
|
|
26
30
|
transport: options.transport,
|
|
27
31
|
stateless: options.stateless ?? false,
|
|
28
32
|
db: options.db,
|
|
33
|
+
...(host ? { host } : {}),
|
|
29
34
|
});
|
|
30
35
|
try {
|
|
31
36
|
await createServer({
|
|
32
37
|
transport: options.transport,
|
|
33
38
|
port: parseInt(options.port, 10),
|
|
39
|
+
host,
|
|
34
40
|
statelessHttp: options.stateless === true,
|
|
35
41
|
dbPath: options.db,
|
|
36
42
|
toolFilter: options.toolFilter,
|
|
@@ -40,6 +46,7 @@ program
|
|
|
40
46
|
? parseInt(process.env['DEFAULT_PROJECT_NUMBER'], 10)
|
|
41
47
|
: undefined,
|
|
42
48
|
autoRebuildIndex: options.autoRebuildIndex ?? process.env['AUTO_REBUILD_INDEX'] === 'true',
|
|
49
|
+
corsOrigin: options.corsOrigin,
|
|
43
50
|
});
|
|
44
51
|
}
|
|
45
52
|
catch (error) {
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAEvD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO;KACF,IAAI,CAAC,oBAAoB,CAAC;KAC1B,WAAW,CAAC,wDAAwD,CAAC;KACrE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;KACpB,MAAM,CAAC,oBAAoB,EAAE,+BAA+B,EAAE,OAAO,CAAC;KACtE,MAAM,CAAC,iBAAiB,EAAE,gCAAgC,EAAE,MAAM,CAAC;KACnE,MAAM,CAAC,aAAa,EAAE,iDAAiD,CAAC;KACxE,MAAM,CAAC,aAAa,EAAE,eAAe,EAAE,qBAAqB,CAAC;KAC7D,MAAM,CAAC,wBAAwB,EAAE,qDAAqD,CAAC;KACvF,MAAM,CAAC,4BAA4B,EAAE,+BAA+B,CAAC;KACrE,MAAM,CAAC,sBAAsB,EAAE,wCAAwC,CAAC;KACxE,MAAM,CAAC,qBAAqB,EAAE,wCAAwC,EAAE,MAAM,CAAC;KAC/E,MAAM,CACH,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"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"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* These instructions are automatically sent to MCP clients during initialization,
|
|
5
5
|
* providing guidance for AI agents on tool usage.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Unreleased: Optimized for token efficiency with tiered instruction levels.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Resource definition for instruction generation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerInstructions.d.ts","sourceRoot":"","sources":["../../src/constants/ServerInstructions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAClB;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"ServerInstructions.d.ts","sourceRoot":"","sources":["../../src/constants/ServerInstructions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAClB;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAA;AAmOhE;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAChC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,EACzB,UAAU,EAAE,kBAAkB,EAAE,EAChC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,WAAW,CAAC,EAAE,mBAAmB,EACjC,KAAK,GAAE,gBAA6B,GACrC,MAAM,CAuCR;AAkBD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAA+C,CAAA"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* These instructions are automatically sent to MCP clients during initialization,
|
|
5
5
|
* providing guidance for AI agents on tool usage.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Unreleased: Optimized for token efficiency with tiered instruction levels.
|
|
8
8
|
*/
|
|
9
9
|
import { TOOL_GROUPS } from '../filtering/ToolFilter.js';
|
|
10
10
|
/**
|
|
@@ -41,6 +41,7 @@ const GITHUB_INSTRUCTIONS = `
|
|
|
41
41
|
- After closing issue/merging PR → create summary entry with learnings
|
|
42
42
|
- CI failures → \`actions-failure-digest\` prompt or \`memory://actions/recent\`
|
|
43
43
|
- Kanban: \`get_kanban_board(project_number)\` → \`move_kanban_item\` → document completion
|
|
44
|
+
- Milestones: \`get_github_milestones\` → track project progress, \`memory://github/milestones\`
|
|
44
45
|
- GitHub tools auto-detect owner/repo from git context; specify explicitly if null
|
|
45
46
|
`;
|
|
46
47
|
/**
|
|
@@ -81,10 +82,10 @@ const TOOL_PARAMETER_REFERENCE = `
|
|
|
81
82
|
### Entry Operations
|
|
82
83
|
| Tool | Required Parameters | Optional Parameters |
|
|
83
84
|
|------|---------------------|---------------------|
|
|
84
|
-
| \`create_entry\` | \`content\` (string) | \`entry_type\`, \`tags\` (array), \`is_personal\`
|
|
85
|
+
| \`create_entry\` | \`content\` (string) | \`entry_type\`, \`tags\` (array), \`is_personal\`, \`significance_type\`, \`share_with_team\`, \`auto_context\`, \`issue_number\`, \`issue_url\`, \`pr_number\`, \`pr_url\`, \`pr_status\`, \`project_number\`, \`project_owner\`, \`workflow_run_id\`, \`workflow_name\`, \`workflow_status\` |
|
|
85
86
|
| \`create_entry_minimal\` | \`content\` (string) | none |
|
|
86
|
-
| \`get_entry_by_id\` | \`entry_id\` (number) |
|
|
87
|
-
| \`get_recent_entries\` | none | \`limit\` (default
|
|
87
|
+
| \`get_entry_by_id\` | \`entry_id\` (number) | \`include_relationships\` (bool, default true) |
|
|
88
|
+
| \`get_recent_entries\` | none | \`limit\` (default 5), \`is_personal\` (bool) |
|
|
88
89
|
| \`update_entry\` | \`entry_id\` (number) | \`content\`, \`tags\`, \`entry_type\`, \`is_personal\` |
|
|
89
90
|
| \`delete_entry\` | \`entry_id\` (number) | \`permanent\` (bool, default false) |
|
|
90
91
|
| \`list_tags\` | none | none |
|
|
@@ -92,33 +93,40 @@ const TOOL_PARAMETER_REFERENCE = `
|
|
|
92
93
|
### Search Tools
|
|
93
94
|
| Tool | Required Parameters | Optional Parameters |
|
|
94
95
|
|------|---------------------|---------------------|
|
|
95
|
-
| \`search_entries\` | \`query\`
|
|
96
|
-
| \`search_by_date_range\` | \`start_date\`, \`end_date\` (YYYY-MM-DD) | \`tags\`, \`entry_type\` |
|
|
97
|
-
| \`semantic_search\` | \`query\` (string) | \`limit\`, \`similarity_threshold\` (default 0.
|
|
96
|
+
| \`search_entries\` | none | \`query\`, \`limit\`, \`is_personal\`, \`issue_number\`, \`pr_number\`, \`pr_status\`, \`project_number\`, \`workflow_run_id\` |
|
|
97
|
+
| \`search_by_date_range\` | \`start_date\`, \`end_date\` (YYYY-MM-DD) | \`tags\`, \`entry_type\`, \`is_personal\`, \`issue_number\`, \`pr_number\`, \`project_number\`, \`workflow_run_id\` |
|
|
98
|
+
| \`semantic_search\` | \`query\` (string) | \`limit\`, \`similarity_threshold\` (default 0.25), \`is_personal\`, \`hint_on_empty\` (bool, default true) |
|
|
98
99
|
| \`get_vector_index_stats\` | none | none |
|
|
99
100
|
|
|
100
101
|
### Relationship Tools
|
|
101
102
|
| Tool | Required Parameters | Notes |
|
|
102
103
|
|------|---------------------|-------|
|
|
103
|
-
| \`link_entries\` | \`from_entry_id\`, \`to_entry_id\` (numbers) | Types: \`evolves_from\`, \`references\`, \`implements\`, \`clarifies\`, \`response_to\`, \`blocked_by\`, \`resolved\`, \`caused\` |
|
|
104
|
-
| \`visualize_relationships\` | \`entry_id\` (
|
|
104
|
+
| \`link_entries\` | \`from_entry_id\`, \`to_entry_id\` (numbers) | Types: \`evolves_from\`, \`references\`, \`implements\`, \`clarifies\`, \`response_to\`, \`blocked_by\`, \`resolved\`, \`caused\`. Optional \`description\`. |
|
|
105
|
+
| \`visualize_relationships\` | none | Optional \`entry_id\`, \`tags\` (array), \`depth\` (1-3, default 2), \`limit\` (default 20). Returns Mermaid diagram. |
|
|
105
106
|
|
|
106
107
|
### GitHub Tools
|
|
107
108
|
| Tool | Required Parameters | Notes |
|
|
108
109
|
|------|---------------------|-------|
|
|
109
|
-
| \`get_github_context\` | none | Returns repo info, open issues/PRs |
|
|
110
|
-
| \`get_github_issues\` | none | Optional \`state\` (open/closed/all), \`limit\` |
|
|
111
|
-
| \`get_github_prs\` | none | Optional \`state\`, \`limit\` |
|
|
112
|
-
| \`get_github_issue\` | \`issue_number\` (number) | Fetches single issue details |
|
|
113
|
-
| \`get_github_pr\` | \`pr_number\` (number) | Fetches single PR details |
|
|
110
|
+
| \`get_github_context\` | none | Returns repo info, open issues/PRs. Only counts OPEN items. |
|
|
111
|
+
| \`get_github_issues\` | none | Optional \`state\` (open/closed/all), \`limit\`, \`owner\`, \`repo\` |
|
|
112
|
+
| \`get_github_prs\` | none | Optional \`state\`, \`limit\`, \`owner\`, \`repo\` |
|
|
113
|
+
| \`get_github_issue\` | \`issue_number\` (number) | Optional \`owner\`, \`repo\`. Fetches single issue details. |
|
|
114
|
+
| \`get_github_pr\` | \`pr_number\` (number) | Optional \`owner\`, \`repo\`. Fetches single PR details. |
|
|
115
|
+
| \`get_repo_insights\` | none | Optional \`sections\` (stars/traffic/referrers/paths/all, default "stars"), \`owner\`, \`repo\`. Requires push access for traffic. |
|
|
114
116
|
|
|
115
117
|
GitHub tools auto-detect owner/repo from GITHUB_REPO_PATH. If \`detectedOwner\`/\`detectedRepo\` are null in response, specify \`owner\` and \`repo\` parameters explicitly.
|
|
116
118
|
|
|
119
|
+
### Issue Lifecycle Tools
|
|
120
|
+
| Tool | Required Parameters | Notes |
|
|
121
|
+
|------|---------------------|-------|
|
|
122
|
+
| \`create_github_issue_with_entry\` | \`title\` (string) | Optional \`body\`, \`labels\` (array), \`assignees\` (array), \`project_number\`, \`initial_status\`, \`milestone_number\`, \`entry_content\`, \`tags\`, \`owner\`, \`repo\` |
|
|
123
|
+
| \`close_github_issue_with_entry\` | \`issue_number\` (number) | Optional \`comment\`, \`resolution_notes\`, \`tags\`, \`move_to_done\` (bool), \`project_number\`, \`owner\`, \`repo\` |
|
|
124
|
+
|
|
117
125
|
### Kanban Tools (GitHub Projects v2)
|
|
118
126
|
| Tool | Required Parameters | Notes |
|
|
119
127
|
|------|---------------------|-------|
|
|
120
|
-
| \`get_kanban_board\` | \`project_number\` (number) | Returns columns with items grouped by Status |
|
|
121
|
-
| \`move_kanban_item\` | \`project_number\`, \`item_id\` (string), \`target_status\` (string) | \`item_id\` is the GraphQL node ID from board items |
|
|
128
|
+
| \`get_kanban_board\` | \`project_number\` (number) | Optional \`owner\`. Returns columns with items grouped by Status |
|
|
129
|
+
| \`move_kanban_item\` | \`project_number\`, \`item_id\` (string), \`target_status\` (string) | Optional \`owner\`. \`item_id\` is the GraphQL node ID from board items. Status matching is case-insensitive. |
|
|
122
130
|
|
|
123
131
|
**Finding the right project**: User may have multiple projects. Use \`get_kanban_board\` with different project numbers (1, 2, 3...) to find the correct one by checking \`projectTitle\`.
|
|
124
132
|
|
|
@@ -135,33 +143,53 @@ Kanban resources:
|
|
|
135
143
|
- \`memory://kanban/{project_number}\` - JSON board data
|
|
136
144
|
- \`memory://kanban/{project_number}/diagram\` - Mermaid visualization
|
|
137
145
|
|
|
146
|
+
### Milestone Tools
|
|
147
|
+
| Tool | Required Parameters | Notes |
|
|
148
|
+
|------|---------------------|-------|
|
|
149
|
+
| \`get_github_milestones\` | none | Optional \`state\` (open/closed/all), \`limit\`, \`owner\`, \`repo\` |
|
|
150
|
+
| \`get_github_milestone\` | \`milestone_number\` (number) | Optional \`owner\`, \`repo\`. Single milestone with completion %. |
|
|
151
|
+
| \`create_github_milestone\` | \`title\` (string) | Optional \`description\`, \`due_on\` (YYYY-MM-DD), \`owner\`, \`repo\` |
|
|
152
|
+
| \`update_github_milestone\` | \`milestone_number\` (number) | Optional \`title\`, \`description\`, \`due_on\`, \`state\` (open/closed), \`owner\`, \`repo\` |
|
|
153
|
+
| \`delete_github_milestone\` | \`milestone_number\`, \`confirm: true\` | Optional \`owner\`, \`repo\`. Permanent deletion. |
|
|
154
|
+
|
|
155
|
+
Milestone resources:
|
|
156
|
+
- \`memory://github/milestones\` - Open milestones with completion %
|
|
157
|
+
- \`memory://milestones/{number}\` - Single milestone detail
|
|
158
|
+
|
|
138
159
|
### Admin Tools
|
|
139
160
|
| Tool | Required Parameters | Notes |
|
|
140
161
|
|------|---------------------|-------|
|
|
141
|
-
| \`backup_journal\` | none | Optional \`
|
|
162
|
+
| \`backup_journal\` | none | Optional \`name\` (custom backup name) |
|
|
142
163
|
| \`list_backups\` | none | Returns available backup files |
|
|
143
|
-
| \`
|
|
164
|
+
| \`cleanup_backups\` | none | Optional \`keep_count\` (default 5). Deletes old backups, keeps N most recent. |
|
|
165
|
+
| \`restore_backup\` | \`filename\`, \`confirm: true\` | Creates auto-backup before restore |
|
|
144
166
|
| \`add_to_vector_index\` | \`entry_id\` (single number) | Indexes one entry for semantic search |
|
|
145
167
|
| \`rebuild_vector_index\` | none | Re-indexes all entries |
|
|
146
168
|
|
|
147
169
|
### Export Tools
|
|
148
170
|
| Tool | Required Parameters | Notes |
|
|
149
171
|
|------|---------------------|-------|
|
|
150
|
-
| \`export_entries\` | none | Optional \`format\` (json/markdown), \`limit
|
|
172
|
+
| \`export_entries\` | none | Optional \`format\` (json/markdown), \`limit\` (default 100), \`tags\`, \`start_date\`, \`end_date\`, \`entry_types\` |
|
|
151
173
|
|
|
152
174
|
## Entry Types
|
|
153
175
|
Valid values for \`entry_type\` parameter:
|
|
154
176
|
- \`personal_reflection\` (default) - Personal thoughts and notes
|
|
155
|
-
- \`
|
|
177
|
+
- \`project_decision\` - Architectural and team decisions
|
|
178
|
+
- \`technical_achievement\` - Milestones and breakthroughs
|
|
156
179
|
- \`bug_fix\` - Bug fixes and resolutions
|
|
157
|
-
- \`
|
|
180
|
+
- \`feature_implementation\` - Feature builds and rollouts
|
|
158
181
|
- \`code_review\` - Code review notes
|
|
159
|
-
- \`
|
|
160
|
-
- \`
|
|
182
|
+
- \`meeting_notes\` - Meeting summaries
|
|
183
|
+
- \`learning\` - Learning and research insights
|
|
184
|
+
- \`research\` - Research and exploration
|
|
185
|
+
- \`planning\` - Planning sessions and roadmaps (\`create_github_issue_with_entry\` uses this type)
|
|
186
|
+
- \`retrospective\` - Sprint and project retrospectives
|
|
187
|
+
- \`standup\` - Daily standup notes
|
|
188
|
+
- \`other\` - Miscellaneous
|
|
161
189
|
|
|
162
190
|
## Field Notes
|
|
163
191
|
- **\`autoContext\`**: Reserved for future automatic context capture. Currently always \`null\`.
|
|
164
|
-
- **\`memory://tags\` vs \`list_tags\`**: Resource includes \`id\`, \`name\`, \`count\`; tool returns only \`name\`, \`count\`.
|
|
192
|
+
- **\`memory://tags\` vs \`list_tags\`**: Resource includes \`id\`, \`name\`, \`count\`; tool returns only \`name\`, \`count\`. Neither returns orphan tags with zero usage.
|
|
165
193
|
- **Tag naming**: Use lowercase with dashes (e.g., \`bug-fix\`, \`phase-2\`). Use \`merge_tags\` to consolidate duplicates (e.g., merge \`phase2\` into \`phase-2\`).
|
|
166
194
|
- **\`merge_tags\` behavior**: Only updates non-deleted entries. Deleted entries retain their original tags.
|
|
167
195
|
- **\`prStatus\` in entries**: Reflects PR state at entry creation time, not current state. Use \`get_github_pr\` for live status.
|
|
@@ -170,19 +198,35 @@ Valid values for \`entry_type\` parameter:
|
|
|
170
198
|
- **\`semantic_search\` thresholds**: Default similarity threshold is 0.25. For broader matches, try 0.15-0.2. Higher values (0.4+) return only very close semantic matches.
|
|
171
199
|
- **Causal relationship types**: Use \`blocked_by\` (A was blocked by B), \`resolved\` (A resolved B), \`caused\` (A caused B) for decision tracing and failure analysis. Visualizations use distinct arrow styles for causal types.
|
|
172
200
|
- **Enhanced analytics**: \`get_statistics\` returns \`decisionDensity\` (significant entries per period), \`relationshipComplexity\` (avg relationships per entry), \`activityTrend\` (period-over-period growth %), and \`causalMetrics\` (counts for blocked_by/resolved/caused).
|
|
173
|
-
- **Importance scores**: \`get_entry_by_id\` returns
|
|
201
|
+
- **Importance scores**: \`get_entry_by_id\` returns \`importance\` (0.0-1.0) and \`importanceBreakdown\` showing weighted components: significance (30%), relationships (35%), causal (20%), recency (15%). \`memory://significant\` sorts entries by importance.
|
|
202
|
+
- **\`inactiveThresholdDays\`**: \`get_cross_project_insights\` includes \`inactiveThresholdDays: 7\` in output, documenting the inactive project classification cutoff.
|
|
203
|
+
- **GitHub metadata in entries**: Entry output includes 10 GitHub fields (\`issueNumber\`, \`issueUrl\`, \`prNumber\`, \`prUrl\`, \`prStatus\`, \`projectNumber\`, \`projectOwner\`, \`workflowRunId\`, \`workflowName\`, \`workflowStatus\`) in all tool responses.
|
|
204
|
+
- **\`delete_entry\` on soft-deleted**: \`delete_entry(id, permanent: true)\` works on previously soft-deleted entries. Returns \`success: false\` for nonexistent entries.
|
|
174
205
|
|
|
175
206
|
## Key Resources
|
|
176
207
|
| URI | Description |
|
|
177
208
|
|-----|-------------|
|
|
178
209
|
| \`memory://health\` | Server health, DB stats, tool filter status |
|
|
179
210
|
| \`memory://briefing\` | Session context with userMessage to show user |
|
|
211
|
+
| \`memory://instructions\` | Full server instructions and tool reference |
|
|
180
212
|
| \`memory://statistics\` | Entry counts by type and period |
|
|
181
213
|
| \`memory://recent\` | 10 most recent entries |
|
|
182
214
|
| \`memory://tags\` | All tags with usage counts |
|
|
183
|
-
| \`memory://significant\` | Entries
|
|
215
|
+
| \`memory://significant\` | Entries sorted by importance score |
|
|
184
216
|
| \`memory://graph/recent\` | Mermaid diagram of recent relationships |
|
|
217
|
+
| \`memory://graph/actions\` | CI/CD narrative graph |
|
|
218
|
+
| \`memory://actions/recent\` | Recent workflow runs |
|
|
219
|
+
| \`memory://team/recent\` | Team-shared entries |
|
|
220
|
+
| \`memory://github/status\` | GitHub repo overview (CI, issues, PRs, milestones) |
|
|
221
|
+
| \`memory://github/milestones\` | Open milestones with completion % |
|
|
222
|
+
| \`memory://github/insights\` | Stars, forks, and 14-day traffic summary |
|
|
185
223
|
| \`memory://kanban/{n}\` | Kanban board for project number n |
|
|
224
|
+
| \`memory://kanban/{n}/diagram\` | Mermaid Kanban visualization |
|
|
225
|
+
| \`memory://milestones/{n}\` | Single milestone detail + progress |
|
|
226
|
+
| \`memory://projects/{n}/timeline\` | Project entries timeline |
|
|
227
|
+
| \`memory://issues/{n}/entries\` | Entries linked to issue n |
|
|
228
|
+
| \`memory://prs/{n}/entries\` | Entries linked to PR n |
|
|
229
|
+
| \`memory://prs/{n}/timeline\` | PR lifecycle and linked entries |
|
|
186
230
|
`;
|
|
187
231
|
/**
|
|
188
232
|
* Generate dynamic instructions based on enabled tools, resources, prompts, and latest entry
|