@opulcloud/mcp 0.1.0 → 0.1.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/dist/tools/memory.js +13 -2
- package/package.json +19 -6
package/dist/tools/memory.js
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { client } from '../client.js';
|
|
3
3
|
export function registerMemoryTools(server) {
|
|
4
|
-
server.tool('memory_add', 'Store a memory', {
|
|
4
|
+
server.tool('memory_add', 'Store a general memory or user preference', {
|
|
5
5
|
content: z.string(),
|
|
6
6
|
kind: z.enum(['episodic', 'semantic', 'procedural', 'working']).default('episodic'),
|
|
7
7
|
}, async ({ content, kind }) => {
|
|
8
8
|
const r = await client.memory.add({ content, kind });
|
|
9
9
|
return { content: [{ type: 'text', text: `Stored ${r.data.id}` }] };
|
|
10
10
|
});
|
|
11
|
-
server.tool('memory_search', 'Search memory
|
|
11
|
+
server.tool('memory_search', 'Search memory for relevant context or rules', {
|
|
12
|
+
query: z.string(),
|
|
13
|
+
limit: z.number().default(5)
|
|
14
|
+
}, async ({ query, limit }) => {
|
|
12
15
|
const r = await client.memory.search({ query, limit });
|
|
13
16
|
const out = r.data.map((m, i) => `${i + 1}. ${m.content}`).join('\n');
|
|
14
17
|
return { content: [{ type: 'text', text: out || 'No matches' }] };
|
|
15
18
|
});
|
|
19
|
+
// 🚀 NEW: Project Memory (Context Injection for Cursor/Claude)
|
|
20
|
+
server.tool('project_rule_add', 'Add a strict architectural rule for this codebase (e.g., "Always use pnpm", "Never use raw SQL")', {
|
|
21
|
+
rule: z.string(),
|
|
22
|
+
}, async ({ rule }) => {
|
|
23
|
+
// We store it as 'procedural' so it stands out from normal chat memories
|
|
24
|
+
const r = await client.memory.add({ content: `[PROJECT RULE] ${rule}`, kind: 'procedural' });
|
|
25
|
+
return { content: [{ type: 'text', text: `✅ Architectural rule saved: "${rule}"` }] };
|
|
26
|
+
});
|
|
16
27
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opulcloud/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
6
|
+
"bin": {
|
|
7
|
+
"opulcloud-mcp": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"dev": "tsx src/cli.ts"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
18
|
+
"zod": "^3.23.8"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"tsx": "^4.19.0",
|
|
22
|
+
"typescript": "^5.6.0"
|
|
23
|
+
}
|
|
11
24
|
}
|