remnote-mcp-server 0.13.1 → 0.14.1
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/CHANGELOG.md +40 -0
- package/README.md +44 -23
- package/dist/cli.d.ts +5 -0
- package/dist/cli.js +16 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/remnote-cli/cli.d.ts +3 -0
- package/dist/remnote-cli/cli.js +37 -0
- package/dist/remnote-cli/cli.js.map +1 -0
- package/dist/remnote-cli/client/command-client.d.ts +3 -0
- package/dist/remnote-cli/client/command-client.js +9 -0
- package/dist/remnote-cli/client/command-client.js.map +1 -0
- package/dist/remnote-cli/client/mcp-server-client.d.ts +18 -0
- package/dist/remnote-cli/client/mcp-server-client.js +116 -0
- package/dist/remnote-cli/client/mcp-server-client.js.map +1 -0
- package/dist/remnote-cli/commands/arg-utils.d.ts +33 -0
- package/dist/remnote-cli/commands/arg-utils.js +89 -0
- package/dist/remnote-cli/commands/arg-utils.js.map +1 -0
- package/dist/remnote-cli/commands/content-input.d.ts +31 -0
- package/dist/remnote-cli/commands/content-input.js +81 -0
- package/dist/remnote-cli/commands/content-input.js.map +1 -0
- package/dist/remnote-cli/commands/create.d.ts +2 -0
- package/dist/remnote-cli/commands/create.js +61 -0
- package/dist/remnote-cli/commands/create.js.map +1 -0
- package/dist/remnote-cli/commands/journal.d.ts +2 -0
- package/dist/remnote-cli/commands/journal.js +52 -0
- package/dist/remnote-cli/commands/journal.js.map +1 -0
- package/dist/remnote-cli/commands/read.d.ts +2 -0
- package/dist/remnote-cli/commands/read.js +74 -0
- package/dist/remnote-cli/commands/read.js.map +1 -0
- package/dist/remnote-cli/commands/search.d.ts +3 -0
- package/dist/remnote-cli/commands/search.js +107 -0
- package/dist/remnote-cli/commands/search.js.map +1 -0
- package/dist/remnote-cli/commands/status.d.ts +2 -0
- package/dist/remnote-cli/commands/status.js +41 -0
- package/dist/remnote-cli/commands/status.js.map +1 -0
- package/dist/remnote-cli/commands/table.d.ts +2 -0
- package/dist/remnote-cli/commands/table.js +79 -0
- package/dist/remnote-cli/commands/table.js.map +1 -0
- package/dist/remnote-cli/commands/update.d.ts +2 -0
- package/dist/remnote-cli/commands/update.js +62 -0
- package/dist/remnote-cli/commands/update.js.map +1 -0
- package/dist/remnote-cli/config.d.ts +9 -0
- package/dist/remnote-cli/config.js +10 -0
- package/dist/remnote-cli/config.js.map +1 -0
- package/dist/remnote-cli/index.d.ts +2 -0
- package/dist/remnote-cli/index.js +4 -0
- package/dist/remnote-cli/index.js.map +1 -0
- package/dist/remnote-cli/output/formatter.d.ts +9 -0
- package/dist/remnote-cli/output/formatter.js +28 -0
- package/dist/remnote-cli/output/formatter.js.map +1 -0
- package/dist/remnote-cli/version-compat.d.ts +7 -0
- package/dist/remnote-cli/version-compat.js +28 -0
- package/dist/remnote-cli/version-compat.js.map +1 -0
- package/mcpb/remnote-local/.mcpbignore +5 -0
- package/mcpb/remnote-local/README.md +25 -0
- package/mcpb/remnote-local/manifest.json +87 -0
- package/mcpb/remnote-local/package.json +11 -0
- package/mcpb/remnote-local/remnote-local.mcpb +0 -0
- package/mcpb/remnote-local/server/index.js +300 -0
- package/package.json +16 -9
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createCommandClient } from '../client/command-client.js';
|
|
2
|
+
import { formatResult, formatError } from '../output/formatter.js';
|
|
3
|
+
import { EXIT } from '../config.js';
|
|
4
|
+
export function registerReadTableCommand(program) {
|
|
5
|
+
program
|
|
6
|
+
.command('read-table')
|
|
7
|
+
.description('Read an Advanced Table (columns and row data)')
|
|
8
|
+
.option('--title <title>', 'Exact Advanced Table title')
|
|
9
|
+
.option('--rem-id <id>', 'Table Rem ID')
|
|
10
|
+
.option('-l, --limit <n>', 'Maximum rows to return (default: 50)', '50')
|
|
11
|
+
.option('--offset <n>', 'Row offset for pagination (default: 0)', '0')
|
|
12
|
+
.option('-p, --properties <names>', 'Comma-separated property/column names to include')
|
|
13
|
+
.action(async (opts) => {
|
|
14
|
+
const globalOpts = program.opts();
|
|
15
|
+
const format = globalOpts.text ? 'text' : 'json';
|
|
16
|
+
const client = createCommandClient(program);
|
|
17
|
+
try {
|
|
18
|
+
const payload = {
|
|
19
|
+
limit: parseInt(opts.limit, 10),
|
|
20
|
+
offset: parseInt(opts.offset, 10),
|
|
21
|
+
};
|
|
22
|
+
if ((opts.title ? 1 : 0) + (opts.remId ? 1 : 0) !== 1) {
|
|
23
|
+
throw new Error('Provide exactly one of --title or --rem-id');
|
|
24
|
+
}
|
|
25
|
+
if (opts.title)
|
|
26
|
+
payload.tableTitle = opts.title;
|
|
27
|
+
if (opts.remId)
|
|
28
|
+
payload.tableRemId = opts.remId;
|
|
29
|
+
if (opts.properties) {
|
|
30
|
+
payload.propertyFilter = opts.properties
|
|
31
|
+
.split(',')
|
|
32
|
+
.map((s) => s.trim());
|
|
33
|
+
}
|
|
34
|
+
const result = await client.execute('read_table', payload);
|
|
35
|
+
console.log(formatResult(result, format, (data) => {
|
|
36
|
+
const r = data;
|
|
37
|
+
const lines = [];
|
|
38
|
+
// Table header
|
|
39
|
+
const tableName = r.tableName || '(unnamed)';
|
|
40
|
+
lines.push(`Table: ${tableName} [${r.tableId}]`);
|
|
41
|
+
// Columns
|
|
42
|
+
const columns = (r.columns || []);
|
|
43
|
+
if (columns.length > 0) {
|
|
44
|
+
lines.push(`Columns: ${columns.map((c) => `${c.name} (${c.type})`).join(', ')}`);
|
|
45
|
+
}
|
|
46
|
+
// Row count
|
|
47
|
+
lines.push(`Rows: ${r.rowsReturned}/${r.totalRows}`);
|
|
48
|
+
// Rows
|
|
49
|
+
const rows = (r.rows || []);
|
|
50
|
+
if (rows.length > 0 && columns.length > 0) {
|
|
51
|
+
lines.push('');
|
|
52
|
+
// Header row
|
|
53
|
+
const colNames = ['Name', ...columns.map((c) => c.name)];
|
|
54
|
+
lines.push(colNames.join(' | '));
|
|
55
|
+
lines.push(colNames.map((n) => '─'.repeat(n.length)).join('─┼─'));
|
|
56
|
+
// Data rows
|
|
57
|
+
for (const row of rows) {
|
|
58
|
+
const values = (row.values || {});
|
|
59
|
+
const cells = [
|
|
60
|
+
String(row.name || ''),
|
|
61
|
+
...columns.map((c) => values[c.propertyId] || ''),
|
|
62
|
+
];
|
|
63
|
+
lines.push(cells.join(' | '));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return lines.join('\n');
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
71
|
+
console.error(formatError(message, format));
|
|
72
|
+
process.exit(EXIT.ERROR);
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
await client.close();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/remnote-cli/commands/table.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,OAAO;SACJ,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,+CAA+C,CAAC;SAC5D,MAAM,CAAC,iBAAiB,EAAE,4BAA4B,CAAC;SACvD,MAAM,CAAC,eAAe,EAAE,cAAc,CAAC;SACvC,MAAM,CAAC,iBAAiB,EAAE,sCAAsC,EAAE,IAAI,CAAC;SACvE,MAAM,CAAC,cAAc,EAAE,wCAAwC,EAAE,GAAG,CAAC;SACrE,MAAM,CAAC,0BAA0B,EAAE,kDAAkD,CAAC;SACtF,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,E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AAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;oBAClE,YAAY;oBACZ,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;wBACvB,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAA2B,CAAC;wBAC5D,MAAM,KAAK,GAAG;4BACZ,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;4BACtB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;yBAClD,CAAC;wBACF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;oBAChC,CAAC;gBACH,CAAC;gBAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;gBAAS,CAAC;YACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createCommandClient } from '../client/command-client.js';
|
|
2
|
+
import { formatResult, formatError } from '../output/formatter.js';
|
|
3
|
+
import { EXIT } from '../config.js';
|
|
4
|
+
import { resolveUpdateContent } from './content-input.js';
|
|
5
|
+
import { validateNotFlag } from './arg-utils.js';
|
|
6
|
+
export function registerUpdateCommand(program) {
|
|
7
|
+
const subprogram = program.command('update <rem-id>');
|
|
8
|
+
const validate = (val) => validateNotFlag(val, subprogram);
|
|
9
|
+
subprogram
|
|
10
|
+
.description('Update an existing note')
|
|
11
|
+
.option('--title <text>', 'New title', validate)
|
|
12
|
+
.option('--append <text>', 'Append content', validate)
|
|
13
|
+
.option('--append-file <path>', 'Read appended content from UTF-8 file ("-" for stdin)', validate)
|
|
14
|
+
.option('--replace <text>', 'Replace direct child content (empty string clears all children)', validate)
|
|
15
|
+
.option('--replace-file <path>', 'Read replacement content from UTF-8 file ("-" for stdin; empty file clears all children)', validate)
|
|
16
|
+
.option('--add-tags <tags...>', 'Tags to add')
|
|
17
|
+
.option('--remove-tags <tags...>', 'Tags to remove')
|
|
18
|
+
.action(async (remId, opts) => {
|
|
19
|
+
const globalOpts = program.opts();
|
|
20
|
+
const format = globalOpts.text ? 'text' : 'json';
|
|
21
|
+
const client = createCommandClient(program);
|
|
22
|
+
try {
|
|
23
|
+
const { appendContent, replaceContent } = await resolveUpdateContent({
|
|
24
|
+
appendText: opts.append,
|
|
25
|
+
appendFile: opts.appendFile,
|
|
26
|
+
replaceText: opts.replace,
|
|
27
|
+
replaceFile: opts.replaceFile,
|
|
28
|
+
});
|
|
29
|
+
const payload = { remId };
|
|
30
|
+
if (opts.title)
|
|
31
|
+
payload.title = opts.title;
|
|
32
|
+
if (appendContent !== undefined)
|
|
33
|
+
payload.appendContent = appendContent;
|
|
34
|
+
if (replaceContent !== undefined)
|
|
35
|
+
payload.replaceContent = replaceContent;
|
|
36
|
+
if (opts.addTags && opts.addTags.length > 0)
|
|
37
|
+
payload.addTags = opts.addTags;
|
|
38
|
+
if (opts.removeTags && opts.removeTags.length > 0)
|
|
39
|
+
payload.removeTags = opts.removeTags;
|
|
40
|
+
const result = await client.execute('update_note', payload);
|
|
41
|
+
console.log(formatResult(result, format, (data) => {
|
|
42
|
+
const r = data;
|
|
43
|
+
const ids = r.remIds || [];
|
|
44
|
+
const titles = r.titles || [];
|
|
45
|
+
if (ids.length === 0)
|
|
46
|
+
return `Updated note ${remId} (no Rems created)`;
|
|
47
|
+
return titles
|
|
48
|
+
.map((t, i) => `Updated/Created: ${t || '(untitled)'} (ID: ${ids[i] || 'unknown'})`)
|
|
49
|
+
.join('\n');
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
54
|
+
console.error(formatError(message, format));
|
|
55
|
+
process.exit(EXIT.ERROR);
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
await client.close();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/remnote-cli/commands/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAEnE,UAAU;SACP,WAAW,CAAC,yBAAyB,CAAC;SACtC,MAAM,CAAC,gBAAgB,EAAE,WAAW,EAAE,QAAQ,CAAC;SAC/C,MAAM,C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}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DEFAULT_MCP_URL = "http://127.0.0.1:3001/mcp";
|
|
2
|
+
export declare const REQUEST_TIMEOUT_MS = 15000;
|
|
3
|
+
/** Exit codes for CLI process */
|
|
4
|
+
export declare const EXIT: {
|
|
5
|
+
readonly SUCCESS: 0;
|
|
6
|
+
readonly ERROR: 1;
|
|
7
|
+
readonly MCP_SERVER_NOT_RUNNING: 2;
|
|
8
|
+
readonly BRIDGE_NOT_CONNECTED: 3;
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const DEFAULT_MCP_URL = 'http://127.0.0.1:3001/mcp';
|
|
2
|
+
export const REQUEST_TIMEOUT_MS = 15000;
|
|
3
|
+
/** Exit codes for CLI process */
|
|
4
|
+
export const EXIT = {
|
|
5
|
+
SUCCESS: 0,
|
|
6
|
+
ERROR: 1,
|
|
7
|
+
MCP_SERVER_NOT_RUNNING: 2,
|
|
8
|
+
BRIDGE_NOT_CONNECTED: 3,
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/remnote-cli/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,2BAA2B,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAExC,iCAAiC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,sBAAsB,EAAE,CAAC;IACzB,oBAAoB,EAAE,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/remnote-cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type OutputFormat = 'json' | 'text';
|
|
2
|
+
/**
|
|
3
|
+
* Format a successful result for stdout.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatResult(data: unknown, format: OutputFormat, textFormatter?: (data: unknown) => string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Format an error for stderr/stdout.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatError(message: string, format: OutputFormat, code?: number): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a successful result for stdout.
|
|
3
|
+
*/
|
|
4
|
+
export function formatResult(data, format, textFormatter) {
|
|
5
|
+
if (format === 'json') {
|
|
6
|
+
return JSON.stringify(data, null, 2);
|
|
7
|
+
}
|
|
8
|
+
if (textFormatter) {
|
|
9
|
+
return textFormatter(data);
|
|
10
|
+
}
|
|
11
|
+
// Fallback: simple key-value display
|
|
12
|
+
if (data && typeof data === 'object') {
|
|
13
|
+
return Object.entries(data)
|
|
14
|
+
.map(([k, v]) => `${k}: ${typeof v === 'object' ? JSON.stringify(v) : String(v)}`)
|
|
15
|
+
.join('\n');
|
|
16
|
+
}
|
|
17
|
+
return String(data);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Format an error for stderr/stdout.
|
|
21
|
+
*/
|
|
22
|
+
export function formatError(message, format, code) {
|
|
23
|
+
if (format === 'json') {
|
|
24
|
+
return JSON.stringify({ error: message, ...(code !== undefined && { code }) }, null, 2);
|
|
25
|
+
}
|
|
26
|
+
return `Error: ${message}`;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../src/remnote-cli/output/formatter.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAa,EACb,MAAoB,EACpB,aAAyC;IAEzC,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,qCAAqC;IACrC,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO,MAAM,CAAC,OAAO,CAAC,IAA+B,CAAC;aACnD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;aACjF,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,MAAoB,EAAE,IAAa;IAC9E,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,UAAU,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version compatibility check for 0.x semver.
|
|
3
|
+
*
|
|
4
|
+
* During 0.x development, minor version bumps may contain breaking changes.
|
|
5
|
+
* Compatible iff major.minor match (patch differences are OK).
|
|
6
|
+
*/
|
|
7
|
+
export declare function checkVersionCompatibility(localVersion: string, bridgeVersion: string, localLabel?: string, bridgeLabel?: string): string | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version compatibility check for 0.x semver.
|
|
3
|
+
*
|
|
4
|
+
* During 0.x development, minor version bumps may contain breaking changes.
|
|
5
|
+
* Compatible iff major.minor match (patch differences are OK).
|
|
6
|
+
*/
|
|
7
|
+
export function checkVersionCompatibility(localVersion, bridgeVersion, localLabel = 'CLI', bridgeLabel = 'bridge') {
|
|
8
|
+
const local = parseVersion(localVersion);
|
|
9
|
+
const bridge = parseVersion(bridgeVersion);
|
|
10
|
+
if (!local || !bridge) {
|
|
11
|
+
return `Cannot parse versions: local=${localVersion}, bridge=${bridgeVersion}`;
|
|
12
|
+
}
|
|
13
|
+
if (local.major !== bridge.major || local.minor !== bridge.minor) {
|
|
14
|
+
return `Version mismatch: ${localLabel} v${localVersion} ↔ ${bridgeLabel} v${bridgeVersion}. Minor version must match during 0.x development. See compatibility guide.`;
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
function parseVersion(version) {
|
|
19
|
+
const match = version.match(/^(\d+)\.(\d+)\.(\d+)/);
|
|
20
|
+
if (!match)
|
|
21
|
+
return null;
|
|
22
|
+
return {
|
|
23
|
+
major: parseInt(match[1], 10),
|
|
24
|
+
minor: parseInt(match[2], 10),
|
|
25
|
+
patch: parseInt(match[3], 10),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=version-compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-compat.js","sourceRoot":"","sources":["../../src/remnote-cli/version-compat.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAoB,EACpB,aAAqB,EACrB,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,QAAQ;IAEtB,MAAM,KAAK,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;IAE3C,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;QACtB,OAAO,gCAAgC,YAAY,YAAY,aAAa,EAAE,CAAC;IACjF,CAAC;IAED,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC;QACjE,OAAO,qBAAqB,UAAU,KAAK,YAAY,MAAM,WAAW,KAAK,aAAa,6EAA6E,CAAC;IAC1K,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACpD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# RemNote Local MCPB
|
|
2
|
+
|
|
3
|
+
Claude Desktop extension that exposes a local `remnote-mcp-server` to Claude Desktop without a public HTTPS tunnel.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
1. Install and start `remnote-mcp-server`.
|
|
8
|
+
2. Open RemNote with the Automation Bridge plugin enabled and connected.
|
|
9
|
+
3. Install this extension's `.mcpb` file in Claude Desktop.
|
|
10
|
+
4. Keep the default MCP URL unless your server uses a custom port:
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
http://127.0.0.1:3001/mcp
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This extension does not start or supervise `remnote-mcp-server`. It is a stdio proxy that forwards Claude Desktop tool
|
|
17
|
+
calls to the local Streamable HTTP endpoint.
|
|
18
|
+
|
|
19
|
+
## Installed Package Path
|
|
20
|
+
|
|
21
|
+
When installed from npm, print the bundled `.mcpb` path with:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
remnote-mcp-server mcpb-path
|
|
25
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": "0.3",
|
|
3
|
+
"name": "remnote-local",
|
|
4
|
+
"display_name": "RemNote Local",
|
|
5
|
+
"version": "0.14.1",
|
|
6
|
+
"description": "Use a locally running RemNote MCP Server from Claude Desktop without a public HTTPS tunnel.",
|
|
7
|
+
"long_description": "RemNote Local is a Claude Desktop extension that exposes RemNote MCP tools over stdio and forwards calls to a local remnote-mcp-server Streamable HTTP endpoint. Start remnote-mcp-server and keep the RemNote Automation Bridge plugin connected before using the tools.",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Robert Spiegel",
|
|
10
|
+
"email": "nightingale7@gmail.com"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/robert7/remnote-mcp-server.git"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/robert7/remnote-mcp-server",
|
|
17
|
+
"documentation": "https://github.com/robert7/remnote-mcp-server/tree/main/docs/guides",
|
|
18
|
+
"support": "https://github.com/robert7/remnote-mcp-server/issues",
|
|
19
|
+
"server": {
|
|
20
|
+
"type": "node",
|
|
21
|
+
"entry_point": "server/index.js",
|
|
22
|
+
"mcp_config": {
|
|
23
|
+
"command": "node",
|
|
24
|
+
"args": ["${__dirname}/server/index.js"],
|
|
25
|
+
"env": {
|
|
26
|
+
"REMNOTE_MCP_URL": "${user_config.mcp_url}"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"tools": [
|
|
31
|
+
{
|
|
32
|
+
"name": "remnote_create_note",
|
|
33
|
+
"description": "Create a new note in RemNote."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "remnote_search",
|
|
37
|
+
"description": "Search the RemNote knowledge base."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "remnote_search_by_tag",
|
|
41
|
+
"description": "Find notes by tag."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "remnote_read_note",
|
|
45
|
+
"description": "Read a specific note from RemNote by Rem ID."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "remnote_update_note",
|
|
49
|
+
"description": "Update an existing note in RemNote."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "remnote_append_journal",
|
|
53
|
+
"description": "Append content to today's daily document in RemNote."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "remnote_read_table",
|
|
57
|
+
"description": "Read an Advanced Table from RemNote."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "remnote_get_playbook",
|
|
61
|
+
"description": "Get an operations playbook for MCP agents."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "remnote_status",
|
|
65
|
+
"description": "Check bridge connection health and write-policy capabilities."
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"tools_generated": true,
|
|
69
|
+
"keywords": ["remnote", "mcp", "notes", "knowledge-base", "local"],
|
|
70
|
+
"license": "MIT",
|
|
71
|
+
"compatibility": {
|
|
72
|
+
"claude_desktop": ">=1.0.0",
|
|
73
|
+
"platforms": ["darwin", "win32", "linux"],
|
|
74
|
+
"runtimes": {
|
|
75
|
+
"node": ">=20.0.0"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"user_config": {
|
|
79
|
+
"mcp_url": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"title": "Local MCP URL",
|
|
82
|
+
"description": "Local remnote-mcp-server Streamable HTTP endpoint.",
|
|
83
|
+
"default": "http://127.0.0.1:3001/mcp",
|
|
84
|
+
"required": true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "remnote-local-mcpb",
|
|
3
|
+
"version": "0.14.1",
|
|
4
|
+
"description": "Claude Desktop MCPB stdio proxy for a local RemNote MCP Server",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": true,
|
|
7
|
+
"main": "server/index.js",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
Binary file
|