oh-memos-mcp 1.0.0
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/.env.example +27 -0
- package/README.md +71 -0
- package/dist/api-client.d.ts +22 -0
- package/dist/api-client.js +127 -0
- package/dist/config.d.ts +30 -0
- package/dist/config.js +163 -0
- package/dist/cube-manager.d.ts +16 -0
- package/dist/cube-manager.js +357 -0
- package/dist/formatters.d.ts +16 -0
- package/dist/formatters.js +174 -0
- package/dist/handlers/admin.d.ts +13 -0
- package/dist/handlers/admin.js +331 -0
- package/dist/handlers/calendar.d.ts +8 -0
- package/dist/handlers/calendar.js +281 -0
- package/dist/handlers/graph.d.ts +11 -0
- package/dist/handlers/graph.js +502 -0
- package/dist/handlers/index.d.ts +7 -0
- package/dist/handlers/index.js +71 -0
- package/dist/handlers/memory.d.ts +12 -0
- package/dist/handlers/memory.js +270 -0
- package/dist/handlers/search.d.ts +11 -0
- package/dist/handlers/search.js +334 -0
- package/dist/handlers/utils.d.ts +22 -0
- package/dist/handlers/utils.js +75 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +18 -0
- package/dist/keyword-enhancer.d.ts +18 -0
- package/dist/keyword-enhancer.js +335 -0
- package/dist/memory-analysis.d.ts +7 -0
- package/dist/memory-analysis.js +45 -0
- package/dist/models.d.ts +21 -0
- package/dist/models.js +101 -0
- package/dist/query-processing.d.ts +20 -0
- package/dist/query-processing.js +265 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +114 -0
- package/dist/tools-registry.d.ts +303 -0
- package/dist/tools-registry.js +369 -0
- package/dist/types.d.ts +118 -0
- package/dist/types.js +5 -0
- package/package.json +53 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MemOS MCP Server TypeScript Interfaces and Types
|
|
3
|
+
*/
|
|
4
|
+
export interface ApiResponse<T = unknown> {
|
|
5
|
+
code: number;
|
|
6
|
+
message?: string;
|
|
7
|
+
data?: T;
|
|
8
|
+
}
|
|
9
|
+
export interface MemoryNode {
|
|
10
|
+
id: string;
|
|
11
|
+
memory: string;
|
|
12
|
+
key?: string;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
background?: string;
|
|
15
|
+
updated_at?: string;
|
|
16
|
+
created_at?: string;
|
|
17
|
+
timestamp?: string;
|
|
18
|
+
metadata?: MemoryMetadata;
|
|
19
|
+
sources?: Array<string | Record<string, unknown>>;
|
|
20
|
+
relations?: unknown[];
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
export interface MemoryMetadata {
|
|
24
|
+
relativity?: number;
|
|
25
|
+
temporal_rank?: number;
|
|
26
|
+
source?: string;
|
|
27
|
+
updated_at?: string;
|
|
28
|
+
created_at?: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
key?: string;
|
|
31
|
+
tags?: string[];
|
|
32
|
+
sources?: Array<string | Record<string, unknown>>;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface MemoriesData {
|
|
36
|
+
nodes?: MemoryNode[];
|
|
37
|
+
edges?: GraphEdge[];
|
|
38
|
+
}
|
|
39
|
+
export interface CubeMemories {
|
|
40
|
+
cube_id?: string;
|
|
41
|
+
memories: MemoriesData | MemoryNode[];
|
|
42
|
+
_source?: string;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
export interface SearchData {
|
|
46
|
+
text_mem?: CubeMemories[];
|
|
47
|
+
}
|
|
48
|
+
export interface GraphEdge {
|
|
49
|
+
source?: string;
|
|
50
|
+
target?: string;
|
|
51
|
+
type?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface MemosConfig {
|
|
54
|
+
memosUrl: string;
|
|
55
|
+
memosUser: string;
|
|
56
|
+
defaultCubeId: string;
|
|
57
|
+
cubesDir: string;
|
|
58
|
+
timeoutTool: number;
|
|
59
|
+
timeoutStartup: number;
|
|
60
|
+
timeoutHealth: number;
|
|
61
|
+
apiWaitMax: number;
|
|
62
|
+
enableDelete: boolean;
|
|
63
|
+
neo4jHttpUrl?: string;
|
|
64
|
+
neo4jUser?: string;
|
|
65
|
+
neo4jPassword?: string;
|
|
66
|
+
}
|
|
67
|
+
export type QueryIntent = "causal" | "related" | "conflict" | "temporal" | "default";
|
|
68
|
+
export interface QueryProcessingResult {
|
|
69
|
+
intent: QueryIntent;
|
|
70
|
+
keywords: string[];
|
|
71
|
+
memType?: string;
|
|
72
|
+
cleanedQuery: string;
|
|
73
|
+
}
|
|
74
|
+
export interface MemoryMinimal {
|
|
75
|
+
id: string;
|
|
76
|
+
memoryType: string;
|
|
77
|
+
summary: string;
|
|
78
|
+
createdAt?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface MemoryBrief extends MemoryMinimal {
|
|
81
|
+
key?: string;
|
|
82
|
+
tags: string[];
|
|
83
|
+
relevance: number;
|
|
84
|
+
}
|
|
85
|
+
export interface MemoryFull extends MemoryBrief {
|
|
86
|
+
content: string;
|
|
87
|
+
background?: string;
|
|
88
|
+
cubeId: string;
|
|
89
|
+
userId: string;
|
|
90
|
+
relations: unknown[];
|
|
91
|
+
}
|
|
92
|
+
export interface CompactedResult {
|
|
93
|
+
preview: MemoryMinimal[];
|
|
94
|
+
totalCount: number;
|
|
95
|
+
omittedCount: number;
|
|
96
|
+
message: string;
|
|
97
|
+
query: string;
|
|
98
|
+
cubeId: string;
|
|
99
|
+
}
|
|
100
|
+
export interface CubeInfo {
|
|
101
|
+
id: string;
|
|
102
|
+
path: string;
|
|
103
|
+
}
|
|
104
|
+
export interface CubeConfig {
|
|
105
|
+
model_schema?: string;
|
|
106
|
+
user_id?: string;
|
|
107
|
+
cube_id?: string;
|
|
108
|
+
config_filename?: string;
|
|
109
|
+
text_mem?: Record<string, unknown>;
|
|
110
|
+
act_mem?: Record<string, unknown>;
|
|
111
|
+
para_mem?: Record<string, unknown>;
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
}
|
|
114
|
+
export interface TextContent {
|
|
115
|
+
type: "text";
|
|
116
|
+
text: string;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oh-memos-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP Server for oh-memos — Intelligent Memory Management (Node.js, no Python required)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"oh-memos-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**/*.js",
|
|
12
|
+
"dist/**/*.d.ts",
|
|
13
|
+
"README.md",
|
|
14
|
+
".env.example"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"dev": "tsx src/index.ts",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18.0.0"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"mcp",
|
|
26
|
+
"memory",
|
|
27
|
+
"memos",
|
|
28
|
+
"claude",
|
|
29
|
+
"ai",
|
|
30
|
+
"knowledge-graph"
|
|
31
|
+
],
|
|
32
|
+
"author": "xigou",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/xigou/oh-memos.git",
|
|
37
|
+
"directory": "mcp-server-node"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/xigou/oh-memos/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/xigou/oh-memos/tree/main/mcp-server-node",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
45
|
+
"dotenv": "^16.0.0",
|
|
46
|
+
"zod": "^3.25.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^22.0.0",
|
|
50
|
+
"tsx": "^4.19.0",
|
|
51
|
+
"typescript": "^5.5.0"
|
|
52
|
+
}
|
|
53
|
+
}
|