Local MCP server that captures the why behind your code — domain knowledge for Claude, Cursor, Copilot, and any MCP agent.
git clone https://github.com/mashware/domain-memory{
"mcpServers": {
"domain-memory": {
"command": "node",
"args": ["/path/to/domain-memory/dist/index.js"]
}
}
}Resumen de MCP Servers
# Domain Memory

[](https://github.com/mashware/domain-memory/actions/workflows/ci.yml)
[](LICENSE)
[](https://nodejs.org/)
[](https://modelcontextprotocol.io/)
[](https://github.com/mashware/domain-memory/stargazers)
A local MCP server that accumulates the **business-domain knowledge** of a software project — flows, integrations, decisions, nuances — and makes it available to any MCP-compatible agent (Claude Code, Cursor, Copilot, Gemini, OpenCode).
The goal is to capture the **why** behind the code: the stuff a new developer would need six months from now to understand why a thing is built the way it is. The **what** is already in the code — domain-memory does not duplicate it.
> **Status**: Functional. Local install, single developer, local SQLite.
## What this is
Domain Memory is a **living glossary of your project's business domain** — the concepts, rules, entities, and the *why* behind decisions — that grows as you build. The frame that matters: this is **semantic memory** (what "a German invoice" or "a deactivated account" means in your project, and why it behaves the way it does), not **episodic memory** (what you changed last Tuesday and in which commit). The episodic record already lives in git history; Domain Memory holds the part no diff captures.
You don't stop to write documentation. As the agent works it records findings on its own, and they are folded into the glossary when you run `/save-knowledge` or open a pull request — so the knowledge accrues from real work instead of becoming a separate authoring chore you have to remember.
Everything is **plain markdown you own and version in git**. Each entry is a human-readable file under `.domain-memory/`; the search index is derived from those files and can be rebuilt from them at any time, so the knowledge stays portable, reviewable in a pull request, and never locked inside a database.
If what you want is a history of work sessions, cross-machine sync, or generic per-user assistant memory, this is deliberately not that. Domain Memory stays narrow on purpose: the domain knowledge of one project, and nothing else.
## How is this different from…
Domain Memory occupies a narrow niche. The closest neighbours and where it differs:
| Tool | What it stores | Scope |
|---|---|---|
| **Domain Memory** | Business-domain knowledge — the *why* behind the code, decisions, integrations, flows | Per-project, local, source-controlled markdown |
| `mem0`, `letta` | Conversation / agent memory — what the user said, preferences | Per-user, cross-conversation |
| RAG over docs (`continue.dev`, custom pipelines) | Whatever text you embed (READMEs, Confluence, code) | Reuses existing artefacts; no new authoring layer |
| `CLAUDE.md` / `AGENTS.md` | A single hand-written context file | One file, no structure, no search |
If you're asking "where does the agent remember that I prefer dark mode?", you want `mem0`. If you're asking "where does the agent remember that we deliberately bypass tax validation for German invoices because of the 2024 ruling?", you want this.
---
## How it works
Three principles run the whole system:
1. **The LLM is the criterion, the MCP is the store.** All judgment calls — "does this contradict existing knowledge?", "is this worth remembering?" — live in the agent. The server just persists, searches, and reports. Semantic reasoning never happens in SQL.
2. **Markdown on disk is the source of truth.** Every entry is a human-readable `.md` file under `.domain-memory/knowledge/`. SQLite is a derived index that can be rebuilt from disk at any time (`domain-memory reindex`).
3. **Failures are silent.** A down embedder, a slow query, a corrupted staging line — none of it is ever surfaced to the agent session. If domain-memory cannot help, it stays out of the way.
### Unit of knowledge: Feature + Aspects
The unit is the **feature** (`checkout`, `auth`, `notifications`, `search`…). Each feature is one directory with a `feature.md` and optional `aspects/` underneath:
```
.domain-memory/knowledge/
checkout/
feature.md ← high-level prose + Mermaid of the whole flow
aspects/
taxes.md ← specific subtopic
stripe.md
webhook.md
```
A feature is the **primary context**: the general Mermaid diagram in `feature.md` typically answers 70% of questions. Aspects are loaded on demand when the agent needs detail on a specific slice.
Each entry carries three layers:
- **What it does** — short prose (no code duplication).
- **How it flows** — a Mermaid diagram (mandatory for flows and integrations).
- **Where it lives** — `file_paths` + qualified symbol names.
### Per-branch staging
While you work, the agent appends **findings** to `.domain-memory/staging/<branch>.jsonl`. Findings survive session compaction, browser closes, new sessions on the same branch — indexed by git branch, not by session id. When you open a PR or run `/save-knowledge`, the staging is consolidated into real entries.
If you sometimes push without going through the agent, those findings can sit unconsolidated. The optional **pre-push reminder** closes that gap: `domain-memory install --git-hook` writes a non-blocking `.git/hooks/pre-push` that prints a one-line nudge when the branch you are pushing still has staged findings. It never blocks the push, stays silent when there is nothing to consolidate, and is a no-op if the CLI is not on `PATH`. It is opt-in — plain `install` asks before touching `.git/hooks`.
### Triple matcher
`search_knowledge` runs three matchers in parallel and fuses them:
1. **Embedding** (semantic, local Transformers.js with all-MiniLM-L6-v2, no API key).
2. **BM25** (SQLite FTS5, for exact keyword matches).
3. **Path / symbol** (exact + basename + short-symbol, resilient to renames).
The fusion is weighted: path = 0.5, embedding = 0.3, bm25 = 0.2. Path/symbol is weighted strongest because it is the most reliable signal when two pieces of knowledge are about the same code.
### Drift
Every entry stores SHA-256 hashes of the files it references. On PR open, the agent cross-references the PR's touched files against the knowledge store via `check_drift` and asks the developer to review any affected entries. Rename/move is absorbed by matching on basename and short symbol; deletes are caught on the next reindex.
### Lazy confidence decay
Every entry has a `confidence` (0–100) that decays **-5 points every 30 days** without verification. Computed lazily at read time — no scheduled job, always consistent with the wall clock. Below 50 the entry shows up red in `/stale` and the web viewer. A human review resets it with `domain-memory verify <id>`.
---
## Install
Two ways to run it. Pick the one that matches what you're trying to do.
### Just the MCP server (most common)
Add it to your MCP client's config. No global install needed — `npx` fetches and runs it on demand.
```json
{
"mcpServers": {
"domain-memory": {
"command": "npx",
"args": ["-y", "@mashware/domain-memory-server"]
}
}
}
```
That goes in `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor), `.vscode/mcp.json` (Copilot), `.gemini/settings.json` (Gemini), or `opencode.json` (OpenCode).
Restart your client. From then on the agent will call `search_knowledge` at the start of each session.
### Server + CLI (web viewer, install helper, drift checks)
If you also want the `domain-memory` CLI (to bootstrap entries, run the web viewer, check drift, etc.):
```bash
npm install -g @mashware/domain-memory
```
This installs three commands globally: `domain-memory`, `domain-memory-server`, `domain-memory-web`. Then in any project:
```bash
cd /path/to/your/project
domain-memory install # writes the MCP config + pointer blocks for the clients you use
domain-memory doctor # sanity check
domain-memory web # open the viewer at http://localhost:4373
```
`install` is idempotent — re-running updates files in place without clobbering your content.
### Updating
```bash
npm update -g @mashware/domain-memory
```
### Uninstalling
```bash
npm uninstall -g @mashware/domain-memory
```
To remove domain-memory from a specific project: delete `.domain-memory/`, remove the `<!-- domain-memory:start -->` block from the client instruction files, and drop the `domain-memory` entry from `.mcp.json` / `.cursor/mcp.json` / `.vscode/mcp.json` / `.gemini/settings.json` / `opencode.json`. If you installed the pre-push reminder, also remove the `# >>> domain-memory pre-push >>>` block from `.git/hooks/pre-push` (or delete the file if it contains nothing else).
### From source (contributors)
If you want to hack on the project itself, see [CONTRIBUTING.md](CONTRIBUTING.md) for the clone-and-link dev workflow.
---
## CLI commands
| Command | What it does |
|---|---|
| `domain-memory install` | Interactive setup. Detects which MCP clients the project uses and writes pointer blocks, MCP registrations, and `.gitignore` entries idempotently. Pass `--git-hook` to also install the pre-push reminder without prompting. |
| `domain-memory bootstrap [--source-root path]` | Scan a mature project and write `.domain-memory/bootstrap-plan.md` — a checklist of candidate features for the agent to process with you. Prints a ready-to-paste prompt. See "Mature projects" below. |
| `domain-memory enrich <id\|slug>` | Print a guided prompt to deepen an existing feature entry. Useful for ritualized "spend 20 minutes improving checkouLo que la gente pregunta sobre domain-memory
¿Qué es mashware/domain-memory?
+
mashware/domain-memory es mcp servers para el ecosistema de Claude AI. Local MCP server that captures the why behind your code — domain knowledge for Claude, Cursor, Copilot, and any MCP agent. Tiene 4 estrellas en GitHub y se actualizó por última vez today.
¿Cómo se instala domain-memory?
+
Puedes instalar domain-memory clonando el repositorio (https://github.com/mashware/domain-memory) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.
¿Es seguro usar mashware/domain-memory?
+
mashware/domain-memory aún no ha sido auditado por nuestro agente de seguridad. Revisa el repositorio original en GitHub antes de usarlo en producción.
¿Quién mantiene mashware/domain-memory?
+
mashware/domain-memory es mantenido por mashware. La última actividad registrada en GitHub es de today, con 0 issues abiertos.
¿Hay alternativas a domain-memory?
+
Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.
Despliega domain-memory en tu cloud
Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.
¿Mantienes este repo? Añade un badge a tu README
Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.
[](https://claudewave.com/repo/mashware-domain-memory)<a href="https://claudewave.com/repo/mashware-domain-memory"><img src="https://claudewave.com/api/badge/mashware-domain-memory" alt="Featured on ClaudeWave: mashware/domain-memory" width="320" height="64" /></a>Más MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。