memex
Keeps a structured log of every Claude Code session and provides it as context at the start of the next session, using local SQLite.
README
memex
Every Claude Code session starts without knowing what you built last time - which files you changed, what decisions you made, what broke. You re-explain. Claude re-reads. You start over.
memex keeps a structured log of every session. Claude reads it at the start of the next one.
No cloud. No LLM extraction. No cost per save. Just local SQLite and one command to install.
Install
# with uv
uvx mcp-memex install
# with pip
pip install mcp-memex
memex install
Restart Claude Code. That's it.
What gets saved
Each entry has structure - not a blob of text:
mem_save(
task="Replaced JWT auth with session cookies",
files=["src/auth.py", "src/middleware.py"],
decisions=["Session cookies over JWT - simpler, no token refresh needed"],
warnings=["Redis required - app won't start without REDIS_URL set"],
tags=["auth", "sessions"]
)
Claude calls mem_save when it finishes something meaningful. You can also just tell it: "save what we just did."
What Claude sees at session start
=== memex: session context (db: my_project.db) ===
--- Recent (2) ---
[1] #4 - 2026-06-14T10:32
Task : Replaced JWT auth with session cookies
Files : src/auth.py, src/middleware.py
Decision : Session cookies over JWT - simpler, no token refresh needed
Warning : Redis required - app won't start without REDIS_URL set
Tags : auth, sessions
[2] #3 - 2026-06-13T15:10
Task : Added rate limiting to /api/login
Files : src/middleware.py
Warning : Rate limiter is in-memory per process - resets on restart
Tags : auth, rate-limiting
Claude calls mem_load automatically at the start of every session. It returns the most recent entries plus any entries that match what you're working on - by keyword and by file path.
Browse from the terminal
You don't need to be inside Claude to look at your history:
memex status # entry count, DB size, top tags
memex list # recent entries for this project
memex list --tag auth # filter by tag
memex list --since 7d # entries from the last 7 days
memex list --since 2026-06-01 --until 2026-06-15 # date range
memex search "rate limit" # full-text search
memex version # print installed version
Export to markdown
Turn your history into portable, human-browsable notes - one .md file per
entry, with [[wikilinks]] connecting related entries and files, plus tags as
#hashtags. Works in Obsidian or any tool that understands [[links]]:
memex export ./my-project-notes/
Entries that share a tag or a touched file are cross-linked under a Related section, so you can navigate your project history as a graph.
Six MCP tools
| Tool | What it does |
|---|---|
mem_load |
Called at session start - returns recent + relevant entries |
mem_save |
Saves a structured entry after meaningful work |
mem_update |
Patches specific fields of an existing entry (keeps id and timestamp) |
mem_search |
Full-text search across all entries |
mem_list |
Lists entries, optionally filtered by tag |
mem_delete |
Removes a stale entry by id |
Why not just CLAUDE.md?
CLAUDE.md is for static project documentation - architecture, conventions, how to run tests. It doesn't change much and it isn't session-aware.
memex captures what's changing session to session: what you built yesterday, the decision you made this morning, the warning you discovered an hour ago. It's the difference between "here's the project" and "here's what happened last time."
memex install writes Claude's instructions into .claude/CLAUDE.local.md - a file Claude Code loads automatically without touching your project's own CLAUDE.md.
Memory is scoped per project
Each project gets its own SQLite database at ~/.memex/<project>.db based on the working directory. Sessions from different projects never mix.
Configuration
Set these in the MCP env block in ~/.claude.json if you need to override defaults:
| Variable | Default | Description |
|---|---|---|
MEMEX_DIR |
~/.memex |
Where DBs are stored |
MEMEX_GLOBAL |
0 |
Set to 1 to share one DB across all projects |
MEMEX_RECENT |
5 |
Max recent entries loaded per session |
MEMEX_MATCHED |
5 |
Max FTS-matched entries loaded per session |
Uninstall
memex remove
pip uninstall mcp-memex
Memory DBs are kept at ~/.memex/ - delete that directory manually if you want to wipe everything.
Requirements
- Python 3.10+
mcppackage (installed automatically)- SQLite with FTS5 (standard since Python 3.8)
- Claude Code CLI
License
MIT
<!-- mcp-name: io.github.pragneshbagary/memex -->
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。