reflect-mcp 1.0.15 → 1.0.16
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/dist/server.js +1 -0
- package/dist/utils.js +11 -7
- package/package.json +2 -2
package/dist/server.js
CHANGED
package/dist/utils.js
CHANGED
|
@@ -32,31 +32,35 @@ export function findLocalDatabase() {
|
|
|
32
32
|
}
|
|
33
33
|
// Search for database files in the File System directory
|
|
34
34
|
// Structure is typically: File System/XXX/t/XX/XXXXXXXX
|
|
35
|
+
// Reflect may have multiple database partitions (000, 001, etc.)
|
|
36
|
+
// so we find all SQLite files and return the most recently modified one.
|
|
35
37
|
try {
|
|
36
38
|
const entries = fs.readdirSync(basePath);
|
|
39
|
+
let bestPath = null;
|
|
40
|
+
let bestMtime = 0;
|
|
37
41
|
for (const entry of entries) {
|
|
38
42
|
const entryPath = path.join(basePath, entry);
|
|
39
43
|
const tPath = path.join(entryPath, "t");
|
|
40
44
|
if (fs.existsSync(tPath) && fs.statSync(tPath).isDirectory()) {
|
|
41
|
-
// Look for subdirectories in t/
|
|
42
45
|
const tEntries = fs.readdirSync(tPath);
|
|
43
46
|
for (const tEntry of tEntries) {
|
|
44
47
|
const subPath = path.join(tPath, tEntry);
|
|
45
48
|
if (fs.statSync(subPath).isDirectory()) {
|
|
46
|
-
// Look for database files (8-char hex names)
|
|
47
49
|
const dbFiles = fs.readdirSync(subPath);
|
|
48
50
|
for (const dbFile of dbFiles) {
|
|
49
51
|
const dbPath = path.join(subPath, dbFile);
|
|
50
|
-
// Check if it's a valid SQLite database (starts with SQLite header)
|
|
51
52
|
if (fs.statSync(dbPath).isFile()) {
|
|
52
53
|
try {
|
|
53
54
|
const header = Buffer.alloc(16);
|
|
54
55
|
const fd = fs.openSync(dbPath, 'r');
|
|
55
56
|
fs.readSync(fd, header, 0, 16, 0);
|
|
56
57
|
fs.closeSync(fd);
|
|
57
|
-
// SQLite files start with "SQLite format 3"
|
|
58
58
|
if (header.toString('utf8', 0, 15) === 'SQLite format 3') {
|
|
59
|
-
|
|
59
|
+
const mtime = fs.statSync(dbPath).mtimeMs;
|
|
60
|
+
if (mtime > bestMtime) {
|
|
61
|
+
bestMtime = mtime;
|
|
62
|
+
bestPath = dbPath;
|
|
63
|
+
}
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
catch {
|
|
@@ -68,11 +72,11 @@ export function findLocalDatabase() {
|
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
}
|
|
75
|
+
return bestPath;
|
|
71
76
|
}
|
|
72
77
|
catch {
|
|
73
78
|
return null;
|
|
74
79
|
}
|
|
75
|
-
return null;
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
78
82
|
* Gets the default database path, searching for it if not provided.
|
|
@@ -84,7 +88,7 @@ export function getDefaultDbPath() {
|
|
|
84
88
|
return found;
|
|
85
89
|
}
|
|
86
90
|
if (os.platform() === "darwin") {
|
|
87
|
-
return expandPath("~/Library/Application Support/Reflect/File System/
|
|
91
|
+
return expandPath("~/Library/Application Support/Reflect/File System/001/t/00/00000000");
|
|
88
92
|
}
|
|
89
93
|
return "";
|
|
90
94
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reflect-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "MCP server for Reflect Notes - connect your notes to Claude Desktop. Just run: npx reflect-mcp",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/server.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
40
40
|
"better-sqlite3": "^11.10.0",
|
|
41
41
|
"fastmcp": "^3.25.4",
|
|
42
|
-
"reflect-mcp": "^1.0.
|
|
42
|
+
"reflect-mcp": "^1.0.15",
|
|
43
43
|
"zod": "^4.1.13"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|