mcp-memory-service
CLAUDE.md2k starsChanged 58 days agoApache-2.0View on GitHub
It is written to be self-sufficient: a model should be able to work correctly here from this file alone, without filling gaps from prior knowledge. Personal Customizations: You can create CLAUDE.local.md (gitignored) for personal notes, custom workflows, or environment-specific instructions. This file contains shared project conventions. Information Lookup: Files first, memory second, user last. See .claude/directives/memory-first.md for strategy. Comprehensive project context is stored in the MCP Memory Server with tag claude-code-reference. Quick reference; each rule is expanded in the sections…
- Reads credentials
- Installs packages
- Commits and pushes
Trending
Less talk lately.about the whole repository
Who's talking about doobidoo/mcp-memory-service
- @mara.x0f.nl“what i use is github.com/doobidoo/mcp... it's quite advanced, and overall i'm quite happy with it it has a …”Bluesky · Sep 7, 2026 · 7 likes
- anthropics/claude-code“[Windows] SessionStart hooks cause infinite hang during initialization”GitHub · Oct 14, 2025 · 5 reactions
- @mara.x0f.nl“opencode is such a breath of fresh air after cc only thing i've been missing is a memory system but i'm now …”Bluesky · May 26, 2026 · 2 likes
- @mara.x0f.nl“you can add memory to opencode with a plugin, this is quite a popular one github.com/doobidoo/mcp... …”Bluesky · May 18, 2026 · 2 likes
- UfoMiao/zcf“Miscellaneous set of tools”GitHub · Aug 18, 2025 · 2 reactions
The biggest 5 of 39 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 39
Talked about on GitHub and Bluesky (39 times).
On GitHub · 36
- Oct 14, 2025[Windows] SessionStart hooks cause infinite hang during initialization — anthropics/claude-code5 reactions · 7 comments
- Aug 18, 2025Miscellaneous set of tools — UfoMiao/zcf2 reactions · 1 comment
- May 31, 2026fix(lychee): exclude deleted doobidoo/mcp-memory-service (404 on main) — techempower-org/mempalace1 reaction · 1 comment
- May 27, 2026Add doobidoo/mcp-memory-service — open-gitagent/registry1 reaction
- Oct 4, 2026Upstream release: MCP Memory Service 11.15.0 (pinned 11.14.0) — dockhold/mcp-memory-service-starter0 reactions
31 more on GitHub
- Sep 4, 2026[New Service] September 4 OSS catalog additions — haoruilee/awesome-agent-native-services0 reactions
- Aug 14, 2026[Argus] CVE-2026-50027: mcp-memory-service: Document API 엔드포인트 인증 누락으로 인한 비인증 메모리 읽기/쓰기/삭제 — LEEKIYOON-SEC/Argus-DEV0 reactions
- Aug 4, 2026fix(memory): pin mcp-memory-service to PyPI 11.6.1 — grantkl/claudebot0 reactions
- Aug 1, 2026Broken links detected in guide markdown — AMusso19/CUSTOM-claude-code-ultimate-guide-Florian0 reactions
- Aug 1, 2026Broken links detected in guide markdown — JAYcodr/claude-code-ultimate-guide-zh0 reactions
- Aug 1, 2026Broken links detected in guide markdown — alexica00/claude-code-ultimate-guide0 reactions
- Aug 1, 2026Broken links detected in guide markdown — FlorianBruniaux/claude-code-ultimate-guide0 reactions · 1 comment
- Jul 7, 2026Add Tree Ring Memory — jvidal86/awesome-claude-code-memory0 reactions
- Jul 7, 2026Add Tree Ring Memory — LangGPT/awesome-claude-code0 reactions
- Jul 1, 2026Broken links detected in guide markdown — AMusso19/CUSTOM-claude-code-ultimate-guide-Florian0 reactions
- Jul 1, 2026Broken links detected in guide markdown — alexica00/claude-code-ultimate-guide0 reactions
- Jul 1, 2026Broken links detected in guide markdown — JAYcodr/claude-code-ultimate-guide-zh0 reactions
- Jul 1, 2026Broken links detected in guide markdown — FlorianBruniaux/claude-code-ultimate-guide0 reactions · 1 comment
- Jun 16, 2026deps: bump mcp-memory-service from 10.54.0 to 10.74.1 — learn-ukrainian/learn-ukrainian.github.io0 reactions
- Jun 1, 2026stale-row: mcp-memory-service-doobidoo--gh-doobidoo-mcp-memory-service (abandoned, 1460d since last commit) — MrPeppersDev/agent-infrastructure-landscape0 reactions · 1 comment
- Jun 1, 2026Broken links detected in guide markdown — alexica00/claude-code-ultimate-guide0 reactions
- Jun 1, 2026Broken links detected in guide markdown — JAYcodr/claude-code-ultimate-guide-zh0 reactions
- Jun 1, 2026Broken links detected in guide markdown — FlorianBruniaux/claude-code-ultimate-guide0 reactions · 1 comment
- May 31, 2026ci(lychee): main-level link liabilities fail the gate on every PR (dead external ref + commit/HEAD placeholders) — techempower-org/mempalace0 reactions · 1 comment
- May 29, 2026feat: adopt MCP Memory Service knowledge graph & consolidation — codecoradev/uteke0 reactions · 1 comment
- May 23, 2026Show & Tell: MCP Memory Service — semantic memory plugin working with event hook — anomalyco/opencode0 reactions · 3 comments
- May 18, 2026[Resource]: mcp-memory-service — hesreallyhim/awesome-claude-code0 reactions · 1 comment
- May 11, 2026deps: bump mcp-memory-service from 10.29.1 to 10.54.0 — learn-ukrainian/learn-ukrainian.github.io0 reactions · 3 comments
- Apr 20, 2026PoC: hybrid episodic/semantic/procedural memory layer for keeper turns — jeong-sik/masc0 reactions · 1 comment
- Mar 30, 2026deps: Bump mcp-memory-service from 10.4.1 to 10.29.1 — learn-ukrainian/learn-ukrainian.github.io0 reactions · 1 comment
- Mar 6, 2026[A] GHSA-73hc-m4hx-79pj — Information Disclosure (python) 100/100 — azkingston/semgrep-rules-production0 reactions
- Mar 6, 2026mcp-memory-service — hesreallyhim/awesome-claude-code0 reactions · 1 comment
- Jan 4, 2026eat: Add a lifecycle hook system for extensibility — google-gemini/gemini-cli0 reactions · 1 comment
- Sep 17, 2025Memory-Enhanced AppleScript Automation — peakmojo/applescript-mcp0 reactions
- Aug 22, 2025Add MCP Context Provider and mcp-memory-service to community servers list — modelcontextprotocol/servers0 reactions
- Apr 10, 2025CP-memory-service — ThinkInAIXYZ/deepchat0 reactions · 4 comments
On Bluesky · 3
- Sep 7, 2026what i use is github.com/doobidoo/mcp... it's quite advanced, and overall i'm quite happy with it it has a knowledge graph you can view on… — @mara.x0f.nl7 likes and reposts · 6 replies
- May 26, 2026opencode is such a breath of fresh air after cc only thing i've been missing is a memory system but i'm now trying… — @mara.x0f.nl2 likes and reposts · 1 reply
- May 18, 2026you can add memory to opencode with a plugin, this is quite a popular one github.com/doobidoo/mcp... (haven't personally tried it though) — @mara.x0f.nl2 likes and reposts · 1 reply
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/directives/agents.mdAGENTS.md
- gitnexus-debuggingSkill
- gitnexus-exploringSkill
- gitnexus-impact-analysisSkill
- gitnexus-refactoringSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
21 rules. About 0 are common, 12 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Never manually bump versions: Follow the documented release workflow for every version bump and release.
- Very specific: line 16
Use the project venv: Run .venv/bin/python and .venv/bin/pytest (Python 3.12) — the system interpreters are not the project environment.
- Distinctive: line 25
Write in the maintainer's or contributor's own voice: Commit messages, PR descriptions, CHANGELOG entries, issue/PR comments, and release …
- Distinctive: line 31
Don't ask what you can determine yourself — read the code, run the command, check the API, then report.
- Distinctive: line 32
Never omit or soften factual personal/professional details in CV/portfolio work unless explicitly told to.
- Very specific: line 36
Never treat an HTTP 200 as proof of deployment.
- Distinctive: line 37
Before filing an issue or PR, search existing open/closed issues for duplicates and read-back the created item to confirm content.
- Distinctive: line 38
After posting a comment, release note, or wiki edit, re-fetch it and quote the live text as evidence.
- Very specific: line 46
Always run git operations with an explicit -C <path> or confirm pwd first.
- Distinctive: line 52
IMPORTANT: Before working with this project, read:
- Very specific: line 76
If the ancestor check fails, stop and investigate.
- Distinctive: line 80
Authorship voice: Commit messages, PR descriptions, CHANGELOG entries, issue/PR comments, and release notes are written in the maintainer's …
- Distinctive: line 83
Before merging or releasing:
- Distinctive: line 89
Follow the release workflow — never manually bump versions.
- Very specific: line 260
Only supported on the sqlite_vec backend, not on hybrid or cloudflare.
- Distinctive: line 408
CHANGELOG.md: - Every version bump (via the release workflow)
- Distinctive: line 424
When the user's request matches an available skill, invoke it via the Skill tool.
- Very specific: line 444
If a route here does not resolve, check ~/.claude/skills and the skillOverrides block in ~/.claude/settings.json before assuming the skill …
- Very specific: line 453
If graphify-out/wiki/index.md exists, use it for broad navigation instead of raw source browsing.
- Very specific: line 454
Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context.
- Very specific: line 455
After modifying code, run graphify update .
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with this MCP Memory Service repository. It is written to be self-sufficient: a model should be able to work correctly here from this file alone, without filling gaps from prior knowledge.
Personal Customizations: You can create
CLAUDE.local.md(gitignored) for personal notes, custom workflows, or environment-specific instructions. This file contains shared project conventions.
Information Lookup: Files first, memory second, user last. See
.claude/directives/memory-first.mdfor strategy. Comprehensive project context is stored in the MCP Memory Server with tagclaude-code-reference.
Non-Negotiables (hard rules)
Quick reference; each rule is expanded in the sections below. Violations cause real incidents.
- Development happens on GitHub.
originisgithub.com:doobidoo/mcp-memory-service; CI is GitHub Actions (.github/workflows/); issues, PRs, releases and the tag push that starts a release all live there, andghis the CLI for all of it. GitLab is a push mirror that receives fast-forwards ofmainand never tags (see "Source Control & Hosting"). - Never manually bump versions. Follow the documented release workflow for every version bump and release.
- Run
bash scripts/pr/pre_pr_check.shbefore every PR. It is the mandatory pre-PR gate and must pass. - Use the project venv. Run
.venv/bin/pythonand.venv/bin/pytest(Python 3.12) — the system interpreters are not the project environment. - Store context in the MCP Memory Server first, tagged
mcp-memory-service. Claude Code's file-based memory (~/.claude/projects/<project>/memory/) may run alongside it as a local cache — it is a supplement, not a substitute, and it lives outside the repo. Never commit memory files into the working tree. - Access
Memoryfields by attribute (memory.tags), never viamemory.metadata.get('tags'). This has caused 3 production bugs. - Sanitize user-provided values in logs with
_sanitize_log_value()(frommcp_memory_service.compat). - MCP server configs go in
.mcp.json, notsettings.json. - Update
site/index.htmlversion strings on every MINOR/MAJOR release (a CI gate enforces this). - Never click "Always allow" on heredoc commands — it corrupts
.claude/settings.local.json. - Before any SSH/network task, verify
hostnameand connection direction (source → target). - Report outcomes faithfully. "Tests pass" means you ran them and saw them pass; if a step was skipped or failed, say so with the output.
- Write in the maintainer's or contributor's own voice. Commit messages, PR descriptions, CHANGELOG entries, issue/PR comments, and release notes read as authored by the maintainer or contributor.
- CONTRIBUTING.md binds maintainers and agents too. Before starting work on issue #N, check for existing work three ways:
gh issue view N --json comments,assignees,closedByPullRequestsReferences(claims, assignee, linked PRs),gh pr list --search "N" --state all, and agh pr list --search "<topic keywords>" --state open, since a PR can cover an issue without naming its number. If someone else claimed it or an open PR covers it, stop and report that. Otherwise claim it the way CONTRIBUTING.md asks: comment on the issue, and also rungh issue edit N --add-assignee @meso other sessions can see the claim. Henry asking for the work is the maintainer confirmation. An agent never claims an issue it was not asked to take. Every review thread (Greptile's included) gets a fix or a reply before it is resolved; see "Source Control & Hosting" for the ruleset that enforces this.
Answering vs Acting
- A question is a question, not a work order. Answer first; only act when asked.
- Don't ask what you can determine yourself — read the code, run the command, check the API, then report.
- Never omit or soften factual personal/professional details in CV/portfolio work unless explicitly told to; include everything verifiable.
Verification Standards
- Never treat an HTTP 200 as proof of deployment. Verify by fetching the specific artifact/content and diffing against expected output (Cloudflare falls back to index.html on 404).
- Before filing an issue or PR, search existing open/closed issues for duplicates and read-back the created item to confirm content.
- After posting a comment, release note, or wiki edit, re-fetch it and quote the live text as evidence.
Memory Discipline
At the end of any session that produces a decision, root cause, or reusable lesson, persist it to MCP Memory without being asked. MEMORY.md stays pointer-only — store the content in the memory service and reference it by sub-doc pointer.
Shell & Git Safety
- Always run git operations with an explicit
-C <path>or confirmpwdfirst; never assume the current tree is the intended worktree. - Quote all shell variables and prefer
bash -cover zsh for loops; word-splitting has produced false PASS results in verification loops. - Bulk tag pushes are limited to 2 refs at a time by the repo ruleset — batch accordingly.
Critical Directives
IMPORTANT: Before working with this project, read:
.claude/directives/memory-tagging.md- MANDATORY: Always tag memories withmcp-memory-serviceas first tag.claude/directives/README.md- Additional topic-specific directives
Operational Rules
Auto-Save Learnings
- After completing tasks: automatically save key learnings, decisions, and patterns to the MCP Memory Server without being asked
- Include relevant tags:
mcp-memory-service, task-specific tags, andlearnings
Source Control & Hosting
- GitHub is where the work happens. CI runs as GitHub Actions in
.github/workflows/:ci.yml,changelog.yml(changelog fragment check, runs on every PR),links.yml(internal Markdown links on every PR, external links weekly),release.yml,deploy-site.yml,cleanup-images.yml,codeql.yml, andtriage-digest.yml(daily maintainer digest, seescripts/maintenance/github_triage_digest.py). Issues, PRs and releases are there, and so is the tag push that starts a release. - Only GitHub-owned actions are allowed, and SHA pinning is enforced. The repository is set to
allowed_actions: selectedwithgithub_owned_allowed: true, an emptypatterns_allowedlist, andsha_pinning_required: true. A third-party action therefore does not fail at review, it fails at run time. That is whyrelease.ymlshells out to rawdocker buildxinstead of using thedocker/*actions. Before adding anyuses:that is notactions/*orgithub/*, the allowlist has to be widened deliberately. - A ruleset caps a single push at two refs.
Pushes can not update more than 2 branches or tags. Bulk tag pushes have to be batched in pairs; this is why the historical tag import ran as 15 pushes rather than one. - Two rulesets guard
main.ProtectMainrequires one approval and lets admins bypass it, sogh pr merge --adminstill merges a solo PR.ResolveThreadsrequires every review thread to be resolved and has no bypass actors. A PR with an open thread therefore cannot merge by any route (--admin, web UI, API) until the thread is answered and resolved. Rulesets stack, so this is not a mistake to "fix" by adding a bypass. - One publisher at a time.
release.ymlowns PyPI and Docker Hub, and it is the only thing that may publish. Before wiring any second automation that could publish, disarm the first one. Codeberg lost its secrets on 2026-09-05 for exactly this reason. - PyPI auth is still a classic token. Trusted Publishing is not configured. The pre-Codeberg workflows declared
id-token: writebut authenticated withsecrets.PYPI_TOKENvia twine, so switching to OIDC is new work and needs a publisher configured on the PyPI side. - GitLab is a push mirror, not a second publisher: fast-forwards of
mainonly, no secrets, never tags. Prove the fast-forward instead of assuming it:
If the ancestor check fails, stop and investigate. Do not force. Note that some shells manglegit fetch origin main git merge-base --is-ancestor "$(git ls-remote gitlab main | cut -f1)" FETCH_HEAD git push gitlab FETCH_HEAD:refs/heads/mainmerge-base --is-ancestor "$A" "$B"; if it reports "Not a valid object name" on a ref that clearly exists, run it through Python'ssubprocessrather than debugging the ref. - Codeberg is a frozen archive at
codeberg.org/doobidoo/mcp-memory-service. It holds no secrets, receives no pushes, and its CI is dead. It stays readable so old links resolve. Do not resume mirroring to it: Codeberg's ToU § 2 (1) 7 bars projects written mostly with generative AI tools, this account was warned under that clause on 2026-08-27, and a mirror is still sharing a project. - Issue and PR numbers below #341 are Codeberg numbers. GitHub will happily auto-link
#123in old CHANGELOG and README entries to a GitHub issue of that number, which is a different thing entirely. When citing history, say "Codeberg #123" or link the full URL.docs/codeberg-issue-map.mdresolves every one of them. The issues that were still open on 2026-09-05 were re-created on GitHub and carry the labelmigrated:codeberg. - GHSA identifiers (e.g.
GHSA-2r68-g678-7qr3) are just advisory IDs and remain valid references. - Authorship voice. Commit messages, PR descriptions, CHANGELOG entries, issue/PR comments, and release notes are written in the maintainer's or contributor's own voice.
Release Workflow Checklist
Before merging or releasing:
- Verify CI is green on the target branch (GitHub Actions).
gh run list --branch <branch>or the Actions tab. - Update
site/index.htmlversion strings whenever MAJOR.MINOR changes (i.e. every MINOR or MAJOR release — PATCH releases are exempt). Theversion-drift-checkCI gate enforces this and will fail if skipped. Update ALL occurrences:<title>,<meta og:title>, hero badge, "What's New" section, release linkhref. Usegrep -n "v11\." site/index.htmlto find them. This is MANDATORY — not optional for "incremental" releases. The site auto-deploys to Cloudflare Pages (mcpmemory.services) when the change lands on main (.github/workflows/deploy-site.yml). - Bump
claude-hooks/.claude-plugin/plugin.jsonif the hooks changed. The Claude Code plugin carries its own version, and the Marketplace cache is keyed on it, so a hook fix released without a manifest bump never reaches installed users. Theplugin-version-checkCI gate enforces this on release changes (scripts/ci/check_plugin_version.sh): it fails whenclaude-hooks/changed since the last commit that moved the manifest version. v11.6.0 shipped a hook fix this way (#170). - After the tag push, run
bash scripts/release/verify_artifacts.sh X.Y.Z. It checks both PyPI distributions by version and all four Docker tags pluslatestby digest, so a half-published release (v11.11.0: PyPI green, Docker dead at login,lateststale) cannot pass for a finished one. Exit must be 0 before the release object is created. - Clean up merged branches after release (
git branch -d,git push origin --delete). - Follow the release workflow — never manually bump versions.
Overview
Current version and release history: CHANGELOG.md. The forge-API tag trap that
left v11.8.1 unpublished is documented in .claude/directives/version-management.md.
Essential Commands
Python Environment
This repo uses a project virtualenv at .venv (Python 3.12). The system python/pytest are not the project interpreter. Always use the venv binaries:
.venv/bin/python -m mcp_memory_service.server # run a module
.venv/bin/pytest # run the test suite
.venv/bin/python -m pip install -e . # editable installThe venv is not guaranteed to carry the dev tooling: a uv-created one holds the
runtime dependencies only, with no pip and no pytest. scripts/pr/pre_pr_check.sh
resolves its interpreter from .venv/bin/ before it looks at $VIRTUAL_ENV, so it
cannot be pointed elsewhere, and it discards the output of its own pip install
pytest-cov. The result is a bare FAIL - Test suite at step [3/9] with no test
names under it. That is an environment failure, not a broken change. Repair it with:
uv pip install --python .venv/bin/python pip pytest pytest-cov pytest-asyncio \
pytest-subtests pytest-timeout pytest-mockpytest-timeout is required, not optional -- the gate passes --timeout=120.
The commands below are written as bare python/pytest for brevity — run them via .venv/bin/.... For git commit, the pre-commit hook uses system Python and will fail with "Package not installed"; prefix commits with PATH=".venv/bin:$PATH" (see Troubleshooting). uv is also used (uv.lock present); uv pip install -e . and uv run memory ... work too.
Development Server
The lifecycle CLI (memory launch|stop|restart|info|logs, see memory --help) is the
preferred way to manage the server. The legacy entry points
(python -m mcp_memory_service.server, scripts/server/run_http_server.py,
scripts/update_and_restart.sh) still work but may be deprecated in a future release;
run_http_server.py and update_and_restart.sh are not the path for new deployments.
Testing
Standard pytest invocations apply; markers are declared in pytest.ini. Exact test
count: .venv/bin/pytest --collect-only -q | tail -1.
# Pre-PR validation (MANDATORY before submitting PR)
bash scripts/pr/pre_pr_check.shFull command reference: scripts/README.md. Validation and
diagnostics live in scripts/validation/; the HTTP health endpoint is
/api/health on the configured port (default 8000).
Code Architecture
Package layout: ls src/mcp_memory_service/. Non-obvious entry points:
server_impl.py- theMemoryServerclass.list_tools()builds the tool list from the declarative registry,call_tool()dispatches through the routing table, and thehandle_*methods live here too.tools/registry.py-TOOL_REGISTRY, the declarative list ofToolDefobjects, each mapping 1:1 to atypes.Tool. Count:grep -c 'ToolDef(' src/mcp_memory_service/tools/registry.py.tools/routing.py-ROUTING_TABLE(name -> handler) plusresolve_handler(name)with lazy import.server/handlers/*.py- request handlers, signatureasync def handle_X(server, arguments) -> List[types.TextContent].compat.py- compatibility shims and_sanitize_log_value().consolidation/- dream-inspired memory maintenance, not a data-consolidation layer.
Global singleton caching in server/cache_manager.py prevents redundant storage
initialization across MCP tool calls. Do not instantiate storage per call.
Storage backends (storage/)
Strategy Pattern over BaseStorage (base.py), three implementations:
| Backend | File | Performance | Use case |
| SQLite-Vec | sqlite_vec.py | 5ms reads | Development, single-user |
| Cloudflare | cloudflare.py | Network-dependent | Cloud-only, edge |
| Hybrid | hybrid.py | 5ms local plus cloud sync | Production (recommended) |
SQLite-Vec uses the sqlite-vec extension for KNN search, Cloudflare uses D1 plus
Vectorize, Hybrid reads locally and syncs to Cloudflare in the background. Graph
storage sits in graph.py. Embeddings: ONNX, sentence-transformers/all-MiniLM-L6-v2.
Web layer (web/)
FastAPI dashboard plus REST API. Two things that are not visible from the file names:
api/mcp.pyis a thin MCP-over-HTTP protocol shim. Its tool surface and dispatch are inherited from the sharedMemoryServer, so tools are not defined twice.- Tools that read caller-supplied filesystem paths are filtered out of the remote
transport by
local_only_tools()inserver_impl.py. This is the confused-deputy guard, not an optimization.
Quality system (quality/)
Three tiers, local first:
| Tier | Provider | Latency | Cost | Role |
| 1 | Local ONNX | 80-150ms | 0 | Default |
| 2 | Groq / Llama 3 | 500-800ms | 0.0015 | Fallback if local fails |
| 3 | Gemini 1.5 Flash | 1-2s | 0.01 | High-accuracy scoring |
Scores are 0.0 to 1.0 and feed quality-boosted search and retention policy.
Consolidation (consolidation/)
Runs via the HTTP API, not the MCP tools (roughly 90 percent fewer tokens), scheduled
with APScheduler. Retention by quality tier: high 365d, medium 180d, low 30-90d
(forgetting.py). Relationship inference classifies associations as causes, fixes,
contradicts, supports, follows or related, with a default confidence threshold of 0.6.
For existing associations, backfill with
scripts/maintenance/update_graph_relationship_types.py.
Document ingestion (ingestion/)
Registry pattern, loaders selected by file extension. Chunker defaults: 1000 chars
with 200 overlap. semtools_loader.py is optional and adds LlamaParse for PDF, DOCX
and PPTX.
Test Architecture
About 2,400 tests across roughly 216 files. tests/ mirrors src/.
Test safety (critical, PR #438)
On Feb 8, 2026 a test cleanup deleted 8,663 production memories. Recovery ran off an
emergency backup. Three guards now stand between the suite and a production database,
all in conftest.py:
- An isolated temp directory with prefix
mcp-test-is created at module import time. pytest_sessionstartaborts the run if a production path is detected.pytest_sessionfinishvalidates temp location, absence of production indicators, and presence of test markers before deleting anything.
Tests force MCP_MEMORY_STORAGE_BACKEND=sqlite_vec unless
MCP_TEST_ALLOW_CLOUD_BACKEND=true. Do not weaken any of this to make a test pass.
Fixtures and conventions (conftest.py)
temp_db_path gives an auto-cleaned temp directory, unique_content generates
non-duplicate test content, and test_store auto-tags everything with
TEST_MEMORY_TAG = "__test__", which is reserved for automatic cleanup. Never use
that tag for real data.
Markers in pytest.ini: unit, integration (needs storage), performance,
asyncio (auto-detected).
Configuration
Full variable list: .env.example. Precedence: environment variables, then .env,
then global Claude config, then defaults. After changing .env, restart with
memory restart.
Three settings that cause real incidents when wrong:
MCP_MEMORY_SQLITE_PRAGMASmust includejournal_mode=WAL. Without it, concurrent reads and writes are disabled and the HTTP server plus MCP server running together produce "database is locked". Working value:journal_mode=WAL,busy_timeout=15000,cache_size=20000.MCP_HYBRID_SYNC_OWNER=httpfor hybrid mode. Then only the HTTP server syncs to Cloudflare, the MCP server skips Cloudflare initialization entirely and talks to SQLite-Vec directly, andclaude_desktop_config.jsonneeds no Cloudflare credentials. Claude Desktop gets memory access, the HTTP server owns sync.MCP_INIT_TIMEOUTdefaults to 30s on Windows and 15s elsewhere, auto-doubled on first run. Slow Windows machines need it raised.
External embedding APIs
Only supported on the sqlite_vec backend, not on hybrid or cloudflare. Set
MCP_EXTERNAL_EMBEDDING_URL and MCP_EXTERNAL_EMBEDDING_MODEL, optionally
MCP_EXTERNAL_EMBEDDING_API_KEY. Works with vLLM, Ollama, TEI, OpenAI or any
OpenAI-compatible /v1/embeddings endpoint. Embedding dimensions must match the
database schema, and changing them requires re-embedding every memory. Details:
docs/deployment/external-embeddings.md.
Claude Desktop wiring: see README.
Development Guidelines
Quality gates
Three layers: pre-commit (under 5s, Groq/Gemini complexity plus security, blocks on
complexity above 8 or a security finding), the PR gate
bash scripts/pr/pre_pr_check.sh (10-60s, blocks on security or health below 50), and
a weekly pyscn review with trend tracking. Health score below 50 blocks a release,
50-69 means refactor within two weeks, 70 and up is fine. Complexity target is grade
A-B, meaning 8 or lower.
The PR gate's complexity check is scoped to the diff: a finding counts only when it
names a function the change actually touched (scripts/pr/lib/touched_functions.py).
An untouched function above the budget in the same file is the file's pre-existing
state and does not block — it used to, which made the gate unpassable for anyone
working in storage/hybrid.py or storage/base.py. Everything the gate does report
blocks; there is no "warning" tier below it.
Log injection guard (v10.68.0, from CodeQL GHSA-84hp-mqvj-3p8h)
User-provided values in raw f-string log calls trigger CodeQL py/log-injection.
Wrap them:
from mcp_memory_service.compat import _sanitize_log_value
logger.info(f"Stored: {_sanitize_log_value(content)}")The helper strips newline, carriage return and escape characters, which prevents log
forging and ANSI injection. pre_pr_check.sh check 6.5 detects unwrapped f-string
logger calls. For paths, validate with Path(user_input).resolve() and verify the
result is under the expected base directory.
Memory field access (cause of three production bugs)
tags, memory_type, content_hash and created_at are top-level attributes of the
Memory dataclass. metadata is a separate dict for custom key-value pairs only and
never holds standard fields.
memory.tags # correct
memory.memory_type or '' # correct, with fallback
memory.metadata.get('tags', []) # wrong, silently returns []
memory['tags'] # wrong, raises AttributeErrorThe metadata form fails silently, which is why it reached production three times
(PRs #466, #467, #469 in v10.13.1): a broken REST filter returning zero results, tags
rendered character by character, and crashing prompt handlers. Flag any
metadata.get('tags') or metadata.get('memory_type') in review.
External data parsers
Download and inspect a real sample before writing a parser or its tests. API docs and project pages misdescribe structures often enough to matter, for example LoCoMo observations are nested dicts rather than newline-separated strings.
Directives to read before working
.claude/directives/development-setup.md- editable install.claude/directives/pr-workflow.md- pre-PR checks.claude/directives/refactoring-checklist.md- refactoring safety.claude/directives/version-management.md- release workflow (how).claude/directives/release-cadence.md- release batching (when).claude/directives/extending.md- new MCP tool, storage backend, document loader.claude/directives/troubleshooting.md- symptom-to-fix table
Version bumps follow the documented release workflow, never by hand. It keeps
pyproject.toml, _version.py, CHANGELOG and the GitHub release in sync and writes
the release notes.
Gotchas when changing things
- Dashboard (
web/static/): the JS has no automated coverage. Verify in a browser and attach manual testing evidence or screenshots to the PR. - Removing a feature, port or command: run
grep -r "<term>" docs/ README.mdand clean up references in the same PR.scripts/ci/check_dead_refs.shcatches new dead refs as check 6.8 ofpre_pr_check.shand as a step in theshell-testsjob ofci.yml, but it scans onlydocs/andREADME.md, soCONTRIBUTING.mdandSECURITY.mdare outside its reach. Widening the scan targets is still open. - Moving, renaming or deleting a file:
scripts/ci/check_md_links.pychecks that every relative and own-repoblob/mainlink in every tracked.mdfile still resolves (check 6.9 ofpre_pr_check.sh, andlinks.ymlon every PR, docs-only ones included). External links are checked only weekly by the same workflow; there, only 404, 410 and connection failures count, and the frozen Codeberg archive is skipped.
Extension points
Adding an MCP tool, a storage backend, or a document loader — including the
readOnlyHint OAuth-scope trap and the maintenance scripts:
.claude/directives/extending.md. Renaming a tool is
a breaking change (the alias layer was removed in v11) — read that file first.
Definition of Done
Work is not "done" until the relevant checks below have been run and pass. Report results plainly — paste the command output; if a check was skipped or failed, say so rather than claiming success.
Every code change:
- Relevant tests pass:
.venv/bin/pytest tests/<area>(or.venv/bin/pytest -k <pattern>); run the full suite before a release. bash scripts/pr/pre_pr_check.shpasses — the MANDATORY pre-PR gate (blocks on security findings and health score <50, includes the log-injection check).- New code stays within the complexity budget (A-B grade, complexity ≤8).
- User-provided values in
logger.*calls are wrapped with_sanitize_log_value(). Memoryfields are accessed by attribute (memory.tags), nevermemory.metadata.get('tags').- If a feature/port/command was removed:
grep -r "<term>" docs/ README.mdand clean up references in the same change.
Dashboard changes (web/static/): verified in a browser (no automated JS coverage) — include a screenshot or a note of what was exercised.
Before a release / version bump:
- CI is green on the target branch (GitHub Actions).
- Version bumped via the release workflow (never by hand) — keeps
pyproject.toml,_version.py, CHANGELOG, and the GitHub release in sync. site/index.htmlversion strings updated if MAJOR.MINOR changed (see the Release Workflow Checklist).bash scripts/release/verify_artifacts.sh X.Y.Zexits 0 after the tag push, before the release object exists.
After finishing a task: save key learnings/decisions to the MCP Memory Server, tagged mcp-memory-service first (per the Auto-Save rule).
Troubleshooting
Symptom-to-fix table (database locks, Cloudflare 401/403, MCP init timeouts, the venv
pre-commit trap) plus the heredoc permission-corruption warning:
.claude/directives/troubleshooting.md.
Performance Characteristics
Key Metrics (from production deployments):
- 5ms reads - SQLite-Vec local storage
- 534,628x faster - Global caching optimization (v8.26.0)
- 90% token reduction - Consolidation via HTTP API vs MCP tools
- 85%+ trigger accuracy - Natural memory triggers (v7.1.3+)
- 80-150ms - Local ONNX quality scoring
Documentation
The wiki is the comprehensive reference: https://github.com/doobidoo/mcp-memory-service/wiki
When to update each:
- CLAUDE.md - Architecture changes, new patterns, development workflows
- README.md - New features, installation changes, user-facing updates
- CHANGELOG.md - Every version bump (via the release workflow)
- site/index.html - Landing page: MINOR/MAJOR releases only (title, og:title, hero badge, "What's New" cards, test count, release link). No manual publish step: merging to main triggers
.github/workflows/deploy-site.yml, which deployssite/to Cloudflare Pages (mcpmemory.services). GitHub Pages stays enabled and that is intentional: it servesdocs/frommain, wheredocs/index.htmlis a 19-line stub redirecting to mcpmemory.services, sodoobidoo.github.io/mcp-memory-service/keeps working for the links still pointing at it. Every push to main therefore fires apages build and deploymentrun — expected, not a stray workflow. Never put version strings or content indocs/index.html;site/index.htmlis canonical. - Wiki - Detailed guides, troubleshooting, tutorials
Additional Resources
- Storage Backends:
.claude/directives/storage-backends.md - Hooks Configuration:
.claude/directives/hooks-configuration.md - Quality System:
.claude/directives/quality-system-details.md - Consolidation:
.claude/directives/consolidation-details.md - Code Quality:
.claude/directives/code-quality-workflow.md
Skill routing
When the user's request matches an available skill, invoke it via the Skill tool. When in doubt, invoke the skill.
Key routing rules:
- Codebase / architecture question → invoke /graphify (see the graphify section below)
- Contributor issue, PR comment, feature proposal, off-platform message → invoke /contributor-triage
- Reviewing an incoming PR diff → invoke /pr-review
- Merge round over open PRs ("merge what is cheap to merge") → invoke /merge-sweep
- Release or version bump → invoke /release, never bump by hand
- Server won't start, MCP tools hang, sync or backend trouble → invoke /memory-service-doctor
- Evaluating an external repo, tool, or MCP server for adoption → invoke /repo-adoption-eval
- Architecture, workflow, sequence or state diagrams → invoke /archify
- Drafting prose (posts, comments, emails, release notes) → invoke /human-writing; for LinkedIn specifically, /linkedin-draft
- Bugs and unexpected behavior → invoke superpowers:systematic-debugging before proposing a fix
- New feature or behavior change → invoke superpowers:brainstorming before writing code
Skills named here must exist and be enabled. The older (gstack) routes
(/office-hours, /plan-*, /autoplan, /investigate, /qa, /review, /ship,
/land-and-deploy, /context-save, /context-restore and ~45 more) were deleted on
2026-09-06 — the whole bundle was disabled and unused, and it is gone from
~/.claude/skills. /codeberg-pr-review was replaced by /pr-review the same day.
If a route here does not resolve, check ~/.claude/skills and the skillOverrides
block in ~/.claude/settings.json before assuming the skill is missing.
graphify
This project has a knowledge graph at graphify-out/ with god nodes, community structure, and cross-file relationships.
Rules:
- For codebase questions, first run
graphify query "<question>"when graphify-out/graph.json exists. Usegraphify path "<A>" "<B>"for relationships andgraphify explain "<concept>"for focused concepts. These return a scoped subgraph, usually much smaller than GRAPH_REPORT.md or raw grep output. - If graphify-out/wiki/index.md exists, use it for broad navigation instead of raw source browsing.
- Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context.
- After modifying code, run
graphify update .to keep the graph current (AST-only, no API cost).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

