@misterhuydo/cairn-mcp 1.1.1 → 1.1.2
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/README.md +21 -14
- package/how-to-use.md +24 -0
- package/package.json +1 -1
- package/src/graph/db.js +1 -9
package/README.md
CHANGED
|
@@ -239,21 +239,28 @@ cairn_resume()
|
|
|
239
239
|
2. cairn_search → continue where you left off
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
## Custom DB path
|
|
245
|
-
|
|
246
|
-
By default the index is stored at `.cairn/index.db` in your project directory. Override with an env variable:
|
|
242
|
+
## Complete session lifecycle
|
|
247
243
|
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
244
|
+
```
|
|
245
|
+
─── START OF SESSION ──────────────────────────────────────────
|
|
246
|
+
You: "Hey Claude, please resume and continue"
|
|
247
|
+
Claude: cairn_resume
|
|
248
|
+
→ "Last session: adding multi-currency to checkout.
|
|
249
|
+
PaymentStep.vue was modified since checkpoint (2 files changed, re-indexed).
|
|
250
|
+
Notes: CurrencyService expects ISO 4217 codes. PaymentStep EUR bug not fixed yet.
|
|
251
|
+
Ready to continue."
|
|
252
|
+
|
|
253
|
+
─── DURING SESSION ────────────────────────────────────────────
|
|
254
|
+
Claude uses: cairn_search, cairn_bundle, cairn_code_graph, cairn_security
|
|
255
|
+
as needed — all reading from .cairn/index.db in cwd
|
|
256
|
+
|
|
257
|
+
─── END OF SESSION ────────────────────────────────────────────
|
|
258
|
+
You: "Ok let's stop here for today"
|
|
259
|
+
Claude: cairn_checkpoint
|
|
260
|
+
message="Fixed EUR formatting in PaymentStep, multi-currency complete"
|
|
261
|
+
active_files=["src/components/checkout/PaymentStep.vue"]
|
|
262
|
+
notes=["Still need to add JPY — no decimal places", "QA needs to test AED"]
|
|
263
|
+
→ "Session saved. Resume anytime with cairn_resume."
|
|
257
264
|
```
|
|
258
265
|
|
|
259
266
|
---
|
package/how-to-use.md
CHANGED
|
@@ -69,6 +69,30 @@ Run this once at the start of each session (or use `cairn_resume` to pick up whe
|
|
|
69
69
|
2. cairn_search → continue where you left off
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
## 6. Complete session lifecycle
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
─── START OF SESSION ──────────────────────────────────────────
|
|
76
|
+
You: "Hey Claude, please resume and continue"
|
|
77
|
+
Claude: cairn_resume
|
|
78
|
+
→ "Last session: adding multi-currency to checkout.
|
|
79
|
+
PaymentStep.vue was modified since checkpoint (2 files changed, re-indexed).
|
|
80
|
+
Notes: CurrencyService expects ISO 4217 codes. PaymentStep EUR bug not fixed yet.
|
|
81
|
+
Ready to continue."
|
|
82
|
+
|
|
83
|
+
─── DURING SESSION ────────────────────────────────────────────
|
|
84
|
+
Claude uses: cairn_search, cairn_bundle, cairn_code_graph, cairn_security
|
|
85
|
+
as needed — all reading from .cairn/index.db in cwd
|
|
86
|
+
|
|
87
|
+
─── END OF SESSION ────────────────────────────────────────────
|
|
88
|
+
You: "Ok let's stop here for today"
|
|
89
|
+
Claude: cairn_checkpoint
|
|
90
|
+
message="Fixed EUR formatting in PaymentStep, multi-currency complete"
|
|
91
|
+
active_files=["src/components/checkout/PaymentStep.vue"]
|
|
92
|
+
notes=["Still need to add JPY — no decimal places", "QA needs to test AED"]
|
|
93
|
+
→ "Session saved. Resume anytime with cairn_resume."
|
|
94
|
+
```
|
|
95
|
+
|
|
72
96
|
---
|
|
73
97
|
|
|
74
98
|
**Requirements:** Node.js >= 22.15.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@misterhuydo/cairn-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "MCP server that gives Claude Code persistent memory across sessions. Index your codebase once, search symbols, bundle source, scan for vulnerabilities, and checkpoint/resume work — across Java, TypeScript, Vue, Python, SQL and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
package/src/graph/db.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import fs from 'fs';
|
|
4
3
|
import { getCairnDir } from './cwd.js';
|
|
5
4
|
|
|
6
|
-
function getDbPath() {
|
|
7
|
-
if (process.env.CAIRN_DB_PATH) return process.env.CAIRN_DB_PATH;
|
|
8
|
-
return path.join(getCairnDir(), 'index.db');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
const SCHEMA = `
|
|
12
6
|
CREATE TABLE IF NOT EXISTS files (
|
|
13
7
|
id INTEGER PRIMARY KEY,
|
|
@@ -61,9 +55,7 @@ const SCHEMA = `
|
|
|
61
55
|
`;
|
|
62
56
|
|
|
63
57
|
export function openDB() {
|
|
64
|
-
const dbPath =
|
|
65
|
-
const dir = path.dirname(dbPath);
|
|
66
|
-
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
58
|
+
const dbPath = path.join(getCairnDir(), 'index.db');
|
|
67
59
|
|
|
68
60
|
const db = new DatabaseSync(dbPath);
|
|
69
61
|
db.exec('PRAGMA journal_mode = WAL');
|