@postnesia/mcp 0.1.18 → 0.1.20
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/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -23
- package/dist/install.d.ts +10 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +13 -10
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* MCP Server for Postnesia Memory System
|
|
4
|
-
* Exposes memory operations as Model Context Protocol tools
|
|
5
|
-
*/
|
|
6
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
8
4
|
import { z } from 'zod';
|
|
@@ -16,9 +12,6 @@ const server = new McpServer({
|
|
|
16
12
|
name: 'postnesia',
|
|
17
13
|
version: '1.0.0',
|
|
18
14
|
});
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
// memory tools
|
|
21
|
-
// ---------------------------------------------------------------------------
|
|
22
15
|
server.registerTool('memory_search', {
|
|
23
16
|
description: 'Search memories by semantic similarity. Optionally filter by type.',
|
|
24
17
|
inputSchema: {
|
|
@@ -130,7 +123,7 @@ server.registerTool('memory_add', {
|
|
|
130
123
|
type,
|
|
131
124
|
core: core ? 1 : 0,
|
|
132
125
|
importance,
|
|
133
|
-
context: context ||
|
|
126
|
+
context: context || '',
|
|
134
127
|
tags,
|
|
135
128
|
embedding,
|
|
136
129
|
});
|
|
@@ -296,9 +289,6 @@ server.registerTool('memory_supersede', {
|
|
|
296
289
|
content: [{ type: 'text', text: `Memory #${duplicateId} now superseded by #${canonicalId} (importance demoted by 2)` }],
|
|
297
290
|
};
|
|
298
291
|
});
|
|
299
|
-
// ---------------------------------------------------------------------------
|
|
300
|
-
// journal tools
|
|
301
|
-
// ---------------------------------------------------------------------------
|
|
302
292
|
server.registerTool('journal_add', {
|
|
303
293
|
description: 'Add a daily journal entry',
|
|
304
294
|
inputSchema: {
|
|
@@ -326,9 +316,6 @@ server.registerTool('journal_recent', {
|
|
|
326
316
|
content: [{ type: 'text', text: JSON.stringify(entries, null, 2) }],
|
|
327
317
|
};
|
|
328
318
|
});
|
|
329
|
-
// ---------------------------------------------------------------------------
|
|
330
|
-
// task tools
|
|
331
|
-
// ---------------------------------------------------------------------------
|
|
332
319
|
server.registerTool('task_create', {
|
|
333
320
|
description: 'Create a new task. Use session_id to group tasks by project or feature.',
|
|
334
321
|
inputSchema: {
|
|
@@ -402,22 +389,26 @@ server.registerTool('task_list', {
|
|
|
402
389
|
content: [{ type: 'text', text: JSON.stringify(tasks, null, 2) }],
|
|
403
390
|
};
|
|
404
391
|
});
|
|
405
|
-
// ---------------------------------------------------------------------------
|
|
406
|
-
// Start server
|
|
407
|
-
// ---------------------------------------------------------------------------
|
|
408
392
|
async function main() {
|
|
409
393
|
const transport = new StdioServerTransport();
|
|
410
394
|
await server.connect(transport);
|
|
411
395
|
console.error('Postnesia MCP Server running on stdio');
|
|
412
396
|
}
|
|
413
|
-
const exit = () => {
|
|
397
|
+
const exit = (e) => {
|
|
414
398
|
closeDb();
|
|
415
|
-
|
|
399
|
+
if (e === 'ERROR') {
|
|
400
|
+
process.exit(1);
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
process.exit(0);
|
|
404
|
+
}
|
|
416
405
|
};
|
|
417
|
-
|
|
406
|
+
try {
|
|
407
|
+
await main();
|
|
408
|
+
}
|
|
409
|
+
catch (error) {
|
|
418
410
|
console.error('Fatal error:', error);
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
});
|
|
411
|
+
exit('ERROR');
|
|
412
|
+
}
|
|
422
413
|
process.on('SIGINT', exit);
|
|
423
414
|
process.on('SIGTERM', exit);
|
package/dist/install.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAID,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
|
package/dist/install.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import 'dotenv/config';
|
|
2
|
-
var TypeEnum;
|
|
2
|
+
export var TypeEnum;
|
|
3
3
|
(function (TypeEnum) {
|
|
4
4
|
TypeEnum["claude"] = "claude";
|
|
5
5
|
TypeEnum["opencode"] = "opencode";
|
|
6
6
|
})(TypeEnum || (TypeEnum = {}));
|
|
7
7
|
;
|
|
8
|
-
var ScopeEnum;
|
|
8
|
+
export var ScopeEnum;
|
|
9
9
|
(function (ScopeEnum) {
|
|
10
10
|
ScopeEnum["user"] = "user";
|
|
11
11
|
ScopeEnum["project"] = "project";
|
|
@@ -20,6 +20,9 @@ if (!process.env['GEMINI_API_KEY']) {
|
|
|
20
20
|
console.error('GEMINI_API_KEY environment variable is not configured');
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
|
+
const HOME = process.env['HOME'];
|
|
24
|
+
const DATABASE_URL = process.env['DATABASE_URL'];
|
|
25
|
+
const GEMINI_API_KEY = process.env['GEMINI_API_KEY'];
|
|
23
26
|
const config = {
|
|
24
27
|
claude: {
|
|
25
28
|
mcpServers: {
|
|
@@ -31,8 +34,8 @@ const config = {
|
|
|
31
34
|
'pn-mcp'
|
|
32
35
|
],
|
|
33
36
|
env: {
|
|
34
|
-
DATABASE_URL
|
|
35
|
-
GEMINI_API_KEY
|
|
37
|
+
DATABASE_URL,
|
|
38
|
+
GEMINI_API_KEY
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
@@ -47,14 +50,14 @@ const config = {
|
|
|
47
50
|
'pn-mcp'
|
|
48
51
|
],
|
|
49
52
|
environment: {
|
|
50
|
-
DATABASE_URL
|
|
51
|
-
GEMINI_API_KEY
|
|
53
|
+
DATABASE_URL,
|
|
54
|
+
GEMINI_API_KEY
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
};
|
|
57
|
-
const [
|
|
60
|
+
const [, , type, scope] = process.argv;
|
|
58
61
|
if (type === 'claude') {
|
|
59
62
|
const msg = 'Add the following to your $file configuration:';
|
|
60
63
|
if (scope === 'project') {
|
|
@@ -63,12 +66,12 @@ if (type === 'claude') {
|
|
|
63
66
|
process.exit(0);
|
|
64
67
|
}
|
|
65
68
|
if (scope === 'local') {
|
|
66
|
-
console.log(msg.replace('$file', `${
|
|
69
|
+
console.log(msg.replace('$file', `${HOME}/.claude.json for the current project`));
|
|
67
70
|
console.log(JSON.stringify({ projects: { [process.cwd()]: config.claude } }, null, 2));
|
|
68
71
|
process.exit(0);
|
|
69
72
|
}
|
|
70
73
|
if (scope === 'user' || !scope) {
|
|
71
|
-
console.log(msg.replace('$file', `${
|
|
74
|
+
console.log(msg.replace('$file', `${HOME}/.claude.json`));
|
|
72
75
|
console.log(JSON.stringify(config.claude, null, 2));
|
|
73
76
|
process.exit(0);
|
|
74
77
|
}
|
|
@@ -83,7 +86,7 @@ if (type === 'opencode') {
|
|
|
83
86
|
process.exit(0);
|
|
84
87
|
}
|
|
85
88
|
if (!scope || scope === 'user') {
|
|
86
|
-
console.log(msg.replace('$file', `${
|
|
89
|
+
console.log(msg.replace('$file', `${HOME}/.config/opencode/opencode.json`));
|
|
87
90
|
console.log(JSON.stringify(config.opencode, null, 2));
|
|
88
91
|
process.exit(0);
|
|
89
92
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postnesia/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "An MCP server to interact with the Postnesia database",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
16
16
|
"zod": "^4.3.6",
|
|
17
|
-
"@postnesia/db": "0.1.
|
|
17
|
+
"@postnesia/db": "0.1.20"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/node": "^24.12.0",
|