claude-session-continuity-mcp 1.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/LICENSE +21 -0
- package/README.md +307 -0
- package/dist/dashboard-v2.d.ts +11 -0
- package/dist/dashboard-v2.js +1321 -0
- package/dist/dashboard.d.ts +2 -0
- package/dist/dashboard.js +1196 -0
- package/dist/db/database.d.ts +8 -0
- package/dist/db/database.js +208 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3426 -0
- package/dist/schemas.d.ts +381 -0
- package/dist/schemas.js +119 -0
- package/dist/tools/context.d.ts +6 -0
- package/dist/tools/context.js +227 -0
- package/dist/tools/embedding.d.ts +5 -0
- package/dist/tools/embedding.js +191 -0
- package/dist/tools/feedback.d.ts +5 -0
- package/dist/tools/feedback.js +200 -0
- package/dist/tools/filter.d.ts +5 -0
- package/dist/tools/filter.js +169 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.js +38 -0
- package/dist/tools/learning.d.ts +8 -0
- package/dist/tools/learning.js +395 -0
- package/dist/tools/memory.d.ts +8 -0
- package/dist/tools/memory.js +356 -0
- package/dist/tools/project.d.ts +9 -0
- package/dist/tools/project.js +396 -0
- package/dist/tools/relation.d.ts +4 -0
- package/dist/tools/relation.js +148 -0
- package/dist/tools/session.d.ts +7 -0
- package/dist/tools/session.js +272 -0
- package/dist/tools/solution.d.ts +5 -0
- package/dist/tools/solution.js +182 -0
- package/dist/tools/task.d.ts +6 -0
- package/dist/tools/task.js +184 -0
- package/dist/tools-v2/auto-capture.d.ts +5 -0
- package/dist/tools-v2/auto-capture.js +252 -0
- package/dist/tools-v2/context.d.ts +4 -0
- package/dist/tools-v2/context.js +170 -0
- package/dist/tools-v2/embedding.d.ts +3 -0
- package/dist/tools-v2/embedding.js +115 -0
- package/dist/tools-v2/index.d.ts +13 -0
- package/dist/tools-v2/index.js +73 -0
- package/dist/tools-v2/learn.d.ts +4 -0
- package/dist/tools-v2/learn.js +233 -0
- package/dist/tools-v2/memory.d.ts +6 -0
- package/dist/tools-v2/memory.js +340 -0
- package/dist/tools-v2/projects.d.ts +3 -0
- package/dist/tools-v2/projects.js +218 -0
- package/dist/tools-v2/task.d.ts +3 -0
- package/dist/tools-v2/task.js +193 -0
- package/dist/tools-v2/verify.d.ts +3 -0
- package/dist/tools-v2/verify.js +164 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.js +7 -0
- package/dist/utils/auto-context.d.ts +58 -0
- package/dist/utils/auto-context.js +234 -0
- package/dist/utils/cache.d.ts +60 -0
- package/dist/utils/cache.js +161 -0
- package/dist/utils/embedding.d.ts +7 -0
- package/dist/utils/embedding.js +67 -0
- package/dist/utils/helpers.d.ts +4 -0
- package/dist/utils/helpers.js +45 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.js +111 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Byeongchang Lee
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# claude-session-continuity-mcp
|
|
2
|
+
|
|
3
|
+
> **Session Continuity for Claude Code** — Never re-explain your project again
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/claude-session-continuity-mcp)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[]()
|
|
8
|
+
[]()
|
|
9
|
+
|
|
10
|
+
## The Problem
|
|
11
|
+
|
|
12
|
+
Every new Claude Code session:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
"This is a Next.js 15 project with App Router..."
|
|
16
|
+
"We decided to use Server Actions because..."
|
|
17
|
+
"Last time we were working on the auth system..."
|
|
18
|
+
"The build command is pnpm build..."
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**5 minutes of context-setting. Every. Single. Time.**
|
|
22
|
+
|
|
23
|
+
## The Solution
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Session starts → Context auto-loads in <5ms
|
|
27
|
+
session_start({ project: "my-app" })
|
|
28
|
+
|
|
29
|
+
# → "my-app: Next.js 15 + TypeScript
|
|
30
|
+
# Decisions: App Router, Server Actions, Zod validation
|
|
31
|
+
# State: Auth complete, working on signup
|
|
32
|
+
# Tasks: [P8] Implement signup form"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Your project memory, instantly restored.**
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install claude-session-continuity-mcp
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Claude Code Configuration
|
|
48
|
+
|
|
49
|
+
Add to `~/.claude.json` or `.mcp.json`:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"session-continuity": {
|
|
55
|
+
"command": "npx",
|
|
56
|
+
"args": ["claude-session-continuity-mcp"],
|
|
57
|
+
"env": {
|
|
58
|
+
"WORKSPACE_ROOT": "/path/to/your/workspace"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### That's it. Start using it.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
| Feature | Description |
|
|
72
|
+
|---------|-------------|
|
|
73
|
+
| 🔄 **Auto Context Capture** | `session_start` / `session_end` automatically save and restore |
|
|
74
|
+
| ⚡ **<5ms Context Loading** | LRU caching for instant project recall |
|
|
75
|
+
| 🧠 **Semantic Search** | Find memories by meaning, not just keywords |
|
|
76
|
+
| ✅ **Integrated Verification** | Run build/test/lint with one command |
|
|
77
|
+
| 📝 **Architecture Decisions** | Track why you made technical choices |
|
|
78
|
+
| 📋 **Task Management** | Prioritized backlog that persists |
|
|
79
|
+
| 🎓 **Auto-Learning** | Remembers error fixes and patterns |
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Why Not Use...?
|
|
84
|
+
|
|
85
|
+
| Tool | What It Does | Why This Is Different |
|
|
86
|
+
|------|--------------|----------------------|
|
|
87
|
+
| **mcp-memory-service** | Generic AI memory (13+ tools) | **Claude Code optimized**, project-centric |
|
|
88
|
+
| **Official Memory** | Simple key-value store | **Automatic capture**, semantic search |
|
|
89
|
+
| **SESSION.md files** | Manual markdown files | **Zero manual work**, structured data |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Tools (v2 API) - 15 Focused Tools
|
|
94
|
+
|
|
95
|
+
### Session Lifecycle ⭐
|
|
96
|
+
|
|
97
|
+
```javascript
|
|
98
|
+
// Start of session - auto-loads context
|
|
99
|
+
session_start({ project: "my-app", compact: true })
|
|
100
|
+
|
|
101
|
+
// End of session - auto-saves context
|
|
102
|
+
session_end({
|
|
103
|
+
project: "my-app",
|
|
104
|
+
currentState: "Completed auth flow",
|
|
105
|
+
recentFiles: ["src/auth.ts", "src/login/page.tsx"]
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
// Get summary with token estimate
|
|
109
|
+
session_summary({ project: "my-app" })
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Context Management
|
|
113
|
+
|
|
114
|
+
```javascript
|
|
115
|
+
// Get project context
|
|
116
|
+
context_get({ project: "my-app" })
|
|
117
|
+
|
|
118
|
+
// Update context
|
|
119
|
+
context_update({
|
|
120
|
+
project: "my-app",
|
|
121
|
+
techStack: { framework: "Next.js 15", language: "TypeScript" },
|
|
122
|
+
architectureDecisions: ["App Router", "Server Actions"]
|
|
123
|
+
})
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Memory Operations
|
|
127
|
+
|
|
128
|
+
```javascript
|
|
129
|
+
// Store a memory
|
|
130
|
+
memory_store({
|
|
131
|
+
project: "my-app",
|
|
132
|
+
type: "decision",
|
|
133
|
+
content: "Using Zod for runtime validation",
|
|
134
|
+
importance: 8,
|
|
135
|
+
tags: ["validation", "architecture"]
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
// Search memories (FTS or semantic)
|
|
139
|
+
memory_search({
|
|
140
|
+
query: "validation approach",
|
|
141
|
+
semantic: true // Uses embeddings
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Verification
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
// Run build + test + lint
|
|
149
|
+
verify({ project: "my-app" })
|
|
150
|
+
|
|
151
|
+
// Run specific gates
|
|
152
|
+
verify({ project: "my-app", gates: ["build", "test"] })
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Auto-Learning
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
// Learn from an error fix
|
|
159
|
+
learn({
|
|
160
|
+
project: "my-app",
|
|
161
|
+
type: "fix",
|
|
162
|
+
content: "TypeError: Cannot read property 'id'",
|
|
163
|
+
solution: "Use optional chaining: user?.id"
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
// Find similar solutions
|
|
167
|
+
recall_solution({ query: "TypeError property undefined" })
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## v2 Mode (Recommended)
|
|
173
|
+
|
|
174
|
+
Use only the 15 focused v2 tools:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"env": {
|
|
179
|
+
"WORKSPACE_ROOT": "/path/to/workspace",
|
|
180
|
+
"MCP_V2_ONLY": "true"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
<details>
|
|
186
|
+
<summary>Legacy v1 tools (46 tools) - Click to expand</summary>
|
|
187
|
+
|
|
188
|
+
Still available for backwards compatibility:
|
|
189
|
+
|
|
190
|
+
`list_projects`, `detect_platform`, `get_tech_stack`, `get_project_stats`,
|
|
191
|
+
`get_session`, `update_session`, `save_session_history`, `get_session_history`,
|
|
192
|
+
`run_verification`, `search_similar_work`, `record_work_pattern`, `get_work_patterns`,
|
|
193
|
+
`store_memory`, `recall_memory`, `recall_by_timeframe`, `search_by_tag`,
|
|
194
|
+
`delete_memory`, `get_memory_stats`, `semantic_search`, `get_embedding_status`,
|
|
195
|
+
`rebuild_embeddings`, `create_relation`, `find_connected_memories`,
|
|
196
|
+
`collect_work_feedback`, `get_pending_feedbacks`, `resolve_feedback`,
|
|
197
|
+
`record_filter_pattern`, `get_filter_patterns`, `get_safe_output_guidelines`,
|
|
198
|
+
`auto_learn_decision`, `auto_learn_fix`, `auto_learn_pattern`, `auto_learn_dependency`,
|
|
199
|
+
`get_project_knowledge`, `get_similar_issues`, `get_project_context`,
|
|
200
|
+
`init_project_context`, `update_active_context`, `update_architecture_decision`,
|
|
201
|
+
`add_task`, `complete_task`, `update_task_status`, `get_pending_tasks`,
|
|
202
|
+
`record_solution`, `find_solution`, `get_continuity_stats`
|
|
203
|
+
|
|
204
|
+
</details>
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Data Storage
|
|
209
|
+
|
|
210
|
+
SQLite database at `~/.claude/sessions.db`:
|
|
211
|
+
|
|
212
|
+
| Table | Purpose |
|
|
213
|
+
|-------|---------|
|
|
214
|
+
| `memories` | Learnings, decisions, errors |
|
|
215
|
+
| `memories_fts` | Full-text search index |
|
|
216
|
+
| `embeddings` | Semantic search vectors |
|
|
217
|
+
| `project_context` | Fixed project info |
|
|
218
|
+
| `active_context` | Current work state |
|
|
219
|
+
| `tasks` | Task backlog |
|
|
220
|
+
| `resolved_issues` | Error solution archive |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Environment Variables
|
|
225
|
+
|
|
226
|
+
| Variable | Default | Description |
|
|
227
|
+
|----------|---------|-------------|
|
|
228
|
+
| `WORKSPACE_ROOT` | - | Workspace root path (required) |
|
|
229
|
+
| `MCP_V2_ONLY` | `false` | Use only v2 tools |
|
|
230
|
+
| `LOG_LEVEL` | `info` | Log level (debug/info/warn/error) |
|
|
231
|
+
| `LOG_FILE` | - | Optional file logging path |
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Development
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Clone
|
|
239
|
+
git clone https://github.com/leesgit/claude-session-continuity-mcp.git
|
|
240
|
+
cd claude-session-continuity-mcp
|
|
241
|
+
|
|
242
|
+
# Install
|
|
243
|
+
npm install
|
|
244
|
+
|
|
245
|
+
# Build
|
|
246
|
+
npm run build
|
|
247
|
+
|
|
248
|
+
# Test
|
|
249
|
+
npm test
|
|
250
|
+
|
|
251
|
+
# Test with coverage
|
|
252
|
+
npm run test:coverage
|
|
253
|
+
|
|
254
|
+
# Run v2 dashboard
|
|
255
|
+
npm run dashboard:v2
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Performance
|
|
261
|
+
|
|
262
|
+
| Metric | Value |
|
|
263
|
+
|--------|-------|
|
|
264
|
+
| Context load (cached) | **<5ms** |
|
|
265
|
+
| Memory search (FTS) | ~10ms |
|
|
266
|
+
| Semantic search | ~50ms |
|
|
267
|
+
| Build verification | Project-dependent |
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Roadmap
|
|
272
|
+
|
|
273
|
+
- [x] v2 API (15 focused tools)
|
|
274
|
+
- [x] Zod schema validation
|
|
275
|
+
- [x] 111 tests
|
|
276
|
+
- [x] GitHub Actions CI/CD
|
|
277
|
+
- [x] Semantic search
|
|
278
|
+
- [x] Auto-learning
|
|
279
|
+
- [ ] Test coverage 80%+
|
|
280
|
+
- [ ] Docker image
|
|
281
|
+
- [ ] Cloud sync option
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Contributing
|
|
286
|
+
|
|
287
|
+
PRs welcome! Please:
|
|
288
|
+
|
|
289
|
+
1. Fork the repo
|
|
290
|
+
2. Create a feature branch
|
|
291
|
+
3. Add tests for new features
|
|
292
|
+
4. Ensure `npm test` passes
|
|
293
|
+
5. Submit PR
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## License
|
|
298
|
+
|
|
299
|
+
[MIT](LICENSE) © Byeongchang Lee
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Acknowledgments
|
|
304
|
+
|
|
305
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/) by Anthropic
|
|
306
|
+
- [Xenova Transformers](https://github.com/xenova/transformers.js) for embeddings
|
|
307
|
+
- Inspired by [mcp-memory-service](https://github.com/doobidoo/mcp-memory-service)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Project Manager MCP Dashboard v2
|
|
4
|
+
* Modern dashboard with:
|
|
5
|
+
* - Tailwind-inspired design (CSS-only, no build step)
|
|
6
|
+
* - Real-time updates
|
|
7
|
+
* - Project timeline view
|
|
8
|
+
* - Memory graph visualization
|
|
9
|
+
* - Context snapshot viewer
|
|
10
|
+
*/
|
|
11
|
+
export {};
|