Memory MCP 9e4cc875

MCP数据服务

提供方 XingxingLi2017

数据服务 stdio · 本地进程 Token 社区 / 第三方 Claude
查看接入方式

用于AI编码助手的本地内存管理MCP服务器,支持混合搜索(BM25全文搜索+向量语义搜索)并将内存文件索引到SQLite数据库中。

一句话选型结论

按资料字段整理

Memory MCP 9e4cc875 属于数据服务类 MCP 服务器,stdio · 本地进程,Token,可直接接入 Claude,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类数据服务 传输方式stdio · 本地进程 鉴权Token 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 6 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

数据服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量6暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

内存管理TypeScript本地部署混合搜索SQLiteAI编码助手向量搜索

安装与配置

stdio · 本地进程 Token
客户端在本机拉起子进程,数据不出本机
npx --no node-llama-cpp source download

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 6 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
数据库查询

用自然语言查库、取数,不用手写 SQL。

数据同步与清洗

把多来源数据拉到一处做整理。

报表取数

按口径快速拉出统计结果。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 6 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好Token对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Memory MCP 9e4cc875当前 6 stdio · 本地进程 本地部署 有 2026-05-17
Memory 9d25f64e 9 未标注 未标注 无 2026-05-17
Getzep MCP 9 stdio · 本地进程 本地部署 有 2026-05-17
anything-llm 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Prisma MCP Server 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Astr Bot 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

数据服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方XingxingLi2017上游标注的维护方 XingxingLi2017
分类数据服务本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式Token远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Node.js本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

14.5 KB
来自项目仓库与上游目录的原文,未做删改

memory-mcp

Local memory management MCP server for AI coding assistants (GitHub Copilot CLI, Claude Code).

Indexes MEMORY.md and memory/ files into a SQLite database with hybrid search — BM25 full-text search + vector semantic search — and exposes them as MCP tools that the host CLI calls automatically.

Features

  • Hybrid search — combines BM25 keyword matching with vector cosine similarity for best-of-both-worlds retrieval
  • Fact + Evidence architecture — memory_write stores compressed facts with linked evidence for traceability
  • Semantic dedup — exact string + vector similarity checks prevent duplicate memories
  • Memory lifecycle — memory_forget and memory_update with semantic matching (string match → vector fallback)
  • CJK support — jieba-wasm pre-segmentation enables Chinese/Japanese/Korean full-text search
  • Multi-format — indexes .md, .txt, .json, .jsonl, .yaml, .yml files
  • Graceful degradation — vector search requires optional native dependencies; falls back to FTS-only if unavailable
  • Session transcript indexing — automatically indexes Copilot CLI (events.jsonl) and Claude Code (~/.claude/projects/) conversation history for cross-session search
  • Stat-based fast sync — two-phase sync checks mtime + size first, only reads files that actually changed
  • Worker-thread embedding — model loading and inference run in an isolated worker thread, keeping the MCP event loop responsive
  • Non-blocking read / blocking write — read tools (search, status) fire-and-forget sync; write tools await fresh sync
  • Embedding cache — content-hash keyed cache avoids re-embedding unchanged text across file moves/renames
  • Access tracking — frequently accessed chunks get a gentle score boost

Quick Start```bash

Install globally

npm install -g memory-mcp

Configure for GitHub Copilot CLI

memory-mcp setup

Or configure for Claude Code CLI

memory-mcp setup --claude


Next time you launch `copilot` or `claude`, the memory server starts automatically.

### Vector Search (Optional)

Vector search uses node-llama-cpp and sqlite-vec as optional dependencies. On most platforms (Linux x64/arm64, macOS x64/arm64, Windows x64) these install automatically via prebuilt binaries.

If they fail to install (e.g. missing build tools), the server still works with FTS5-only search — no manual intervention needed.

The default embedding model (embeddinggemma-300M, ~328 MB) is downloaded automatically on first use to `~/.node-llama-cpp/models/`. You can swap it via config: `memory-mcp config set model /path/to/model.gguf` (see Configuration).

### Windows: Known Issue with Prebuilt Binaries

The prebuilt `@node-llama-cpp/win-x64` binary (compiled with MinGW64) has a bug where `getMathCores()` returns 0 in certain VM environments (e.g. Hyper-V), causing single-threaded inference (~28x slower than expected). This makes embedding generation too slow to complete within a typical MCP session.

**Fix:** Build node-llama-cpp from source using MSVC instead of the prebuilt binary:```bash
npx --no node-llama-cpp source download
npx --no node-llama-cpp source build

This compiles with the correct Windows API path and restores full multi-threaded performance. See #1 for details.

Usage

All memory data lives in a shared directory under your home folder:```
~/.memory-mcp-workdir/
├── memory-mcp.json # Configuration file (profiles, settings)
└── default/ # Default profile workspace
├── memory.db # SQLite database (index + vectors)
├── MEMORY.md # Top-level memory file
└── memory/
├── decisions.md # Architecture decisions
├── preferences.md # User preferences
└── evidence/ # Auto-generated evidence files


The host CLI will automatically search these files before answering questions about prior work, decisions, or preferences.

## Tools

| Tool | Description |
|------|-------------|
| `memory_search` | Hybrid search (BM25 + vector) across all memory files. Supports `query`, `maxResults`, `minScore`, `tokenMax`, `after`/`before` time filters. Session transcripts are tagged with `distillHint: true` |
| `memory_get` | Read specific lines from a memory file. Supports `path`, `from` (starting line, 1-based), `lines` (count; omit for entire file) |
| `memory_write` | Save a fact with optional evidence. The system auto-chunks evidence and links it to the fact via `[ref:evidence/...]` for traceability |
| `memory_forget` | Remove a memory entry by semantic matching. Cleans up linked evidence files |
| `memory_update` | Replace a memory entry with new content and optional new evidence. Cleans up old evidence |
| `memory_status` | Show index status: file/chunk counts, embedding coverage, health checks |

## How it Works

1. The host CLI spawns the MCP server on startup (via stdio)
2. A **worker thread** is spawned in the background to load the embedding model and handle vector operations — this keeps the main event loop responsive
3. On each tool call, file sync runs in the background (**non-blocking** for reads like `memory_search`; **blocking** for writes like `memory_write` to ensure dedup sees latest state)
4. Sync uses a **stat-based fast-path**: checks mtime + size first, only reads and hashes files that actually changed
5. Files are chunked intelligently by format: markdown by headings, JSON by top-level keys/array elements, JSONL by line, YAML by top-level keys or `---` document separators
6. Chunks are indexed in **SQLite FTS5** (with jieba pre-segmentation for CJK text)
7. Chunks are embedded with **embeddinggemma-300M** (768-dim vectors) in the worker thread and stored in **sqlite-vec**
8. Search runs both FTS5 (BM25 ranking) and vector (cosine similarity) in parallel
9. Results are **min-max normalized** then merged with configurable FTS/vector weighting (default 50/50, see `ftsWeight`). Vector weight is dynamically scaled by embedding coverage — during index warmup, the system gracefully degrades toward FTS-only
10. Access-count boost gently promotes frequently retrieved chunks: `0.85 × base_score + 0.15 × log₂(1 + access_count) / 10`
11. Top-level `MEMORY.md` / `memory.md` / `MEMORY.txt` / `memory.txt` results receive a score boost (×1.3) for long-term memory priority
12. Falls back to LIKE search if FTS5 is unavailable

## Configuration

All settings have sensible defaults and work out of the box. To customize, use the config command:```bash
# Show current config (uses default profile)
memory-mcp config

# Show config for a specific profile
memory-mcp config --profile learning show

# Set a value (on default profile)
memory-mcp config set chunkSize 1024
memory-mcp config set extraDirs /data/obsidian-vault,/data/notes
memory-mcp config set model /path/to/local-model.gguf
memory-mcp config set ftsWeight 0.7
memory-mcp config set minScore 0.05

# Set a value on a specific profile
memory-mcp config --profile learning set chunkSize 256

# Reset to defaults (all profiles and settings)
memory-mcp config reset

# Reset a single profile to defaults (keeps the profile entry)
memory-mcp config --profile learning reset

# Show config file path
memory-mcp config path

Config is stored in ~/.memory-mcp-workdir/memory-mcp.json (cross-platform: $HOME on Linux/macOS, %USERPROFILE% on Windows). Changes take effect on next server restart.

Example Config File```json

{
"defaultProfile": "default",
"profiles": {
"default": {
"chunkSize": 512,
"tokenMax": 4096,
"ftsWeight": 0.5,
"minScore": 0.01,
"maxResults": 10,
"sessionDays": 30,
"sessionMax": -1,
"sessionDirs": [
{ "dir": "/home/user/.copilot/session-state", "kind": "copilot" },
{ "dir": "/home/user/.claude/projects", "kind": "claude" }
]
},
"learning": {
"extraDirs": ["/path/to/obsidian-vault"],
"sessionDirs": [],
"model": "/path/to/local-model.gguf"
}
}
}


> **Note:** Use absolute paths in the config file. `~` is not expanded by Node.js.

Fields omitted from a profile inherit built-in defaults. Each profile workspace is at `~/.memory-mcp-workdir//` unless overridden.

### Config Keys

| Key | Default | Description |
|-----|---------|-------------|
| `workspace` | `~/.memory-mcp-workdir/` | Root directory for memory files and database |
| `dbPath` | `/memory.db` | Path to SQLite database |
| `chunkSize` | `512` | Chunk size in tokens for markdown splitting (64–4096). Changing triggers automatic index rebuild |
| `tokenMax` | `4096` | Default max tokens per search response (100–16384). Controls snippet length and result count |
| `sessionDays` | `30` | Only index session transcripts from the last N days (0 = index all) |
| `sessionMax` | `-1` | Max number of sessions to index, newest first (-1 = no limit, 0 = disable session indexing) |
| `sessionDirs` | `[copilot, claude]` | Session transcript sources. Copilot scans `{dir}/{uuid}/events.jsonl`; Claude scans `{dir}/{project}/*.jsonl`. Default: `~/.copilot/session-state` (copilot) + `~/.claude/projects` (claude). JSON format: `[{"dir":"/path","kind":"copilot"}]` |
| `extraDirs` | `[]` | Extra directories to index (e.g. Obsidian vault). Files are stored with `extra:/` prefix |
| `model` | `hf:ggml-org/embeddinggemma-300M-GGUF/...` | Embedding model. Accepts a HuggingFace URI (`hf:org/repo/file.gguf`) for auto-download, or a local file path (`/path/to/model.gguf`) |
| `ftsWeight` | `0.5` | FTS weight in hybrid search (0–1). Vector weight = 1 − ftsWeight. Higher values favor keyword matching; lower values favor semantic similarity |
| `minScore` | `0.01` | Minimum relevance score threshold (0–1). Results below this are dropped |
| `maxResults` | `10` | Maximum number of search results returned (1–100) |

### Profiles

Profiles let you maintain isolated memory spaces for different use cases (e.g. coding vs learning). Each profile has its own workspace, database, and memory files.```bash
# Create profiles
memory-mcp config profile create coding
memory-mcp config profile create learning

# Configure each profile independently
memory-mcp config --profile coding set sessionDirs '[{"dir":"/home/user/.copilot/session-state","kind":"copilot"},{"dir":"/home/user/.claude/projects","kind":"claude"}]'
memory-mcp config --profile learning set extraDirs /path/to/obsidian-vault
memory-mcp config --profile learning set sessionDirs '[]'

# Set which profile is used by default (e.g. by the MCP server)
memory-mcp config profile default coding

# List profiles
memory-mcp config profile list

# Use a specific profile with the CLI
memory-mcp-cli search "query" --profile learning

# Use a specific profile with the MCP server
# In your MCP host config (e.g. .claude.json):
#   "args": ["dist/server.js", "--profile", "coding"]
# Or via environment variable:
#   "env": { "MEMORY_MCP_PROFILE": "coding" }

Each profile workspace lives at ~/.memory-mcp-workdir// by default. Deleting a profile removes its config entry but retains the workspace directory on disk — remove it manually if no longer needed.

CLI

A standalone CLI is available for non-MCP integrations (e.g. calling from scripts or other agents):```bash

Search

memory-mcp-cli search "query" --max-results 10 --min-score 0.1

Index status

memory-mcp-cli status

Rebuild the vector index and reclaim disk space

memory-mcp-cli compact


### Vector index compaction

sqlite-vec only reuses deleted vector slots in its newest storage block, so edits that replace chunks leave dead blocks behind that every vector query still scans. Indexing only rewrites chunks whose content or position changed, and after each embedding pass the index is rebuilt automatically when fewer than 25% of its slots are live and more than 20,000 are dead.

`memory-mcp-cli compact` forces that rebuild, then runs `VACUUM` and prints file size and vector health before and after. If another process is using the database, `VACUUM` may be skipped; the rebuild still applies. `status` and `memory_status` report `vecBlocks`, `vecSlots`, `vecLive` and `vecUtilization`. When the index holds far more blocks than its live vectors need, search skips vector matching, returns full-text results and logs a hint to run `compact`.

### Search flags

| Flag | Description |
|------|-------------|
| `--max-results N` | Max results to return (1–100, default: from config) |
| `--min-score N` | Minimum relevance score (0–1, default: from config) |
| `--token-max N` | Max total tokens in response (default: from config) |

### Global config override flags

All config keys can be temporarily overridden via CLI flags (kebab-case):```bash
memory-mcp-cli search "query" --workspace /tmp/alt-memory
memory-mcp-cli status --chunk-size 1024 --session-days 7
memory-mcp-cli search "query" --profile learning --model /path/to/model.gguf

Or run directly: node dist/cli.js search "query"

Output is JSON to stdout, suitable for piping into other tools.

Upgrading

When upgrading from a version that used ~/.copilot/ or ~/.claude/ as the workspace, memory-mcp setup (or the MCP server on first start) will automatically copy your memory files to ~/.memory-mcp-workdir/default/. Original files are preserved — remove them manually when ready.

Config migration: If your config file uses the legacy flat format (no profiles section), it is automatically treated as the default profile. On the first operation that creates profiles (e.g. config profile create), legacy workspace and dbPath fields are migrated into profiles.default so custom paths are preserved.

Breaking changes:

  • Most MEMORY_* environment variables have been removed. Configuration is now managed through the config file (~/.memory-mcp-workdir/memory-mcp.json). Use memory-mcp config set to migrate your settings. Two environment variables remain:
  • MEMORY_MCP_PROFILE — select a named profile for the MCP server (alternative to --profile flag)
  • MEMORY_MCP_NO_WORKER=1 — disable the worker-thread embedding engine, fall back to FTS-only search
  • The --config CLI flag has been removed. Use --profile to select a named profile instead.

Uninstall```bash

npm uninstall -g memory-mcp


The `preuninstall` hook automatically removes config and instructions for both Copilot CLI and Claude Code.
To remove config manually without uninstalling: `memory-mcp uninstall` or `memory-mcp uninstall --claude`

## Development```bash
git clone https://github.com/XingxingLi2017/memory-mcp.git
cd memory-mcp
npm install -g .   # Installs dependencies, builds, and registers globally
memory-mcp setup

License

MIT

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Memory MCP 9e4cc875 怎么安装?

在客户端按下面的安装命令接入:npx --no node-llama-cpp source download。装完在客户端配置里引用同一个包或端点。

Memory MCP 9e4cc875 怎么在 Claude 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Memory MCP 9e4cc875 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Memory MCP 9e4cc875 需要 API Key 吗?

资料标注需要Token认证,使用前准备好对应凭据,并按最小权限配置。

Memory MCP 9e4cc875 支持哪些客户端?

资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Memory MCP 9e4cc875 能提供哪些能力?

资料显示约 6 个工具;能力标签包括 内存管理、混合搜索、TypeScript、Claude、向量搜索。具体工具清单以官方文档为准。

Memory MCP 9e4cc875 需要什么运行环境?

运行时为 Node.js;属于本地进程,需要在本机装好运行环境。

Memory MCP 9e4cc875 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。