neuromcp 0.1.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/README.md +170 -0
- package/bin/neuromcp.mjs +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2024 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
- package/scripts/download-model.mjs +34 -0
- package/scripts/download-model.ts +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# neuromcp
|
|
2
|
+
|
|
3
|
+
Semantic memory for AI agents — local-first MCP server with hybrid search, governance, and consolidation.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx neuromcp
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Hybrid search** — vector + full-text with Reciprocal Rank Fusion (RRF) ranking
|
|
12
|
+
- **Memory governance** — namespaces, trust levels, soft delete, lineage tracking
|
|
13
|
+
- **Plan-then-commit consolidation** — dedup, decay, prune, sweep — never mutates without preview
|
|
14
|
+
- **Built-in ONNX embeddings** — bge-small-en-v1.5, zero config, no API keys
|
|
15
|
+
- **8 tools + 13 resources + 3 prompts** — full MCP protocol surface
|
|
16
|
+
- **SQLite storage** — single file, zero infrastructure, WAL mode
|
|
17
|
+
- **Structured observability** — stderr logging, metrics, operation IDs
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx neuromcp
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The server starts on stdio, creates `~/.neuromcp/memory.db` on first run, and downloads the ONNX embedding model automatically.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### Claude Code
|
|
30
|
+
|
|
31
|
+
```jsonc
|
|
32
|
+
// ~/.claude.json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"neuromcp": {
|
|
36
|
+
"type": "stdio",
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "neuromcp"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Claude Desktop
|
|
45
|
+
|
|
46
|
+
```jsonc
|
|
47
|
+
// ~/Library/Application Support/Claude/claude_desktop_config.json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"neuromcp": {
|
|
51
|
+
"command": "npx",
|
|
52
|
+
"args": ["-y", "neuromcp"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Cursor / Windsurf / Cline
|
|
59
|
+
|
|
60
|
+
Same MCP config format — add to your editor's MCP settings.
|
|
61
|
+
|
|
62
|
+
### Per-project (.mcp.json)
|
|
63
|
+
|
|
64
|
+
```jsonc
|
|
65
|
+
{
|
|
66
|
+
"mcpServers": {
|
|
67
|
+
"neuromcp": {
|
|
68
|
+
"type": "stdio",
|
|
69
|
+
"command": "npx",
|
|
70
|
+
"args": ["-y", "neuromcp"],
|
|
71
|
+
"env": {
|
|
72
|
+
"NEUROMCP_DB_PATH": ".neuromcp/memory.db",
|
|
73
|
+
"NEUROMCP_NAMESPACE": "my-project"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Tools (8)
|
|
81
|
+
|
|
82
|
+
| Tool | Description |
|
|
83
|
+
|------|-------------|
|
|
84
|
+
| `store_memory` | Store a memory with semantic deduplication. Returns ID and whether it matched an existing memory. |
|
|
85
|
+
| `search_memory` | Hybrid vector + full-text search with RRF ranking. Supports filters by namespace, category, tags, trust, date range. |
|
|
86
|
+
| `recall_memory` | Retrieve memories by ID, namespace, category, or tags without semantic search. |
|
|
87
|
+
| `forget_memory` | Soft-delete (tombstone) memories matching filters. Supports `dry_run` mode. |
|
|
88
|
+
| `consolidate` | Merge near-duplicates, decay stale memories, prune low-value, sweep expired. Set `commit=true` to apply; `commit=false` for a dry-run plan. |
|
|
89
|
+
| `memory_stats` | Counts, categories, trust levels, importance distribution, and database size. |
|
|
90
|
+
| `export_memories` | Export as JSONL or JSON for backup or migration. |
|
|
91
|
+
| `import_memories` | Import from JSONL or JSON with content-hash deduplication. |
|
|
92
|
+
|
|
93
|
+
## Resources (13)
|
|
94
|
+
|
|
95
|
+
| URI | Description |
|
|
96
|
+
|-----|-------------|
|
|
97
|
+
| `memory://stats` | Global memory statistics across all namespaces |
|
|
98
|
+
| `memory://recent` | Last 20 memories across all namespaces |
|
|
99
|
+
| `memory://namespaces` | All namespaces with memory counts |
|
|
100
|
+
| `memory://consolidation/log` | Recent consolidation log entries |
|
|
101
|
+
| `memory://operations` | Active and recent operations |
|
|
102
|
+
| `memory://health` | Server health check with metrics snapshot |
|
|
103
|
+
| `memory://stats/{namespace}` | Statistics for a specific namespace |
|
|
104
|
+
| `memory://recent/{namespace}` | Last 20 memories in a specific namespace |
|
|
105
|
+
| `memory://id/{id}` | Retrieve a specific memory by ID |
|
|
106
|
+
| `memory://tag/{tag}` | Memories containing a specific tag |
|
|
107
|
+
| `memory://tag/{namespace}/{tag}` | Memories with a tag in a specific namespace |
|
|
108
|
+
| `memory://namespace/{ns}` | All memories in a namespace (up to 100) |
|
|
109
|
+
| `memory://consolidation/log/{operation_id}` | Consolidation log for a specific operation |
|
|
110
|
+
|
|
111
|
+
## Prompts (3)
|
|
112
|
+
|
|
113
|
+
| Prompt | Description |
|
|
114
|
+
|--------|-------------|
|
|
115
|
+
| `memory_context_for_task` | Search memories relevant to a task and format them as LLM context. |
|
|
116
|
+
| `review_memory_candidate` | Show a proposed memory alongside existing near-duplicates to decide whether to store it. |
|
|
117
|
+
| `consolidation_dry_run` | Preview proposed consolidation actions (merges, decays, prunes, sweeps) without applying them. |
|
|
118
|
+
|
|
119
|
+
## Memory Governance
|
|
120
|
+
|
|
121
|
+
**Namespaces** isolate memories by project, agent, or domain. Each memory belongs to exactly one namespace.
|
|
122
|
+
|
|
123
|
+
**Trust levels** (`high`, `medium`, `low`, `unverified`) indicate confidence in the memory source. Searchable as a filter.
|
|
124
|
+
|
|
125
|
+
**Soft delete** tombstones memories instead of removing them. Tombstoned records are retained for `NEUROMCP_TOMBSTONE_TTL_DAYS` (default 30) before permanent removal during consolidation sweeps.
|
|
126
|
+
|
|
127
|
+
**Content hashing** (SHA-256) provides deduplication at write time. Identical content in the same namespace is detected and the existing memory is returned instead of creating a duplicate.
|
|
128
|
+
|
|
129
|
+
**Lineage tracking** records the source (`user`, `auto`, `consolidation`, `claude-code`, `error`), project ID, and agent ID for each memory, enabling audit trails.
|
|
130
|
+
|
|
131
|
+
## Configuration
|
|
132
|
+
|
|
133
|
+
All configuration is via environment variables with sensible defaults.
|
|
134
|
+
|
|
135
|
+
| Variable | Default | Description |
|
|
136
|
+
|----------|---------|-------------|
|
|
137
|
+
| `NEUROMCP_DB_PATH` | `~/.neuromcp/memory.db` | SQLite database file path |
|
|
138
|
+
| `NEUROMCP_MAX_DB_SIZE_MB` | `500` | Maximum database size in MB |
|
|
139
|
+
| `NEUROMCP_EMBEDDING_PROVIDER` | `auto` | Embedding provider: `auto`, `onnx`, `ollama`, `openai` |
|
|
140
|
+
| `NEUROMCP_EMBEDDING_MODEL` | `auto` | Model name (auto-detected for ONNX) |
|
|
141
|
+
| `OLLAMA_HOST` | `http://localhost:11434` | Ollama server URL |
|
|
142
|
+
| `NEUROMCP_EMBEDDING_URL` | — | Custom embedding API endpoint |
|
|
143
|
+
| `NEUROMCP_DEFAULT_NAMESPACE` | `default` | Default namespace for operations |
|
|
144
|
+
| `NEUROMCP_TOMBSTONE_TTL_DAYS` | `30` | Days before tombstoned memories are permanently swept |
|
|
145
|
+
| `NEUROMCP_AUTO_CONSOLIDATE` | `false` | Enable automatic periodic consolidation |
|
|
146
|
+
| `NEUROMCP_CONSOLIDATE_INTERVAL_HOURS` | `24` | Hours between automatic consolidation runs |
|
|
147
|
+
| `NEUROMCP_DECAY_LAMBDA` | `0.01` | Exponential decay rate for importance |
|
|
148
|
+
| `NEUROMCP_DEDUP_THRESHOLD` | `0.92` | Cosine similarity threshold for deduplication |
|
|
149
|
+
| `NEUROMCP_MIN_IMPORTANCE` | `0.05` | Minimum importance after decay before pruning |
|
|
150
|
+
| `NEUROMCP_AUTO_COMMIT_SIMILARITY` | `0.95` | Similarity above which dedup merges automatically |
|
|
151
|
+
| `NEUROMCP_SWEEP_INTERVAL_HOURS` | `6` | Hours between TTL sweep checks |
|
|
152
|
+
| `NEUROMCP_CLAUDE_CODE_INTEGRATION` | `auto` | Claude Code integration mode: `auto`, `enabled`, `disabled` |
|
|
153
|
+
| `NEUROMCP_LOG_LEVEL` | `info` | Log level: `debug`, `info`, `warn`, `error` |
|
|
154
|
+
| `NEUROMCP_LOG_FORMAT` | `text` | Log format: `text`, `json` |
|
|
155
|
+
|
|
156
|
+
## Comparison
|
|
157
|
+
|
|
158
|
+
| Feature | neuromcp | @modelcontextprotocol/server-memory | mem0 | cortex-mcp |
|
|
159
|
+
|---------|----------|--------------------------------------|------|------------|
|
|
160
|
+
| Search | Hybrid (vector + FTS + RRF) | Keyword only | Vector only | Vector only |
|
|
161
|
+
| Embeddings | Built-in ONNX (zero config) | None | External API | External API |
|
|
162
|
+
| Governance | Namespaces, trust, soft delete | None | None | Basic |
|
|
163
|
+
| Consolidation | Plan-then-commit (dedup, decay, prune, sweep) | None | None | Manual |
|
|
164
|
+
| Storage | SQLite (single file) | JSON file | Cloud / Postgres | SQLite |
|
|
165
|
+
| Infrastructure | Zero — runs locally | Zero | Cloud account required | Zero |
|
|
166
|
+
| MCP surface | 8 tools, 13 resources, 3 prompts | 5 tools | N/A | 4 tools |
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT
|
package/bin/neuromcp.mjs
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|