melchizedek — Claude Code MCP server: search your past sessions
Indexes your Claude conversations and lets the agent search them: old errors, decisions, code snippets. Runs locally, no cloud, no API keys.
claude mcp add melchizedek -- npx -y melchizedekWhat melchizedek does
Melchizedek parses session transcripts from ~/.claude/projects/**/*.jsonl, splits them into request-response pairs, drops duplicates by SHA-256 and writes everything into one SQLite file in WAL mode, ~/.melchizedek/memory.db by default. A SessionEnd hook fires the indexing after each session. Skip the hooks and you index by hand, because the server itself only searches.
Retrieval has four layers, each optional. BM25 over FTS5 with stemming is always on. On top of that come vectors through sqlite-vec — MiniLM 384d for text, Jina 768d for code — then Reciprocal Rank Fusion to merge the result lists, then a cross-encoder reranker. The vector and reranker stages need @huggingface/transformers or node-llama-cpp. Leave them out and search still runs, just with fewer signals.
There are 16 tools. m9k_search returns short snippets and is the place to start; m9k_context and m9k_full pull adjacent chunks or whole ones. Separate tools cover a file (m9k_file_history), an error string (m9k_errors) and similar past work (m9k_similar_work). Hits from the current project score ×1.5 and the current session ×1.2. Tune it with m9k_config or the env vars M9K_DB_PATH, M9K_EMBEDDINGS, M9K_RERANKER, M9K_NO_DAEMON, M9K_LOG_LEVEL.
What it helps with
- recall how a similar error was fixed before
- find sessions that touched one specific file
- pull an architecture decision out of an older project
- save a note so it resurfaces next session
- keep a project out of the index
Example prompts for the agent
- Search my history for how we fixed this stack trace before
- Which past sessions edited
src/server.ts? - Save to memory: migrations in this project only run through
npm run db:migrate
How to install melchizedek
Platform CLI
claude mcp add melchizedek -- npx -y melchizedekPlatform CLI
codex mcp add melchizedek -- npx -y melchizedekConfig file
{
"mcpServers": {
"melchizedek": {
"command": "npx",
"args": [
"-y",
"melchizedek"
]
}
}
}Config file
{
"servers": {
"melchizedek": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"melchizedek"
]
}
}
}Platform CLI
gemini mcp add melchizedek npx -y melchizedekStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about melchizedek
How do I install melchizedek in Claude Code?
With npm: npm install -g melchizedek, then claude mcp add --scope user melchizedek -- melchizedek-server. To skip the install, run claude mcp add --scope user melchizedek -- npx melchizedek-server.
What does melchizedek do?
It indexes Claude session transcripts into a local database and exposes search over them through MCP: keyword, vector and reranked. Other projects are searchable too, not just the current one.
Does it need API keys or a cloud service?
No. Everything runs on your machine and the store is a single SQLite file. Vectors and the reranker are optional; BM25 alone keeps search working.