Skip to main content
Glama

markdown-hierarchical-memory

An implementation of markdown-hierarchical-memory-spec.md v1.

  • MCP server (src/mdmem/): The mechanical execution layer providing file read/write, frontmatter management, a wikilink graph, keyword search with graph expansion, optimistic concurrency control (§16), bidirectional link consistency checks (§12), and a change log (§10/§17). Semantic judgments such as cohesion and importance (§9) are not implemented.

  • Claude Code subagent (.claude/agents/memory-manager.md): The Manager Agent defined in §10 of the specification. This is the component that makes semantic judgments by calling MCP tools.

Scope

  • Of the features in §15, only link graph + keyword search is supported (embedding vector search is not implemented. It can be added by replacing _score in src/mdmem/search.py).

  • The Manager Agent's decision-making logic does not make LLM calls internally within the server. The caller (Claude Code) is expected to make the decisions and pass the results as parameters to tool calls.

Related MCP server: auxly-memory-cli

Setup

pip install -e .
python -m pytest tests/

Registering with Claude Code

Copy .mcp.json.example to .mcp.json and replace <ABSOLUTE_PATH_TO_THIS_REPO> with the absolute path to this repository (.mcp.json is excluded by .gitignore because it contains a personal local path):

cp .mcp.json.example .mcp.json
# Edit .mcp.json and fill in the path

After restarting Claude Code (or reloading the MCP configuration), the mdmem server will be enabled, and the memory-manager subagent in .claude/agents/memory-manager.md will be able to call the mcp__mdmem__* tool set.

claude mcp list

This command can be used to verify that mdmem is recognized.

Registering with Cursor

After restarting Cursor (or reloading mdmem in Settings → Tools & MCP), you can share and use the same memory/ directory with Claude Code.

Directory Structure

memory/
 ├── index.md          # Pure registry (§14)
 ├── projects/
 ├── concepts/
 └── archive/
      └── _manager_log.md   # Change log (§10/§17)

The actual path of memory/ can be changed with the MDMEM_ROOT environment variable (default: memory/ in the current directory).

Main MCP Tools

Tool

Corresponding specification

get_index / list_memory_files / read_memory_file / search_memory / get_links

§14, §15, §11 (access_count)

create_memory_file

§3, §14

append_to_memory_file

§4 Step1, §16

link_memory_files

§12 (executes bidirectional linking as a single operation, with self-checking)

split_memory_file

§9/§10 splitting

summarize_and_archive_memory_file

§5/§9/§13 summarize and archive

move_to_archive

§13 forgetting model (content unchanged)

check_archive_candidates

§13 (suggestions only; does not execute them. §11)

get_change_log

§10/§17

All write tools accept expected_updated and return ConflictError if it differs from the value observed during reading (§16).

Known Limitations

  • Narrow race condition in concurrent writes: Optimistic locking with expected_updated only guarantees the sequence of "read, then validate, then write" within a single process. When Cursor and Claude Code share the same MDMEM_ROOT (a situation actually observed during development of this repository), there is a theoretical possibility that two processes read the same file at nearly the same time, both pass the check, and one update overwrites the other. This is not critical, but it is not a problem when writes are performed by a single process only.

  • Embedding vector search is not implemented (see the Scope section).

  • id only accepts ^[A-Za-z0-9_-]+$ (because it is used directly in file paths).

License

MIT

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Local-first, file-based memory layer for AI agents — one shared Markdown vault across Claude, Codex, Gemini, Cursor and any MCP client. Provides read/write memory tools with an audit trail, per-agent trust levels, and Git sync; no cloud and no lock-in.
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides persistent long-term memory for AI assistants with tag-based retrieval, wiki-style linking, and source references, storing memories as markdown files with SQLite index.
    1
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    A local-first, Markdown-native AI agent layered memory system that provides MCP tools for storing, recalling, exporting, and importing memories with types like working, persona, and fact.

View all related MCP servers

Related MCP Connectors

  • Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.

  • Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.

  • Persistent docs and memory for AI agents — read, write, organize & search a shared workspace.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/masaki-kato-119/markdown-hierarchical-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server