Skip to main content

MCP server for semantic search over markdown vaults

Project description

You like Obsidian? Your LLM will love it too.

memex-md-mcp

MCP server for semantic search over markdown vaults. Hybrid FTS5 + embeddings search, wikilink graph traversal, and YAML frontmatter awareness (aliases, tags).

Quick Start

claude mcp add memex uvx memex-md-mcp@latest

Then ask Claude to help configure your vaults - it has mcp_info() which explains everything. Or manually edit your settings (see Configuration below).

What This Does

Memex gives Claude read access to your markdown vaults. It creates a local index at ~/.local/share/memex-md-mcp/memex.db containing:

  • Full-text search index (FTS5) for keyword matching
  • Embeddings (google/embeddinggemma-300m) for semantic similarity
  • Wikilink graph for backlink queries
  • Extracted frontmatter (aliases, tags)

On each query, memex checks file mtimes and re-indexes any changed files. First run on a large vault takes time to compute embeddings.

Writing to notes happens through Claude Code's normal file tools.

Configuration

Global vault (always available)

In ~/.claude/settings.json:

{
  "env": {
    "MEMEX_VAULTS": "/home/user/obsidian/knowledge"
  },
  "mcpServers": {
    "memex": {
      "command": "uvx",
      "args": ["memex-md-mcp@latest"]
    }
  }
}

Adding project-specific vaults

In your project's .mcp.json, use variable expansion to append to global vaults:

{
  "mcpServers": {
    "memex": {
      "command": "uvx",
      "args": ["memex-md-mcp@latest"],
      "env": {
        "MEMEX_VAULTS": "${MEMEX_VAULTS}:/home/user/projects/myproject/docs"
      }
    }
  }
}

This keeps your global vault active while adding project-specific ones.

Tools

search(query, vault?, limit=5, concise=False) finds notes using hybrid search. Works when you don't know exact note names.

search("terraform state locking issues")
search("architecture decisions for the auth system", vault="work")
search("preferences for error handling in this codebase")

explore(note_path, vault, concise=False) shows a note's neighborhood: outlinks (what it references), backlinks (what references it), and semantically similar notes that aren't yet linked.

explore("architecture/api-design.md", "work")

mcp_info() returns this README.

TODO replace slop workflow example with my actual workflow:

Example Workflow

Template for integrating memex into your project's CLAUDE.md instructions:

## Knowledge Base (memex MCP)

This project uses memex for persistent knowledge across sessions. The vault contains architecture decisions, debugging learnings, and context that survives agent handovers.

### When to Search

Before starting significant work, search for relevant prior knowledge:

- search("authentication patterns") - architecture decisions
- search("docker networking issues") - past debugging learnings
- search("gradient descent variants") - conceptual knowledge

The search uses both keywords AND semantic similarity, so you don't need exact note names.

If you find a relevant note, use explore() to see its neighborhood - what links to it, what it links to, and semantically similar notes.

### Handover Workflow

Plan files are your working memory that survives context exhaustion.

**During work:**
1. Create/update plan file continuously as you work
2. Capture: current state, decisions made, next steps, dead ends
3. The plan file should always reflect "where am I right now"

**When context runs low:**
1. Your plan file already has everything important (you've been updating it)
2. No panic - the next agent reads plan + searches vault and continues

**After feature completion:**
1. Distill learnings: What worked? What didn't? What should future agents know?
2. Update vault with permanent knowledge
3. Plan files can be archived or deleted - they're ephemeral

### What Goes Where

- **Current task state, decisions, next steps** → Plan file (ephemeral)
- **Code conventions, project-specific rules** → CLAUDE.md
- **Architecture decisions, patterns, tech debt** → Architecture doc in vault
- **Debugging learnings, gotchas** → Notes in vault
- **General knowledge about tools/libraries** → Notes in vault  

### Note Writing Guidelines

- **Atomic notes**: One concept per note when possible
- **Descriptive titles**: `runpod-cli-gotchas.md` not `notes-2024-12.md`
- **Update over duplicate**: Search first, update existing notes rather than creating duplicates
- **Link related notes**: Use [[wikilinks]] to connect related concepts

Development

uv sync
make check   # ruff + ty
make test    # pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memex_md_mcp-0.2.3.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memex_md_mcp-0.2.3-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file memex_md_mcp-0.2.3.tar.gz.

File metadata

  • Download URL: memex_md_mcp-0.2.3.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for memex_md_mcp-0.2.3.tar.gz
Algorithm Hash digest
SHA256 a8bb524d1343c8c804f36179e85a0f8aaa5876c12257e6749094e1e578a0f3f9
MD5 7d7e506254e4a2f18554476eae6bfd92
BLAKE2b-256 eee292d339030334e9332f79b497925aea35b0dea09fdadaa70242a42b8110b1

See more details on using hashes here.

File details

Details for the file memex_md_mcp-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: memex_md_mcp-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for memex_md_mcp-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a841ffe21576b55ab54ace40fa0b3036e1cba3b8f39b9482af468f0ab13d8117
MD5 6f415a2c8808aaba68c364ba3db74c7c
BLAKE2b-256 dcc22f796e0a19fceff835ddd5465b8250fa13d7cdabb3deb32be1f040088b7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page