aimemory-mcp-server 1.4.0__tar.gz

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.
@@ -0,0 +1,52 @@
1
+ # dependencies
2
+ node_modules/
3
+ .pnp
4
+ .pnp.js
5
+
6
+ # testing
7
+ coverage/
8
+
9
+ # next.js
10
+ .next/
11
+ out/
12
+
13
+ # production
14
+ build/
15
+
16
+ # misc
17
+ .DS_Store
18
+ *.pem
19
+
20
+ # debug
21
+ npm-debug.log*
22
+ yarn-debug.log*
23
+ yarn-error.log*
24
+
25
+ # env files
26
+ .env*.local
27
+ .env
28
+
29
+ # vercel
30
+ .vercel
31
+
32
+ # typescript
33
+ *.tsbuildinfo
34
+ next-env.d.ts
35
+
36
+ # database
37
+ *.db
38
+ *.db-journal
39
+ *.db-shm
40
+ *.db-wal
41
+ data/
42
+
43
+ # uploads
44
+ uploads/
45
+
46
+ __pycache__/
47
+ *.pyc
48
+ mcp-server/dist/
49
+
50
+ # Python venvs
51
+ *.venv/
52
+ mcp-server/.venv/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AI Memory (aimemory.pro)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,446 @@
1
+ Metadata-Version: 2.4
2
+ Name: aimemory-mcp-server
3
+ Version: 1.4.0
4
+ Summary: AI Memory MCP Server — persistent memory for AI assistants via Model Context Protocol
5
+ Project-URL: Homepage, https://aimemory.pro
6
+ Project-URL: Repository, https://github.com/jingchang0623-crypto/aimemory
7
+ Project-URL: Issues, https://github.com/jingchang0623-crypto/aimemory/issues
8
+ Project-URL: Documentation, https://aimemory.pro/docs/mcp
9
+ Author-email: AI Memory <hello@aimemory.pro>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: ai-memory,claude,cursor,fts5,knowledge-base,llm,mcp,model-context-protocol,persistent-memory,sqlite
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Database
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Requires-Python: >=3.10
25
+ Requires-Dist: fastmcp>=2.0.0
26
+ Description-Content-Type: text/markdown
27
+
28
+ # AI Memory MCP Server
29
+
30
+ [![PyPI version](https://img.shields.io/pypi/v/aimemory-mcp-server.svg)](https://pypi.org/project/aimemory-mcp-server/)
31
+ [![Python versions](https://img.shields.io/pypi/pyversions/aimemory-mcp-server.svg)](https://pypi.org/project/aimemory-mcp-server/)
32
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
33
+ [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-blue.svg)](https://modelcontextprotocol.io/)
34
+ [![Homepage](https://img.shields.io/badge/Web-aimemory.pro-purple.svg)](https://aimemory.pro)
35
+
36
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that gives AI assistants **persistent memory**. Works with **Claude Desktop**, **Cursor**, **VS Code**, **Windsurf**, and **113+ MCP clients**.
37
+
38
+ ---
39
+
40
+ ## Installation
41
+
42
+ ### Option 1: PyPI Install (Recommended)
43
+
44
+ ```bash
45
+ pip install aimemory-mcp-server
46
+ ```
47
+
48
+ ### Option 2: GitHub Install
49
+
50
+ ```bash
51
+ pip install git+https://github.com/jingchang0623-crypto/aimemory.git#subdirectory=mcp-server
52
+ ```
53
+
54
+ > **Note:** GitHub install provides the latest development version directly from the repository.
55
+
56
+ That's it! The `aimemory-mcp-server` command is now available.
57
+
58
+ ## Quick Start
59
+
60
+ ### Claude Desktop
61
+
62
+ Add to `~/.config/claude-desktop/claude_desktop_config.json` (Linux/macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "ai-memory": {
68
+ "command": "aimemory-mcp-server"
69
+ }
70
+ }
71
+ }
72
+ ```
73
+
74
+ ### Cursor
75
+
76
+ Add to `.cursor/mcp.json` in your project root or `~/.cursor/mcp.json`:
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "ai-memory": {
82
+ "command": "aimemory-mcp-server"
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ### VS Code (with Continue or MCP extension)
89
+
90
+ Add to your MCP configuration file:
91
+
92
+ ```json
93
+ {
94
+ "mcpServers": {
95
+ "ai-memory": {
96
+ "command": "aimemory-mcp-server"
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ ### Windsurf
103
+
104
+ Add to `~/.windsurf/config.json`:
105
+
106
+ ```json
107
+ {
108
+ "mcpServers": {
109
+ "ai-memory": {
110
+ "command": "aimemory-mcp-server"
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ > **Tip:** To use a custom database location, add `"env": {"AIMEMORY_DB": "/path/to/your/aimemory.db"}` to any configuration above.
117
+
118
+ ---
119
+
120
+ ## Features
121
+
122
+ - 🔍 **Full-text search** — powered by SQLite FTS5 for fast, ranked results
123
+ - 🏷️ **Tag-based organization** — categorize memories with tags
124
+ - 💾 **Persistent storage** — memories survive restarts (SQLite)
125
+ - 🔧 **12 core tools** — save, search, list, get, update, delete, stats, export, import, batch_save, get_tags, clear
126
+ - 🚀 **Easy install** — `pip install aimemory-mcp-server` from PyPI
127
+ - 🪶 **Zero config** — works out of the box with sensible defaults
128
+
129
+ ---
130
+
131
+ ## Available Tools
132
+
133
+ ### `save_memory` — Save a new memory
134
+
135
+ ```json
136
+ {
137
+ "content": "The user prefers Python over JavaScript for backend work",
138
+ "tags": ["preferences", "coding"],
139
+ "source": "conversation-123"
140
+ }
141
+ ```
142
+
143
+ | Parameter | Type | Required | Description |
144
+ |-----------|------|----------|-------------|
145
+ | `content` | string | ✅ | The memory content to store |
146
+ | `tags` | list[str] | ❌ | Tags for categorization, e.g. `["work", "meeting"]` |
147
+ | `source` | string | ❌ | Source identifier (URL, file path, conversation ID) |
148
+
149
+ ### `search_memories` — Full-text search
150
+
151
+ ```json
152
+ {
153
+ "query": "python backend",
154
+ "limit": 5
155
+ }
156
+ ```
157
+
158
+ | Parameter | Type | Required | Description |
159
+ |-----------|------|----------|-------------|
160
+ | `query` | string | ✅ | Search query (supports FTS5 syntax) |
161
+ | `limit` | int | ❌ | Max results (default: 10, max: 100) |
162
+
163
+ ### `list_memories` — List memories
164
+
165
+ ```json
166
+ {
167
+ "limit": 20,
168
+ "tag": "coding"
169
+ }
170
+ ```
171
+
172
+ | Parameter | Type | Required | Description |
173
+ |-----------|------|----------|-------------|
174
+ | `limit` | int | ❌ | Max results (default: 20, max: 200) |
175
+ | `tag` | string | ❌ | Filter by tag |
176
+
177
+ ### `update_memory` — Update a memory
178
+
179
+ ```json
180
+ {
181
+ "memory_id": 42,
182
+ "content": "Updated content",
183
+ "tags": ["updated-tag"]
184
+ }
185
+ ```
186
+
187
+ | Parameter | Type | Required | Description |
188
+ |-----------|------|----------|-------------|
189
+ | `memory_id` | int | ✅ | ID of the memory to update |
190
+ | `content` | string | ❌ | New content (keeps existing if omitted) |
191
+ | `tags` | list[str] | ❌ | New tags (keeps existing if omitted) |
192
+
193
+ ### `delete_memory` — Delete a memory
194
+
195
+ ```json
196
+ {
197
+ "memory_id": 42
198
+ }
199
+ ```
200
+
201
+ | Parameter | Type | Required | Description |
202
+ |-----------|------|----------|-------------|
203
+ | `memory_id` | int | ✅ | ID of the memory to delete |
204
+
205
+ ### `get_memory` — Retrieve a memory by ID
206
+
207
+ ```json
208
+ {
209
+ "memory_id": 42
210
+ }
211
+ ```
212
+
213
+ | Parameter | Type | Required | Description |
214
+ |-----------|------|----------|-------------|
215
+ | `memory_id` | int | ✅ | ID of the memory to retrieve |
216
+
217
+ ### `memory_stats` — Get memory store statistics
218
+
219
+ ```json
220
+ {}
221
+ ```
222
+
223
+ Returns total memory count, memories created in the last 7 days, and top tags distribution.
224
+
225
+ ### `export_memories` — Export all memories for backup
226
+
227
+ ```json
228
+ {}
229
+ ```
230
+
231
+ Returns all memories as a JSON list with count and export timestamp. Use this to backup your knowledge base or migrate to another system.
232
+
233
+ **Returns:**
234
+ - `count`: Number of memories exported
235
+ - `memories`: List of all memory objects (id, content, tags, source, timestamps)
236
+ - `exported_at`: UTC timestamp of export
237
+
238
+ ### `import_memories` — Import memories from backup
239
+
240
+ ```json
241
+ {
242
+ "memories": [
243
+ {"content": "User prefers dark mode", "tags": ["preferences"]},
244
+ {"content": "Project uses PostgreSQL", "tags": ["tech-stack"]}
245
+ ],
246
+ "skip_duplicates": true
247
+ }
248
+ ```
249
+
250
+ | Parameter | Type | Required | Description |
251
+ |-----------|------|----------|-------------|
252
+ | `memories` | list[dict] | ✅ | List of memory dicts to import |
253
+ | `skip_duplicates` | bool | ❌ | Skip memories with existing content (default: true) |
254
+
255
+ **Returns:** `imported` count and `skipped` count (duplicates).
256
+
257
+ ### `batch_save_memories` — Save multiple memories at once
258
+
259
+ ```json
260
+ {
261
+ "memories": [
262
+ {"content": "User prefers dark mode", "tags": ["preferences"]},
263
+ {"content": "Project uses PostgreSQL", "tags": ["tech-stack"]},
264
+ {"content": "Team uses GitHub for CI/CD", "tags": ["devops"]}
265
+ ]
266
+ }
267
+ ```
268
+
269
+ | Parameter | Type | Required | Description |
270
+ |-----------|------|----------|-------------|
271
+ | `memories` | list[dict] | ✅ | List of memory dicts (content required, tags/source optional) |
272
+
273
+ **Returns:** `saved` count and `ids` list of newly created memory IDs.
274
+
275
+ Use this for bulk operations — much faster than calling `save_memory` repeatedly. Perfect for extracting key takeaways from a conversation in one call.
276
+
277
+ ### `get_all_tags` — List all unique tags with counts
278
+
279
+ ```json
280
+ {}
281
+ ```
282
+
283
+ **Returns:** `total_tags` count and `tags` dict mapping tag name to usage count (sorted by most-used first).
284
+
285
+ Use this to discover what categories of memories you have stored. Great for building navigation UI or understanding your knowledge base structure.
286
+
287
+ ### `clear_all_memories` — Delete all memories
288
+
289
+ ```json
290
+ {}
291
+ ```
292
+
293
+ ⚠️ **WARNING:** This permanently removes every memory. Export first using `export_memories` if you want to keep a backup.
294
+
295
+ **Returns:** `success` boolean and `deleted_count` (number of memories removed).
296
+
297
+ ---
298
+
299
+ ## Search Syntax
300
+
301
+ The search uses SQLite FTS5 syntax:
302
+
303
+ | Syntax | Example | Description |
304
+ |--------|---------|-------------|
305
+ | Simple | `python tutorial` | Words appearing anywhere |
306
+ | AND | `python AND machine learning` | Both terms required |
307
+ | OR | `react OR vue` | Either term matches |
308
+ | Phrase | `"exact phrase match"` | Exact phrase in quotes |
309
+ | NEAR | `NEAR/3(word1 word2)` | Words within 3 tokens of each other |
310
+ | Prefix | `prog*` | Matches "program", "programming", etc. |
311
+
312
+ ---
313
+
314
+ ## Environment Variables
315
+
316
+ | Variable | Default | Description |
317
+ |----------|---------|-------------|
318
+ | `AIMEMORY_DB` | `./aimemory.db` | Path to the SQLite database file |
319
+ | `AIMEMORY_TRANSPORT` | `stdio` | Transport mode: `stdio` (local) or `http` (remote via SSE) |
320
+ | `AIMEMORY_PORT` | `8090` | Port for HTTP transport mode |
321
+ | `AIMEMORY_HOST` | `0.0.0.0` | Host for HTTP transport mode |
322
+
323
+ Set a custom database path:
324
+
325
+ ```bash
326
+ export AIMEMORY_DB="/path/to/your/aimemory.db"
327
+ ```
328
+
329
+ ### HTTP/SSE Transport (Remote Access)
330
+
331
+ For remote access or integration with web-based MCP clients:
332
+
333
+ ```bash
334
+ AIMEMORY_TRANSPORT=http AIMEMORY_PORT=8090 aimemory-mcp-server
335
+ ```
336
+
337
+ Then configure your MCP client to connect via SSE:
338
+
339
+ ```json
340
+ {
341
+ "mcpServers": {
342
+ "ai-memory": {
343
+ "url": "http://your-server:8090/sse"
344
+ }
345
+ }
346
+ }
347
+ ```
348
+
349
+ Or in your MCP client configuration:
350
+
351
+ ```json
352
+ {
353
+ "mcpServers": {
354
+ "ai-memory": {
355
+ "command": "aimemory-mcp-server",
356
+ "env": {
357
+ "AIMEMORY_DB": "/path/to/your/aimemory.db"
358
+ }
359
+ }
360
+ }
361
+ }
362
+ ```
363
+
364
+ ---
365
+
366
+ ## Running Without pip Install
367
+
368
+ You can also run directly from the repository:
369
+
370
+ ```bash
371
+ cd mcp-server
372
+ pip install -r requirements.txt
373
+ python server.py
374
+ ```
375
+
376
+ And configure the MCP client with the full path:
377
+
378
+ ```json
379
+ {
380
+ "mcpServers": {
381
+ "ai-memory": {
382
+ "command": "python3",
383
+ "args": ["/path/to/mcp-server/server.py"]
384
+ }
385
+ }
386
+ }
387
+ ```
388
+
389
+ ---
390
+
391
+ ## Troubleshooting
392
+
393
+ ### `aimemory-mcp-server: command not found`
394
+
395
+ Make sure the pip install directory is in your `PATH`:
396
+
397
+ ```bash
398
+ # Check where it was installed
399
+ pip show aimemory-mcp-server
400
+
401
+ # Common fix: use python -m instead
402
+ python -m aimemory_mcp.server
403
+ ```
404
+
405
+ ### `ModuleNotFoundError: No module named 'fastmcp'`
406
+
407
+ ```bash
408
+ pip install fastmcp>=2.0.0
409
+ ```
410
+
411
+ ### MCP client doesn't see the tools
412
+
413
+ 1. Restart your MCP client after changing configuration
414
+ 2. Verify the server runs: `aimemory-mcp-server` (should block/wait for stdin)
415
+ 3. Check MCP client logs for connection errors
416
+
417
+ ### Database locked errors
418
+
419
+ Only one process should write to the database at a time. If you see lock errors, ensure you don't have multiple server instances running.
420
+
421
+ ---
422
+
423
+ ## Contributing
424
+
425
+ Contributions are welcome! Please see the [main repository](https://github.com/jingchang0623-crypto/aimemory) for details.
426
+
427
+ ```bash
428
+ git clone https://github.com/jingchang0623-crypto/aimemory.git
429
+ cd aimemory/mcp-server
430
+ pip install -e ".[dev]"
431
+ ```
432
+
433
+ ---
434
+
435
+ ## License
436
+
437
+ MIT — see [LICENSE](https://opensource.org/licenses/MIT) for details.
438
+
439
+ ---
440
+
441
+ ## Links
442
+
443
+ - 🌐 **Website**: [aimemory.pro](https://aimemory.pro)
444
+ - 📦 **PyPI**: [pypi.org/project/aimemory-mcp-server](https://pypi.org/project/aimemory-mcp-server/)
445
+ - 🐙 **GitHub**: [github.com/jingchang0623-crypto/aimemory](https://github.com/jingchang0623-crypto/aimemory)
446
+ - 📋 **MCP Spec**: [modelcontextprotocol.io](https://modelcontextprotocol.io/)