Memshelf MCP
Offload agent memory to a git-backed shelf and recall one section at a time
Memshelf MCP is an MCP server for knowledge and memory. It runs locally on your machine and is started by your AI client.
- Platforms
- CLI, Self-hosted
- Runs
- Locally
- Version
- 0.4.0
- Listing updated
Similar MCP servers
Install
Run in a terminal
claude mcp add memshelf-mcp -- uvx memshelf-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"memshelf-mcp": {
"command": "uvx",
"args": [
"memshelf-mcp"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"memshelf-mcp": {
"command": "uvx",
"args": [
"memshelf-mcp"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"memshelf-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"memshelf-mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"memshelf-mcp": {
"command": "uvx",
"args": [
"memshelf-mcp"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"memshelf-mcp": {
"command": "uvx",
"args": [
"memshelf-mcp"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
About Memshelf MCP
Long coding sessions pile up history that costs tokens and then vanishes in auto-compaction. memshelf moves finished topics, research dumps and bulky tool output into Markdown episodes on a local git repository (no remote by default), each with a validated digest of decisions, rejected alternatives, artefacts and open threads. The agent keeps only a small INDEX.md plus digests in context and fetches exact sections when needed.
The project reports figures from a week of its own use: 34 episodes, about 8.6K tokens of standing cost against roughly 1.9M tokens of shelved material, and a fresh agent answering 5 of 5 recall tests from the index alone. It adds that tokens are counted as characters divided by four, so ratios hold better than absolute numbers. The same shelf has been read and written by both Claude Code and Gemini CLI.
It is distributed on PyPI, as a Claude Desktop extension, and as a Claude Code plugin with a shelve skill and session hooks. A shell CLI exposes the same loop without MCP.
Tools this server provides (14)
Taken from the project documentation; the running server may differ.
- memshelf_init
- Create a shelf
- memshelf_import
- Import existing material
- memshelf_shelve
- Save a topic as an episode
- memshelf_lint_digest
- Validate an episode digest
- memshelf_recall
- Fetch an exact section of an episode
- memshelf_index
- Show the shelf index
- memshelf_search
- Search the shelf
- memshelf_stats
- Show claimed and realised savings
- memshelf_advise
- Advise what to shelve
- memshelf_rebuild
- Rebuild the index from episodes
- memshelf_rollup
- Roll episodes up
- memshelf_purge
- Remove episodes
- memshelf_resolve
- Resolve an episode reference
- memshelf_doctor
- Check shelf integrity
What it does
- Episode shelving
- Saves closed topics as Markdown episodes in a local git repo.
- Validated digests
- Rejects weak digests and prints the exact fix.
- Section recall
- Fetches one section instead of whole histories.
- Small standing index
- Only INDEX.md and digests stay in context.
- Vendor portable
- Shelf read and written by Claude Code and Gemini CLI.
- Several install routes
- uvx, pip, Desktop extension or Claude Code plugin.
Good for
- Keeping decisions from a long session after compaction
- Carrying project memory between different AI clients
- Auditing what an agent remembers with grep and diff
- Cutting standing token cost in long agent runs
Memshelf MCP FAQ
Where is the memory stored?
On a local git repository you control, with no remote configured by default.
How do I install Memshelf MCP?
claude mcp add memshelf -- uvx memshelf-mcp, or pip install memshelf-mcp.
Does Memshelf MCP work with other agents?
The project reports cross-use by Claude Code and Gemini CLI.
Are the savings guaranteed?
The numbers come from the author's own dogfooding and use a characters-divided-by-four estimate.
How do I add Memshelf MCP to Claude Code?
Run this command in your terminal: claude mcp add memshelf-mcp -- uvx memshelf-mcp
What are the best alternatives to Memshelf MCP?
The closest alternatives to Memshelf MCP are Compound Memory, memgit, Memoria, Memtomem and Remem.
Where this comes from
- Description: written from the project's README and the project's website.
- Install steps: from the official MCP Registry entry.