@skillkit/mcp-memory 1.8.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/LICENSE +190 -0
- package/README.md +157 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +558 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 Rohit Ghumare
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# @skillkit/mcp-memory
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for SkillKit persistent memory. Enables Claude, Cursor, and other MCP-compatible tools to store, search, and recall memories with semantic embeddings.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @skillkit/mcp-memory
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @skillkit/mcp-memory
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage with Claude Desktop
|
|
14
|
+
|
|
15
|
+
Add to your `claude_desktop_config.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"skillkit-memory": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["@skillkit/mcp-memory"],
|
|
23
|
+
"env": {
|
|
24
|
+
"SKILLKIT_AGENT_ID": "claude-desktop"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage with Cursor
|
|
32
|
+
|
|
33
|
+
Add to your Cursor MCP settings:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"mcpServers": {
|
|
38
|
+
"skillkit-memory": {
|
|
39
|
+
"command": "npx",
|
|
40
|
+
"args": ["@skillkit/mcp-memory"],
|
|
41
|
+
"env": {
|
|
42
|
+
"SKILLKIT_AGENT_ID": "cursor"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Environment Variables
|
|
50
|
+
|
|
51
|
+
- `SKILLKIT_AGENT_ID` - Agent identifier for memory isolation (default: `mcp-memory-server`)
|
|
52
|
+
- `SKILLKIT_MEMORY_DB_PATH` - Custom database path (default: `~/.skillkit/memory.db`)
|
|
53
|
+
|
|
54
|
+
## Available Tools
|
|
55
|
+
|
|
56
|
+
### memory_store
|
|
57
|
+
Store a new memory with semantic embedding.
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
memory_store({
|
|
61
|
+
content: "User prefers TypeScript over JavaScript",
|
|
62
|
+
category: "preference",
|
|
63
|
+
tags: ["language", "coding"]
|
|
64
|
+
})
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### memory_search
|
|
68
|
+
Semantic search through stored memories.
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
memory_search({
|
|
72
|
+
query: "What programming languages does the user prefer?",
|
|
73
|
+
limit: 5,
|
|
74
|
+
threshold: 0.5
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### memory_recall
|
|
79
|
+
Recall memories by category, tier, or tags.
|
|
80
|
+
|
|
81
|
+
```js
|
|
82
|
+
memory_recall({
|
|
83
|
+
category: "decision",
|
|
84
|
+
tier: "long",
|
|
85
|
+
limit: 10
|
|
86
|
+
})
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### memory_get
|
|
90
|
+
Get a specific memory by ID.
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
memory_get({ id: "memory-uuid" })
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### memory_forget
|
|
97
|
+
Delete a memory.
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
memory_forget({ id: "memory-uuid" })
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### memory_link
|
|
104
|
+
Create relationships between memories.
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
memory_link({
|
|
108
|
+
sourceId: "memory-1",
|
|
109
|
+
targetId: "memory-2",
|
|
110
|
+
relationshipType: "supports",
|
|
111
|
+
strength: 0.8
|
|
112
|
+
})
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### memory_reinforce
|
|
116
|
+
Strengthen or weaken a memory. Strong memories get promoted to long-term tier.
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
memory_reinforce({
|
|
120
|
+
id: "memory-uuid",
|
|
121
|
+
amount: 0.1 // positive to strengthen, negative to weaken
|
|
122
|
+
})
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### memory_stats
|
|
126
|
+
Get memory statistics.
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
memory_stats({})
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Memory Categories
|
|
133
|
+
|
|
134
|
+
- `fact` - Factual information
|
|
135
|
+
- `decision` - Decisions made
|
|
136
|
+
- `preference` - User preferences
|
|
137
|
+
- `pattern` - Observed patterns
|
|
138
|
+
- `insight` - Derived insights
|
|
139
|
+
- `reasoning` - Reasoning chains
|
|
140
|
+
|
|
141
|
+
## Memory Tiers
|
|
142
|
+
|
|
143
|
+
- `warm` - Recent, frequently accessed memories
|
|
144
|
+
- `long` - Consolidated long-term memories
|
|
145
|
+
|
|
146
|
+
Memories are automatically promoted from `warm` to `long` based on access count, reinforcement score, and age.
|
|
147
|
+
|
|
148
|
+
## Resources
|
|
149
|
+
|
|
150
|
+
The server exposes two resources:
|
|
151
|
+
|
|
152
|
+
- `memory://stats` - Current memory statistics (JSON)
|
|
153
|
+
- `memory://recent` - 10 most recent memories (JSON)
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
Apache-2.0
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
|
|
3
|
+
declare const server: Server<{
|
|
4
|
+
method: string;
|
|
5
|
+
params?: {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
_meta?: {
|
|
8
|
+
[x: string]: unknown;
|
|
9
|
+
progressToken?: string | number | undefined;
|
|
10
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
11
|
+
taskId: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
method: string;
|
|
17
|
+
params?: {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
_meta?: {
|
|
20
|
+
[x: string]: unknown;
|
|
21
|
+
progressToken?: string | number | undefined;
|
|
22
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
23
|
+
taskId: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
[x: string]: unknown;
|
|
29
|
+
_meta?: {
|
|
30
|
+
[x: string]: unknown;
|
|
31
|
+
progressToken?: string | number | undefined;
|
|
32
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
33
|
+
taskId: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
} | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
|
|
38
|
+
export { server };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
import {
|
|
8
|
+
CallToolRequestSchema,
|
|
9
|
+
ListToolsRequestSchema,
|
|
10
|
+
ListResourcesRequestSchema,
|
|
11
|
+
ReadResourceRequestSchema
|
|
12
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
13
|
+
import { createMemoryStore } from "@skillkit/memory";
|
|
14
|
+
|
|
15
|
+
// src/types.ts
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
var MemoryCategorySchema = z.enum([
|
|
18
|
+
"fact",
|
|
19
|
+
"decision",
|
|
20
|
+
"preference",
|
|
21
|
+
"pattern",
|
|
22
|
+
"insight",
|
|
23
|
+
"reasoning"
|
|
24
|
+
]);
|
|
25
|
+
var MemoryTierSchema = z.enum(["warm", "long"]);
|
|
26
|
+
var RelationshipTypeSchema = z.enum([
|
|
27
|
+
"related",
|
|
28
|
+
"derived",
|
|
29
|
+
"contradicts",
|
|
30
|
+
"supports"
|
|
31
|
+
]);
|
|
32
|
+
var StoreMemoryInputSchema = z.object({
|
|
33
|
+
content: z.string().describe("The memory content to store"),
|
|
34
|
+
category: MemoryCategorySchema.describe("Category of the memory"),
|
|
35
|
+
tags: z.array(z.string()).optional().describe("Optional tags for organization"),
|
|
36
|
+
metadata: z.record(z.unknown()).optional().describe("Optional metadata")
|
|
37
|
+
});
|
|
38
|
+
var SearchMemoryInputSchema = z.object({
|
|
39
|
+
query: z.string().describe("Semantic search query"),
|
|
40
|
+
category: MemoryCategorySchema.optional().describe("Filter by category"),
|
|
41
|
+
tier: MemoryTierSchema.optional().describe("Filter by tier (warm or long)"),
|
|
42
|
+
tags: z.array(z.string()).optional().describe("Filter by tags"),
|
|
43
|
+
limit: z.number().min(1).max(50).default(10).describe("Maximum results to return"),
|
|
44
|
+
threshold: z.number().min(0).max(1).default(0.5).describe("Minimum similarity threshold")
|
|
45
|
+
});
|
|
46
|
+
var RecallMemoryInputSchema = z.object({
|
|
47
|
+
category: MemoryCategorySchema.optional().describe("Filter by category"),
|
|
48
|
+
tier: MemoryTierSchema.optional().describe("Filter by tier"),
|
|
49
|
+
tags: z.array(z.string()).optional().describe("Filter by tags"),
|
|
50
|
+
limit: z.number().min(1).max(100).default(20).describe("Maximum results")
|
|
51
|
+
});
|
|
52
|
+
var ForgetMemoryInputSchema = z.object({
|
|
53
|
+
id: z.string().describe("Memory ID to delete")
|
|
54
|
+
});
|
|
55
|
+
var LinkMemoriesInputSchema = z.object({
|
|
56
|
+
sourceId: z.string().describe("Source memory ID"),
|
|
57
|
+
targetId: z.string().describe("Target memory ID"),
|
|
58
|
+
relationshipType: RelationshipTypeSchema.describe("Type of relationship"),
|
|
59
|
+
strength: z.number().min(0).max(1).default(0.5).describe("Relationship strength")
|
|
60
|
+
});
|
|
61
|
+
var GetMemoryInputSchema = z.object({
|
|
62
|
+
id: z.string().describe("Memory ID to retrieve")
|
|
63
|
+
});
|
|
64
|
+
var ReinforceMemoryInputSchema = z.object({
|
|
65
|
+
id: z.string().describe("Memory ID to reinforce"),
|
|
66
|
+
amount: z.number().min(-1).max(1).default(0.1).describe("Reinforcement amount (-1 to 1)")
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// src/index.ts
|
|
70
|
+
var AGENT_ID = process.env.SKILLKIT_AGENT_ID || "mcp-memory-server";
|
|
71
|
+
var DB_PATH = process.env.SKILLKIT_MEMORY_DB_PATH;
|
|
72
|
+
var memoryStore = null;
|
|
73
|
+
var memoryStoreInit = null;
|
|
74
|
+
async function getMemoryStore() {
|
|
75
|
+
if (memoryStore) {
|
|
76
|
+
return memoryStore;
|
|
77
|
+
}
|
|
78
|
+
if (!memoryStoreInit) {
|
|
79
|
+
memoryStoreInit = createMemoryStore(AGENT_ID, DB_PATH);
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
memoryStore = await memoryStoreInit;
|
|
83
|
+
return memoryStore;
|
|
84
|
+
} catch (error) {
|
|
85
|
+
memoryStoreInit = null;
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
var server = new Server(
|
|
90
|
+
{
|
|
91
|
+
name: "skillkit-memory-server",
|
|
92
|
+
version: "1.7.11"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
capabilities: {
|
|
96
|
+
tools: {},
|
|
97
|
+
resources: {}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
102
|
+
return {
|
|
103
|
+
tools: [
|
|
104
|
+
{
|
|
105
|
+
name: "memory_store",
|
|
106
|
+
description: "Store a new memory with semantic embedding for later retrieval. Memories are categorized and can be tagged for organization.",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
content: { type: "string", description: "The memory content to store" },
|
|
111
|
+
category: {
|
|
112
|
+
type: "string",
|
|
113
|
+
enum: ["fact", "decision", "preference", "pattern", "insight", "reasoning"],
|
|
114
|
+
description: "Category of the memory"
|
|
115
|
+
},
|
|
116
|
+
tags: {
|
|
117
|
+
type: "array",
|
|
118
|
+
items: { type: "string" },
|
|
119
|
+
description: "Optional tags for organization"
|
|
120
|
+
},
|
|
121
|
+
metadata: {
|
|
122
|
+
type: "object",
|
|
123
|
+
description: "Optional metadata"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
required: ["content", "category"]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "memory_search",
|
|
131
|
+
description: "Semantic search through stored memories. Returns memories most similar to the query.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
query: { type: "string", description: "Semantic search query" },
|
|
136
|
+
category: {
|
|
137
|
+
type: "string",
|
|
138
|
+
enum: ["fact", "decision", "preference", "pattern", "insight", "reasoning"],
|
|
139
|
+
description: "Filter by category"
|
|
140
|
+
},
|
|
141
|
+
tier: {
|
|
142
|
+
type: "string",
|
|
143
|
+
enum: ["warm", "long"],
|
|
144
|
+
description: "Filter by tier"
|
|
145
|
+
},
|
|
146
|
+
tags: {
|
|
147
|
+
type: "array",
|
|
148
|
+
items: { type: "string" },
|
|
149
|
+
description: "Filter by tags"
|
|
150
|
+
},
|
|
151
|
+
limit: {
|
|
152
|
+
type: "number",
|
|
153
|
+
minimum: 1,
|
|
154
|
+
maximum: 50,
|
|
155
|
+
default: 10,
|
|
156
|
+
description: "Maximum results"
|
|
157
|
+
},
|
|
158
|
+
threshold: {
|
|
159
|
+
type: "number",
|
|
160
|
+
minimum: 0,
|
|
161
|
+
maximum: 1,
|
|
162
|
+
default: 0.5,
|
|
163
|
+
description: "Minimum similarity threshold"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
required: ["query"]
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "memory_recall",
|
|
171
|
+
description: "Recall memories by category, tier, or tags without semantic search.",
|
|
172
|
+
inputSchema: {
|
|
173
|
+
type: "object",
|
|
174
|
+
properties: {
|
|
175
|
+
category: {
|
|
176
|
+
type: "string",
|
|
177
|
+
enum: ["fact", "decision", "preference", "pattern", "insight", "reasoning"],
|
|
178
|
+
description: "Filter by category"
|
|
179
|
+
},
|
|
180
|
+
tier: {
|
|
181
|
+
type: "string",
|
|
182
|
+
enum: ["warm", "long"],
|
|
183
|
+
description: "Filter by tier"
|
|
184
|
+
},
|
|
185
|
+
tags: {
|
|
186
|
+
type: "array",
|
|
187
|
+
items: { type: "string" },
|
|
188
|
+
description: "Filter by tags"
|
|
189
|
+
},
|
|
190
|
+
limit: {
|
|
191
|
+
type: "number",
|
|
192
|
+
minimum: 1,
|
|
193
|
+
maximum: 100,
|
|
194
|
+
default: 20,
|
|
195
|
+
description: "Maximum results"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "memory_get",
|
|
202
|
+
description: "Get a specific memory by its ID.",
|
|
203
|
+
inputSchema: {
|
|
204
|
+
type: "object",
|
|
205
|
+
properties: {
|
|
206
|
+
id: { type: "string", description: "Memory ID" }
|
|
207
|
+
},
|
|
208
|
+
required: ["id"]
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "memory_forget",
|
|
213
|
+
description: "Delete a memory by its ID.",
|
|
214
|
+
inputSchema: {
|
|
215
|
+
type: "object",
|
|
216
|
+
properties: {
|
|
217
|
+
id: { type: "string", description: "Memory ID to delete" }
|
|
218
|
+
},
|
|
219
|
+
required: ["id"]
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "memory_link",
|
|
224
|
+
description: "Create a relationship link between two memories.",
|
|
225
|
+
inputSchema: {
|
|
226
|
+
type: "object",
|
|
227
|
+
properties: {
|
|
228
|
+
sourceId: { type: "string", description: "Source memory ID" },
|
|
229
|
+
targetId: { type: "string", description: "Target memory ID" },
|
|
230
|
+
relationshipType: {
|
|
231
|
+
type: "string",
|
|
232
|
+
enum: ["related", "derived", "contradicts", "supports"],
|
|
233
|
+
description: "Type of relationship"
|
|
234
|
+
},
|
|
235
|
+
strength: {
|
|
236
|
+
type: "number",
|
|
237
|
+
minimum: 0,
|
|
238
|
+
maximum: 1,
|
|
239
|
+
default: 0.5,
|
|
240
|
+
description: "Relationship strength"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
required: ["sourceId", "targetId", "relationshipType"]
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "memory_reinforce",
|
|
248
|
+
description: "Reinforce or weaken a memory. Positive values strengthen, negative weaken. Strong memories get promoted to long-term tier.",
|
|
249
|
+
inputSchema: {
|
|
250
|
+
type: "object",
|
|
251
|
+
properties: {
|
|
252
|
+
id: { type: "string", description: "Memory ID" },
|
|
253
|
+
amount: {
|
|
254
|
+
type: "number",
|
|
255
|
+
minimum: -1,
|
|
256
|
+
maximum: 1,
|
|
257
|
+
default: 0.1,
|
|
258
|
+
description: "Reinforcement amount"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
required: ["id"]
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: "memory_stats",
|
|
266
|
+
description: "Get statistics about stored memories.",
|
|
267
|
+
inputSchema: {
|
|
268
|
+
type: "object",
|
|
269
|
+
properties: {}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
276
|
+
const { name, arguments: args } = request.params;
|
|
277
|
+
const store = await getMemoryStore();
|
|
278
|
+
try {
|
|
279
|
+
switch (name) {
|
|
280
|
+
case "memory_store": {
|
|
281
|
+
const input = StoreMemoryInputSchema.parse(args);
|
|
282
|
+
const memory = await store.create({
|
|
283
|
+
agentId: AGENT_ID,
|
|
284
|
+
content: input.content,
|
|
285
|
+
category: input.category,
|
|
286
|
+
tags: input.tags,
|
|
287
|
+
metadata: input.metadata
|
|
288
|
+
});
|
|
289
|
+
return {
|
|
290
|
+
content: [
|
|
291
|
+
{
|
|
292
|
+
type: "text",
|
|
293
|
+
text: `Memory stored successfully.
|
|
294
|
+
|
|
295
|
+
ID: ${memory.id}
|
|
296
|
+
Category: ${memory.category}
|
|
297
|
+
Tier: ${memory.tier}
|
|
298
|
+
Tags: ${memory.tags.join(", ") || "none"}`
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
case "memory_search": {
|
|
304
|
+
const input = SearchMemoryInputSchema.parse(args);
|
|
305
|
+
const results = await store.semanticSearch(input.query, {
|
|
306
|
+
agentId: AGENT_ID,
|
|
307
|
+
category: input.category,
|
|
308
|
+
tier: input.tier,
|
|
309
|
+
tags: input.tags,
|
|
310
|
+
limit: input.limit,
|
|
311
|
+
threshold: input.threshold
|
|
312
|
+
});
|
|
313
|
+
if (results.length === 0) {
|
|
314
|
+
return {
|
|
315
|
+
content: [{ type: "text", text: "No memories found matching your query." }]
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
const formatted = results.map(
|
|
319
|
+
(r, i) => `${i + 1}. [${r.memory.category}] (score: ${r.score.toFixed(3)})
|
|
320
|
+
ID: ${r.memory.id}
|
|
321
|
+
${r.memory.content}
|
|
322
|
+
Tags: ${r.memory.tags.join(", ") || "none"}`
|
|
323
|
+
).join("\n\n");
|
|
324
|
+
return {
|
|
325
|
+
content: [
|
|
326
|
+
{
|
|
327
|
+
type: "text",
|
|
328
|
+
text: `Found ${results.length} memories:
|
|
329
|
+
|
|
330
|
+
${formatted}`
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
case "memory_recall": {
|
|
336
|
+
const input = RecallMemoryInputSchema.parse(args);
|
|
337
|
+
let memories = await store.list(AGENT_ID, input.limit ?? 20);
|
|
338
|
+
if (input.category) {
|
|
339
|
+
memories = memories.filter((m) => m.category === input.category);
|
|
340
|
+
}
|
|
341
|
+
if (input.tier) {
|
|
342
|
+
memories = memories.filter((m) => m.tier === input.tier);
|
|
343
|
+
}
|
|
344
|
+
if (input.tags && input.tags.length > 0) {
|
|
345
|
+
memories = memories.filter(
|
|
346
|
+
(m) => input.tags.some((tag) => m.tags.includes(tag))
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
if (memories.length === 0) {
|
|
350
|
+
return {
|
|
351
|
+
content: [{ type: "text", text: "No memories found with the specified filters." }]
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
const formatted = memories.map(
|
|
355
|
+
(m, i) => `${i + 1}. [${m.category}] (${m.tier})
|
|
356
|
+
ID: ${m.id}
|
|
357
|
+
${m.content}
|
|
358
|
+
Score: ${m.reinforcementScore.toFixed(2)} | Access: ${m.accessCount}`
|
|
359
|
+
).join("\n\n");
|
|
360
|
+
return {
|
|
361
|
+
content: [
|
|
362
|
+
{
|
|
363
|
+
type: "text",
|
|
364
|
+
text: `Recalled ${memories.length} memories:
|
|
365
|
+
|
|
366
|
+
${formatted}`
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
case "memory_get": {
|
|
372
|
+
const input = GetMemoryInputSchema.parse(args);
|
|
373
|
+
const memory = await store.get(input.id);
|
|
374
|
+
if (!memory) {
|
|
375
|
+
return {
|
|
376
|
+
content: [{ type: "text", text: `Memory not found: ${input.id}` }],
|
|
377
|
+
isError: true
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
return {
|
|
381
|
+
content: [
|
|
382
|
+
{
|
|
383
|
+
type: "text",
|
|
384
|
+
text: `Memory Details:
|
|
385
|
+
|
|
386
|
+
ID: ${memory.id}
|
|
387
|
+
Category: ${memory.category}
|
|
388
|
+
Tier: ${memory.tier}
|
|
389
|
+
Content: ${memory.content}
|
|
390
|
+
Tags: ${memory.tags.join(", ") || "none"}
|
|
391
|
+
Reinforcement: ${memory.reinforcementScore.toFixed(2)}
|
|
392
|
+
Access Count: ${memory.accessCount}
|
|
393
|
+
Created: ${memory.createdAt}
|
|
394
|
+
Last Accessed: ${memory.lastAccessedAt}`
|
|
395
|
+
}
|
|
396
|
+
]
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
case "memory_forget": {
|
|
400
|
+
const input = ForgetMemoryInputSchema.parse(args);
|
|
401
|
+
const existing = await store.get(input.id);
|
|
402
|
+
if (!existing) {
|
|
403
|
+
return {
|
|
404
|
+
content: [{ type: "text", text: `Memory not found: ${input.id}` }],
|
|
405
|
+
isError: true
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
await store.delete(input.id);
|
|
409
|
+
return {
|
|
410
|
+
content: [{ type: "text", text: `Memory deleted: ${input.id}` }]
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
case "memory_link": {
|
|
414
|
+
const input = LinkMemoriesInputSchema.parse(args);
|
|
415
|
+
const link = await store.link(
|
|
416
|
+
input.sourceId,
|
|
417
|
+
input.targetId,
|
|
418
|
+
input.relationshipType,
|
|
419
|
+
input.strength
|
|
420
|
+
);
|
|
421
|
+
return {
|
|
422
|
+
content: [
|
|
423
|
+
{
|
|
424
|
+
type: "text",
|
|
425
|
+
text: `Link created:
|
|
426
|
+
|
|
427
|
+
ID: ${link.id}
|
|
428
|
+
${input.sourceId} --[${input.relationshipType}]--> ${input.targetId}
|
|
429
|
+
Strength: ${link.strength}`
|
|
430
|
+
}
|
|
431
|
+
]
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
case "memory_reinforce": {
|
|
435
|
+
const input = ReinforceMemoryInputSchema.parse(args);
|
|
436
|
+
const existing = await store.get(input.id);
|
|
437
|
+
if (!existing) {
|
|
438
|
+
return {
|
|
439
|
+
content: [{ type: "text", text: `Memory not found: ${input.id}` }],
|
|
440
|
+
isError: true
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
const memory = await store.reinforce(input.id, input.amount ?? 0.1);
|
|
444
|
+
return {
|
|
445
|
+
content: [
|
|
446
|
+
{
|
|
447
|
+
type: "text",
|
|
448
|
+
text: `Memory reinforced:
|
|
449
|
+
|
|
450
|
+
ID: ${memory.id}
|
|
451
|
+
New Score: ${memory.reinforcementScore.toFixed(2)}
|
|
452
|
+
Tier: ${memory.tier}`
|
|
453
|
+
}
|
|
454
|
+
]
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
case "memory_stats": {
|
|
458
|
+
const stats = await store.getStats(AGENT_ID);
|
|
459
|
+
const categoryBreakdown = Object.entries(stats.byCategory).map(([cat, count]) => ` ${cat}: ${count}`).join("\n");
|
|
460
|
+
const tierBreakdown = Object.entries(stats.byTier).map(([tier, count]) => ` ${tier}: ${count}`).join("\n");
|
|
461
|
+
return {
|
|
462
|
+
content: [
|
|
463
|
+
{
|
|
464
|
+
type: "text",
|
|
465
|
+
text: `Memory Statistics:
|
|
466
|
+
|
|
467
|
+
Total Memories: ${stats.totalMemories}
|
|
468
|
+
Average Reinforcement: ${stats.avgReinforcementScore.toFixed(2)}
|
|
469
|
+
|
|
470
|
+
By Category:
|
|
471
|
+
${categoryBreakdown}
|
|
472
|
+
|
|
473
|
+
By Tier:
|
|
474
|
+
${tierBreakdown}
|
|
475
|
+
|
|
476
|
+
Oldest: ${stats.oldestMemory || "N/A"}
|
|
477
|
+
Newest: ${stats.newestMemory || "N/A"}`
|
|
478
|
+
}
|
|
479
|
+
]
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
default:
|
|
483
|
+
return {
|
|
484
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
485
|
+
isError: true
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
} catch (error) {
|
|
489
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
490
|
+
return {
|
|
491
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
492
|
+
isError: true
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
497
|
+
return {
|
|
498
|
+
resources: [
|
|
499
|
+
{
|
|
500
|
+
uri: "memory://stats",
|
|
501
|
+
name: "Memory Statistics",
|
|
502
|
+
description: "Current memory store statistics",
|
|
503
|
+
mimeType: "application/json"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
uri: "memory://recent",
|
|
507
|
+
name: "Recent Memories",
|
|
508
|
+
description: "Most recently accessed memories",
|
|
509
|
+
mimeType: "application/json"
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
};
|
|
513
|
+
});
|
|
514
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
515
|
+
const { uri } = request.params;
|
|
516
|
+
const store = await getMemoryStore();
|
|
517
|
+
if (uri === "memory://stats") {
|
|
518
|
+
const stats = await store.getStats(AGENT_ID);
|
|
519
|
+
return {
|
|
520
|
+
contents: [
|
|
521
|
+
{
|
|
522
|
+
uri,
|
|
523
|
+
mimeType: "application/json",
|
|
524
|
+
text: JSON.stringify(stats, null, 2)
|
|
525
|
+
}
|
|
526
|
+
]
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
if (uri === "memory://recent") {
|
|
530
|
+
const memories = await store.list(AGENT_ID, 10);
|
|
531
|
+
return {
|
|
532
|
+
contents: [
|
|
533
|
+
{
|
|
534
|
+
uri,
|
|
535
|
+
mimeType: "application/json",
|
|
536
|
+
text: JSON.stringify(memories, null, 2)
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
throw new Error(`Unknown resource: ${uri}`);
|
|
542
|
+
});
|
|
543
|
+
async function main() {
|
|
544
|
+
const transport = new StdioServerTransport();
|
|
545
|
+
await server.connect(transport);
|
|
546
|
+
console.error("SkillKit Memory MCP Server running on stdio");
|
|
547
|
+
}
|
|
548
|
+
var isMain = process.argv[1] === fileURLToPath(import.meta.url);
|
|
549
|
+
if (isMain) {
|
|
550
|
+
main().catch((error) => {
|
|
551
|
+
console.error("Fatal error:", error);
|
|
552
|
+
process.exit(1);
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
export {
|
|
556
|
+
server
|
|
557
|
+
};
|
|
558
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types.ts"],"sourcesContent":["import { Server } from '@modelcontextprotocol/sdk/server/index.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { fileURLToPath } from 'node:url';\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n ListResourcesRequestSchema,\n ReadResourceRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js';\nimport { createMemoryStore, type MemoryStore } from '@skillkit/memory';\nimport {\n StoreMemoryInputSchema,\n SearchMemoryInputSchema,\n RecallMemoryInputSchema,\n ForgetMemoryInputSchema,\n LinkMemoriesInputSchema,\n GetMemoryInputSchema,\n ReinforceMemoryInputSchema,\n} from './types.js';\n\nconst AGENT_ID = process.env.SKILLKIT_AGENT_ID || 'mcp-memory-server';\nconst DB_PATH = process.env.SKILLKIT_MEMORY_DB_PATH;\n\nlet memoryStore: MemoryStore | null = null;\nlet memoryStoreInit: Promise<MemoryStore> | null = null;\n\nasync function getMemoryStore(): Promise<MemoryStore> {\n if (memoryStore) {\n return memoryStore;\n }\n if (!memoryStoreInit) {\n memoryStoreInit = createMemoryStore(AGENT_ID, DB_PATH);\n }\n try {\n memoryStore = await memoryStoreInit;\n return memoryStore;\n } catch (error) {\n memoryStoreInit = null;\n throw error;\n }\n}\n\nconst server = new Server(\n {\n name: 'skillkit-memory-server',\n version: '1.7.11',\n },\n {\n capabilities: {\n tools: {},\n resources: {},\n },\n }\n);\n\nserver.setRequestHandler(ListToolsRequestSchema, async () => {\n return {\n tools: [\n {\n name: 'memory_store',\n description: 'Store a new memory with semantic embedding for later retrieval. Memories are categorized and can be tagged for organization.',\n inputSchema: {\n type: 'object',\n properties: {\n content: { type: 'string', description: 'The memory content to store' },\n category: {\n type: 'string',\n enum: ['fact', 'decision', 'preference', 'pattern', 'insight', 'reasoning'],\n description: 'Category of the memory',\n },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Optional tags for organization',\n },\n metadata: {\n type: 'object',\n description: 'Optional metadata',\n },\n },\n required: ['content', 'category'],\n },\n },\n {\n name: 'memory_search',\n description: 'Semantic search through stored memories. Returns memories most similar to the query.',\n inputSchema: {\n type: 'object',\n properties: {\n query: { type: 'string', description: 'Semantic search query' },\n category: {\n type: 'string',\n enum: ['fact', 'decision', 'preference', 'pattern', 'insight', 'reasoning'],\n description: 'Filter by category',\n },\n tier: {\n type: 'string',\n enum: ['warm', 'long'],\n description: 'Filter by tier',\n },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Filter by tags',\n },\n limit: {\n type: 'number',\n minimum: 1,\n maximum: 50,\n default: 10,\n description: 'Maximum results',\n },\n threshold: {\n type: 'number',\n minimum: 0,\n maximum: 1,\n default: 0.5,\n description: 'Minimum similarity threshold',\n },\n },\n required: ['query'],\n },\n },\n {\n name: 'memory_recall',\n description: 'Recall memories by category, tier, or tags without semantic search.',\n inputSchema: {\n type: 'object',\n properties: {\n category: {\n type: 'string',\n enum: ['fact', 'decision', 'preference', 'pattern', 'insight', 'reasoning'],\n description: 'Filter by category',\n },\n tier: {\n type: 'string',\n enum: ['warm', 'long'],\n description: 'Filter by tier',\n },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Filter by tags',\n },\n limit: {\n type: 'number',\n minimum: 1,\n maximum: 100,\n default: 20,\n description: 'Maximum results',\n },\n },\n },\n },\n {\n name: 'memory_get',\n description: 'Get a specific memory by its ID.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { type: 'string', description: 'Memory ID' },\n },\n required: ['id'],\n },\n },\n {\n name: 'memory_forget',\n description: 'Delete a memory by its ID.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { type: 'string', description: 'Memory ID to delete' },\n },\n required: ['id'],\n },\n },\n {\n name: 'memory_link',\n description: 'Create a relationship link between two memories.',\n inputSchema: {\n type: 'object',\n properties: {\n sourceId: { type: 'string', description: 'Source memory ID' },\n targetId: { type: 'string', description: 'Target memory ID' },\n relationshipType: {\n type: 'string',\n enum: ['related', 'derived', 'contradicts', 'supports'],\n description: 'Type of relationship',\n },\n strength: {\n type: 'number',\n minimum: 0,\n maximum: 1,\n default: 0.5,\n description: 'Relationship strength',\n },\n },\n required: ['sourceId', 'targetId', 'relationshipType'],\n },\n },\n {\n name: 'memory_reinforce',\n description: 'Reinforce or weaken a memory. Positive values strengthen, negative weaken. Strong memories get promoted to long-term tier.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { type: 'string', description: 'Memory ID' },\n amount: {\n type: 'number',\n minimum: -1,\n maximum: 1,\n default: 0.1,\n description: 'Reinforcement amount',\n },\n },\n required: ['id'],\n },\n },\n {\n name: 'memory_stats',\n description: 'Get statistics about stored memories.',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n ],\n };\n});\n\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name, arguments: args } = request.params;\n const store = await getMemoryStore();\n\n try {\n switch (name) {\n case 'memory_store': {\n const input = StoreMemoryInputSchema.parse(args);\n const memory = await store.create({\n agentId: AGENT_ID,\n content: input.content,\n category: input.category,\n tags: input.tags,\n metadata: input.metadata,\n });\n return {\n content: [\n {\n type: 'text',\n text: `Memory stored successfully.\\n\\nID: ${memory.id}\\nCategory: ${memory.category}\\nTier: ${memory.tier}\\nTags: ${memory.tags.join(', ') || 'none'}`,\n },\n ],\n };\n }\n\n case 'memory_search': {\n const input = SearchMemoryInputSchema.parse(args);\n const results = await store.semanticSearch(input.query, {\n agentId: AGENT_ID,\n category: input.category,\n tier: input.tier,\n tags: input.tags,\n limit: input.limit,\n threshold: input.threshold,\n });\n\n if (results.length === 0) {\n return {\n content: [{ type: 'text', text: 'No memories found matching your query.' }],\n };\n }\n\n const formatted = results\n .map(\n (r, i) =>\n `${i + 1}. [${r.memory.category}] (score: ${r.score.toFixed(3)})\\n ID: ${r.memory.id}\\n ${r.memory.content}\\n Tags: ${r.memory.tags.join(', ') || 'none'}`\n )\n .join('\\n\\n');\n\n return {\n content: [\n {\n type: 'text',\n text: `Found ${results.length} memories:\\n\\n${formatted}`,\n },\n ],\n };\n }\n\n case 'memory_recall': {\n const input = RecallMemoryInputSchema.parse(args);\n let memories = await store.list(AGENT_ID, input.limit ?? 20);\n\n if (input.category) {\n memories = memories.filter(m => m.category === input.category);\n }\n if (input.tier) {\n memories = memories.filter(m => m.tier === input.tier);\n }\n if (input.tags && input.tags.length > 0) {\n memories = memories.filter(m =>\n input.tags!.some(tag => m.tags.includes(tag))\n );\n }\n\n if (memories.length === 0) {\n return {\n content: [{ type: 'text', text: 'No memories found with the specified filters.' }],\n };\n }\n\n const formatted = memories\n .map(\n (m, i) =>\n `${i + 1}. [${m.category}] (${m.tier})\\n ID: ${m.id}\\n ${m.content}\\n Score: ${m.reinforcementScore.toFixed(2)} | Access: ${m.accessCount}`\n )\n .join('\\n\\n');\n\n return {\n content: [\n {\n type: 'text',\n text: `Recalled ${memories.length} memories:\\n\\n${formatted}`,\n },\n ],\n };\n }\n\n case 'memory_get': {\n const input = GetMemoryInputSchema.parse(args);\n const memory = await store.get(input.id);\n\n if (!memory) {\n return {\n content: [{ type: 'text', text: `Memory not found: ${input.id}` }],\n isError: true,\n };\n }\n\n return {\n content: [\n {\n type: 'text',\n text: `Memory Details:\\n\\nID: ${memory.id}\\nCategory: ${memory.category}\\nTier: ${memory.tier}\\nContent: ${memory.content}\\nTags: ${memory.tags.join(', ') || 'none'}\\nReinforcement: ${memory.reinforcementScore.toFixed(2)}\\nAccess Count: ${memory.accessCount}\\nCreated: ${memory.createdAt}\\nLast Accessed: ${memory.lastAccessedAt}`,\n },\n ],\n };\n }\n\n case 'memory_forget': {\n const input = ForgetMemoryInputSchema.parse(args);\n const existing = await store.get(input.id);\n\n if (!existing) {\n return {\n content: [{ type: 'text', text: `Memory not found: ${input.id}` }],\n isError: true,\n };\n }\n\n await store.delete(input.id);\n\n return {\n content: [{ type: 'text', text: `Memory deleted: ${input.id}` }],\n };\n }\n\n case 'memory_link': {\n const input = LinkMemoriesInputSchema.parse(args);\n const link = await store.link(\n input.sourceId,\n input.targetId,\n input.relationshipType,\n input.strength\n );\n\n return {\n content: [\n {\n type: 'text',\n text: `Link created:\\n\\nID: ${link.id}\\n${input.sourceId} --[${input.relationshipType}]--> ${input.targetId}\\nStrength: ${link.strength}`,\n },\n ],\n };\n }\n\n case 'memory_reinforce': {\n const input = ReinforceMemoryInputSchema.parse(args);\n const existing = await store.get(input.id);\n if (!existing) {\n return {\n content: [{ type: 'text', text: `Memory not found: ${input.id}` }],\n isError: true,\n };\n }\n const memory = await store.reinforce(input.id, input.amount ?? 0.1);\n return {\n content: [\n {\n type: 'text',\n text: `Memory reinforced:\\n\\nID: ${memory.id}\\nNew Score: ${memory.reinforcementScore.toFixed(2)}\\nTier: ${memory.tier}`,\n },\n ],\n };\n }\n\n case 'memory_stats': {\n const stats = await store.getStats(AGENT_ID);\n\n const categoryBreakdown = Object.entries(stats.byCategory)\n .map(([cat, count]) => ` ${cat}: ${count}`)\n .join('\\n');\n\n const tierBreakdown = Object.entries(stats.byTier)\n .map(([tier, count]) => ` ${tier}: ${count}`)\n .join('\\n');\n\n return {\n content: [\n {\n type: 'text',\n text: `Memory Statistics:\\n\\nTotal Memories: ${stats.totalMemories}\\nAverage Reinforcement: ${stats.avgReinforcementScore.toFixed(2)}\\n\\nBy Category:\\n${categoryBreakdown}\\n\\nBy Tier:\\n${tierBreakdown}\\n\\nOldest: ${stats.oldestMemory || 'N/A'}\\nNewest: ${stats.newestMemory || 'N/A'}`,\n },\n ],\n };\n }\n\n default:\n return {\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\n isError: true,\n };\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n return {\n content: [{ type: 'text', text: `Error: ${message}` }],\n isError: true,\n };\n }\n});\n\nserver.setRequestHandler(ListResourcesRequestSchema, async () => {\n return {\n resources: [\n {\n uri: 'memory://stats',\n name: 'Memory Statistics',\n description: 'Current memory store statistics',\n mimeType: 'application/json',\n },\n {\n uri: 'memory://recent',\n name: 'Recent Memories',\n description: 'Most recently accessed memories',\n mimeType: 'application/json',\n },\n ],\n };\n});\n\nserver.setRequestHandler(ReadResourceRequestSchema, async (request) => {\n const { uri } = request.params;\n const store = await getMemoryStore();\n\n if (uri === 'memory://stats') {\n const stats = await store.getStats(AGENT_ID);\n return {\n contents: [\n {\n uri,\n mimeType: 'application/json',\n text: JSON.stringify(stats, null, 2),\n },\n ],\n };\n }\n\n if (uri === 'memory://recent') {\n const memories = await store.list(AGENT_ID, 10);\n return {\n contents: [\n {\n uri,\n mimeType: 'application/json',\n text: JSON.stringify(memories, null, 2),\n },\n ],\n };\n }\n\n throw new Error(`Unknown resource: ${uri}`);\n});\n\nasync function main() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n console.error('SkillKit Memory MCP Server running on stdio');\n}\n\nconst isMain = process.argv[1] === fileURLToPath(import.meta.url);\nif (isMain) {\n main().catch((error) => {\n console.error('Fatal error:', error);\n process.exit(1);\n });\n}\n\nexport { server };\n","import { z } from 'zod';\n\nexport const MemoryCategorySchema = z.enum([\n 'fact',\n 'decision',\n 'preference',\n 'pattern',\n 'insight',\n 'reasoning',\n]);\n\nexport const MemoryTierSchema = z.enum(['warm', 'long']);\n\nexport const RelationshipTypeSchema = z.enum([\n 'related',\n 'derived',\n 'contradicts',\n 'supports',\n]);\n\nexport const StoreMemoryInputSchema = z.object({\n content: z.string().describe('The memory content to store'),\n category: MemoryCategorySchema.describe('Category of the memory'),\n tags: z.array(z.string()).optional().describe('Optional tags for organization'),\n metadata: z.record(z.unknown()).optional().describe('Optional metadata'),\n});\n\nexport const SearchMemoryInputSchema = z.object({\n query: z.string().describe('Semantic search query'),\n category: MemoryCategorySchema.optional().describe('Filter by category'),\n tier: MemoryTierSchema.optional().describe('Filter by tier (warm or long)'),\n tags: z.array(z.string()).optional().describe('Filter by tags'),\n limit: z.number().min(1).max(50).default(10).describe('Maximum results to return'),\n threshold: z.number().min(0).max(1).default(0.5).describe('Minimum similarity threshold'),\n});\n\nexport const RecallMemoryInputSchema = z.object({\n category: MemoryCategorySchema.optional().describe('Filter by category'),\n tier: MemoryTierSchema.optional().describe('Filter by tier'),\n tags: z.array(z.string()).optional().describe('Filter by tags'),\n limit: z.number().min(1).max(100).default(20).describe('Maximum results'),\n});\n\nexport const ForgetMemoryInputSchema = z.object({\n id: z.string().describe('Memory ID to delete'),\n});\n\nexport const LinkMemoriesInputSchema = z.object({\n sourceId: z.string().describe('Source memory ID'),\n targetId: z.string().describe('Target memory ID'),\n relationshipType: RelationshipTypeSchema.describe('Type of relationship'),\n strength: z.number().min(0).max(1).default(0.5).describe('Relationship strength'),\n});\n\nexport const GetMemoryInputSchema = z.object({\n id: z.string().describe('Memory ID to retrieve'),\n});\n\nexport const ReinforceMemoryInputSchema = z.object({\n id: z.string().describe('Memory ID to reinforce'),\n amount: z.number().min(-1).max(1).default(0.1).describe('Reinforcement amount (-1 to 1)'),\n});\n\nexport type StoreMemoryInput = z.infer<typeof StoreMemoryInputSchema>;\nexport type SearchMemoryInput = z.infer<typeof SearchMemoryInputSchema>;\nexport type RecallMemoryInput = z.infer<typeof RecallMemoryInputSchema>;\nexport type ForgetMemoryInput = z.infer<typeof ForgetMemoryInputSchema>;\nexport type LinkMemoriesInput = z.infer<typeof LinkMemoriesInputSchema>;\nexport type GetMemoryInput = z.infer<typeof GetMemoryInputSchema>;\nexport type ReinforceMemoryInput = z.infer<typeof ReinforceMemoryInputSchema>;\n"],"mappings":";;;AAAA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAA2C;;;ACTpD,SAAS,SAAS;AAEX,IAAM,uBAAuB,EAAE,KAAK;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,mBAAmB,EAAE,KAAK,CAAC,QAAQ,MAAM,CAAC;AAEhD,IAAM,yBAAyB,EAAE,KAAK;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,SAAS,EAAE,OAAO,EAAE,SAAS,6BAA6B;AAAA,EAC1D,UAAU,qBAAqB,SAAS,wBAAwB;AAAA,EAChE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,gCAAgC;AAAA,EAC9E,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,mBAAmB;AACzE,CAAC;AAEM,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,OAAO,EAAE,OAAO,EAAE,SAAS,uBAAuB;AAAA,EAClD,UAAU,qBAAqB,SAAS,EAAE,SAAS,oBAAoB;AAAA,EACvE,MAAM,iBAAiB,SAAS,EAAE,SAAS,+BAA+B;AAAA,EAC1E,MAAM,EAAE,MAAM,EA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AAQ,kBAAkB;AAC5B,UAAM,QAAQ,MAAM,MAAM,SAAS,QAAQ;AAC3C,WAAO;AAAA,MACL,UAAU;AAAA,QACR;AAAA,UACE;AAAA,UACA,UAAU;AAAA,UACV,MAAM,KAAK,UAAU,OAAO,MAAM,CAAC;AAAA,QACrC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,MAAI,QAAQ,mBAAmB;AAC7B,UAAM,WAAW,MAAM,MAAM,KAAK,UAAU,EAAE;AAC9C,WAAO;AAAA,MACL,UAAU;AAAA,QACR;AAAA,UACE;AAAA,UACA,UAAU;AAAA,UACV,MAAM,KAAK,UAAU,UAAU,MAAM,CAAC;AAAA,QACxC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,IAAI,MAAM,qBAAqB,GAAG,EAAE;AAC5C,CAAC;AAED,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,UAAQ,MAAM,6CAA6C;AAC7D;AAEA,IAAM,SAAS,QAAQ,KAAK,CAAC,MAAM,cAAc,YAAY,GAAG;AAChE,IAAI,QAAQ;AACV,OAAK,EAAE,MAAM,CAAC,UAAU;AACtB,YAAQ,MAAM,gBAAgB,KAAK;AACnC,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skillkit/mcp-memory",
|
|
3
|
+
"version": "1.8.0",
|
|
4
|
+
"description": "MCP (Model Context Protocol) server for SkillKit persistent memory",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"skillkit-memory-server": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
22
|
+
"zod": "^3.24.0",
|
|
23
|
+
"@skillkit/memory": "1.8.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^22.10.5",
|
|
27
|
+
"tsup": "^8.3.5",
|
|
28
|
+
"typescript": "^5.7.2",
|
|
29
|
+
"vitest": "^2.1.8"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"keywords": [
|
|
36
|
+
"mcp",
|
|
37
|
+
"model-context-protocol",
|
|
38
|
+
"memory",
|
|
39
|
+
"ai",
|
|
40
|
+
"claude",
|
|
41
|
+
"skillkit"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup",
|
|
45
|
+
"dev": "tsup --watch",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"start": "node dist/index.js"
|
|
49
|
+
}
|
|
50
|
+
}
|