reflect-mcp 1.0.3 → 1.0.5
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 +0 -2
- package/dist/cli.js +0 -0
- package/dist/server.js +0 -1
- package/dist/tools/index.js +16 -83
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -125,8 +125,6 @@ npx reflect-mcp uninstall
|
|
|
125
125
|
- Verify database path exists at default location
|
|
126
126
|
- Try specifying custom path: `npx reflect-mcp install /path/to/db`
|
|
127
127
|
|
|
128
|
-
## Demo:
|
|
129
|
-
https://www.loom.com/share/455b1d3eb7184bdea1ae4e8d5904fc53
|
|
130
128
|
## License
|
|
131
129
|
|
|
132
130
|
MIT
|
package/dist/cli.js
CHANGED
|
File without changes
|
package/dist/server.js
CHANGED
package/dist/tools/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export function registerTools(server, dbPath) {
|
|
|
11
11
|
// Tool: Get all Reflect graphs
|
|
12
12
|
server.addTool({
|
|
13
13
|
name: "get_graphs",
|
|
14
|
-
description: "Get a list of all Reflect graphs
|
|
14
|
+
description: "Get a list of all Reflect graphs accessible with the current access token",
|
|
15
15
|
parameters: z.object({}),
|
|
16
16
|
execute: async (_args, { session }) => {
|
|
17
17
|
if (!session) {
|
|
@@ -59,7 +59,7 @@ export function registerTools(server, dbPath) {
|
|
|
59
59
|
// Tool: Get backlinks for a note from local Reflect SQLite database
|
|
60
60
|
server.addTool({
|
|
61
61
|
name: "get_backlinks",
|
|
62
|
-
description: "Get backlinks for a note from
|
|
62
|
+
description: "Get backlinks for a note from the local Reflect database. Returns notes that link to the specified note.",
|
|
63
63
|
parameters: z.object({
|
|
64
64
|
subject: z.string().describe("The subject/title of the note to get backlinks for"),
|
|
65
65
|
graphId: z.string().default("rapheal-brain").describe("The graph ID to search in"),
|
|
@@ -111,7 +111,7 @@ export function registerTools(server, dbPath) {
|
|
|
111
111
|
// Tool: Get recent daily notes
|
|
112
112
|
server.addTool({
|
|
113
113
|
name: "get_daily_notes",
|
|
114
|
-
description: "Get the most recent daily notes from Reflect
|
|
114
|
+
description: "Get the most recent daily notes from the local Reflect database",
|
|
115
115
|
parameters: z.object({
|
|
116
116
|
limit: z.number().default(5).describe("Number of recent daily notes to return"),
|
|
117
117
|
graphId: z.string().default("rapheal-brain").describe("The graph ID to search in"),
|
|
@@ -163,7 +163,7 @@ export function registerTools(server, dbPath) {
|
|
|
163
163
|
// Tool: Get daily note by date
|
|
164
164
|
server.addTool({
|
|
165
165
|
name: "get_daily_note_by_date",
|
|
166
|
-
description: "Get the daily note for a specific date
|
|
166
|
+
description: "Get the daily note for a specific date from the local Reflect database",
|
|
167
167
|
parameters: z.object({
|
|
168
168
|
date: z.string().describe("The date in YYYY-MM-DD format"),
|
|
169
169
|
graphId: z.string().default("rapheal-brain").describe("The graph ID to search in"),
|
|
@@ -225,7 +225,7 @@ export function registerTools(server, dbPath) {
|
|
|
225
225
|
// Tool: Get notes with most backlinks
|
|
226
226
|
server.addTool({
|
|
227
227
|
name: "get_backlinked_notes",
|
|
228
|
-
description: "Get notes that have at least a minimum number of backlinks from Reflect
|
|
228
|
+
description: "Get notes that have at least a minimum number of backlinks from the local Reflect database",
|
|
229
229
|
parameters: z.object({
|
|
230
230
|
minBacklinks: z.number().default(5).describe("Minimum number of backlinks a note must have"),
|
|
231
231
|
limit: z.number().default(10).describe("Maximum number of notes to return"),
|
|
@@ -278,7 +278,7 @@ export function registerTools(server, dbPath) {
|
|
|
278
278
|
// Tool: Get all tags with usage counts
|
|
279
279
|
server.addTool({
|
|
280
280
|
name: "get_tags",
|
|
281
|
-
description: "Get all unique tags with their usage counts from Reflect
|
|
281
|
+
description: "Get all unique tags with their usage counts from the local Reflect database",
|
|
282
282
|
parameters: z.object({
|
|
283
283
|
graphId: z.string().default("rapheal-brain").describe("The graph ID to search in"),
|
|
284
284
|
limit: z.number().default(50).describe("Maximum number of tags to return"),
|
|
@@ -334,7 +334,7 @@ export function registerTools(server, dbPath) {
|
|
|
334
334
|
// Tool: Get notes with a specific tag
|
|
335
335
|
server.addTool({
|
|
336
336
|
name: "get_notes_with_tag",
|
|
337
|
-
description: "Get notes that have a specific tag from Reflect
|
|
337
|
+
description: "Get notes that have a specific tag from the local Reflect database",
|
|
338
338
|
parameters: z.object({
|
|
339
339
|
tag: z.string().describe("The tag to search for"),
|
|
340
340
|
graphId: z.string().default("rapheal-brain").describe("The graph ID to search in"),
|
|
@@ -383,116 +383,49 @@ export function registerTools(server, dbPath) {
|
|
|
383
383
|
}
|
|
384
384
|
},
|
|
385
385
|
});
|
|
386
|
-
// Tool: Get a note by title
|
|
386
|
+
// Tool: Get a note by title
|
|
387
387
|
server.addTool({
|
|
388
388
|
name: "get_note",
|
|
389
|
-
description: "Get a note by its title (subject) from Reflect
|
|
389
|
+
description: "Get a note by its title (subject) from the local Reflect database",
|
|
390
390
|
parameters: z.object({
|
|
391
391
|
title: z.string().describe("The title/subject of the note to retrieve"),
|
|
392
392
|
graphId: z.string().default("rapheal-brain").describe("The graph ID to search in"),
|
|
393
393
|
}),
|
|
394
394
|
execute: async (args) => {
|
|
395
395
|
const { title, graphId } = args;
|
|
396
|
-
const FUZZY_LIMIT = 3;
|
|
397
396
|
try {
|
|
398
397
|
const dbFile = resolvedDbPath;
|
|
399
398
|
const db = new Database(dbFile, { readonly: true });
|
|
400
|
-
|
|
401
|
-
const exactStmt = db.prepare(`
|
|
399
|
+
const stmt = db.prepare(`
|
|
402
400
|
SELECT id, subject, documentText, tags, editedAt, createdAt
|
|
403
401
|
FROM notes
|
|
404
402
|
WHERE isDeleted = 0 AND graphId = ? AND subject = ?
|
|
405
403
|
`);
|
|
406
|
-
const
|
|
407
|
-
if (exactResult) {
|
|
408
|
-
db.close();
|
|
409
|
-
const note = {
|
|
410
|
-
id: exactResult.id,
|
|
411
|
-
subject: exactResult.subject,
|
|
412
|
-
documentText: exactResult.documentText,
|
|
413
|
-
tags: exactResult.tags ? JSON.parse(exactResult.tags) : [],
|
|
414
|
-
editedAt: formatDate(exactResult.editedAt),
|
|
415
|
-
createdAt: formatDate(exactResult.createdAt),
|
|
416
|
-
};
|
|
417
|
-
return {
|
|
418
|
-
content: [
|
|
419
|
-
{
|
|
420
|
-
type: "text",
|
|
421
|
-
text: JSON.stringify({ title, graphId, note }, null, 2),
|
|
422
|
-
},
|
|
423
|
-
],
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
// No exact match - try fuzzy search
|
|
427
|
-
const searchTerm = title.toLowerCase();
|
|
428
|
-
const fuzzyStmt = db.prepare(`
|
|
429
|
-
SELECT id, subject, documentText, tags, editedAt, createdAt,
|
|
430
|
-
CASE
|
|
431
|
-
WHEN LOWER(subject) LIKE ? THEN 2
|
|
432
|
-
WHEN LOWER(subject) LIKE ? THEN 1
|
|
433
|
-
ELSE 0
|
|
434
|
-
END as relevance
|
|
435
|
-
FROM notes
|
|
436
|
-
WHERE isDeleted = 0
|
|
437
|
-
AND graphId = ?
|
|
438
|
-
AND (LOWER(subject) LIKE ? OR LOWER(subject) LIKE ?)
|
|
439
|
-
ORDER BY relevance DESC, editedAt DESC
|
|
440
|
-
LIMIT ?
|
|
441
|
-
`);
|
|
442
|
-
const fuzzyResults = fuzzyStmt.all(`${searchTerm}%`, // starts with (score 2)
|
|
443
|
-
`%${searchTerm}%`, // contains (score 1)
|
|
444
|
-
graphId, `${searchTerm}%`, // WHERE starts with
|
|
445
|
-
`%${searchTerm}%`, // WHERE contains
|
|
446
|
-
FUZZY_LIMIT);
|
|
404
|
+
const result = stmt.get(graphId, title);
|
|
447
405
|
db.close();
|
|
448
|
-
if (
|
|
406
|
+
if (!result) {
|
|
449
407
|
return {
|
|
450
408
|
content: [
|
|
451
409
|
{
|
|
452
410
|
type: "text",
|
|
453
|
-
text: JSON.stringify({
|
|
454
|
-
error: `No notes found matching '${title}'`,
|
|
455
|
-
query: title,
|
|
456
|
-
graphId
|
|
457
|
-
}),
|
|
411
|
+
text: JSON.stringify({ error: `Note '${title}' not found`, title, graphId }),
|
|
458
412
|
},
|
|
459
413
|
],
|
|
460
414
|
};
|
|
461
415
|
}
|
|
462
|
-
const
|
|
416
|
+
const note = {
|
|
463
417
|
id: result.id,
|
|
464
418
|
subject: result.subject,
|
|
465
419
|
documentText: result.documentText,
|
|
466
420
|
tags: result.tags ? JSON.parse(result.tags) : [],
|
|
467
421
|
editedAt: formatDate(result.editedAt),
|
|
468
422
|
createdAt: formatDate(result.createdAt),
|
|
469
|
-
}
|
|
470
|
-
// If only one fuzzy match, return it directly
|
|
471
|
-
if (notes.length === 1) {
|
|
472
|
-
return {
|
|
473
|
-
content: [
|
|
474
|
-
{
|
|
475
|
-
type: "text",
|
|
476
|
-
text: JSON.stringify({
|
|
477
|
-
query: title,
|
|
478
|
-
graphId,
|
|
479
|
-
note: notes[0],
|
|
480
|
-
matchType: "fuzzy"
|
|
481
|
-
}, null, 2),
|
|
482
|
-
},
|
|
483
|
-
],
|
|
484
|
-
};
|
|
485
|
-
}
|
|
423
|
+
};
|
|
486
424
|
return {
|
|
487
425
|
content: [
|
|
488
426
|
{
|
|
489
427
|
type: "text",
|
|
490
|
-
text: JSON.stringify({
|
|
491
|
-
query: title,
|
|
492
|
-
graphId,
|
|
493
|
-
matchCount: notes.length,
|
|
494
|
-
notes
|
|
495
|
-
}, null, 2),
|
|
428
|
+
text: JSON.stringify({ title, graphId, note }, null, 2),
|
|
496
429
|
},
|
|
497
430
|
],
|
|
498
431
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reflect-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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",
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
"build": "tsc",
|
|
16
16
|
"dev": "tsx src/cli.ts",
|
|
17
17
|
"start": "node dist/cli.js",
|
|
18
|
-
"prepublishOnly": "npm run build"
|
|
19
|
-
"postinstall": "npm rebuild better-sqlite3 || true"
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
20
19
|
},
|
|
21
20
|
"keywords": [
|
|
22
21
|
"mcp",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
38
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
40
|
-
"better-sqlite3": "^11.
|
|
39
|
+
"better-sqlite3": "^11.0.0",
|
|
41
40
|
"fastmcp": "^3.25.4",
|
|
42
41
|
"zod": "^4.1.13"
|
|
43
42
|
},
|