# Memshelf MCP

> Memshelf MCP is an MCP server for knowledge and memory. Offload agent memory to a git-backed shelf and recall one section at a time. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, Self-hosted
- **Website:** https://ignatenkofi.github.io/memshelf-mcp/
- **Repository:** https://github.com/ignatenkofi/memshelf-mcp
- **MCP Registry name:** io.github.ignatenkofi/memshelf-mcp
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-16

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
claude mcp add memshelf-mcp -- uvx memshelf-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "memshelf-mcp": {
      "command": "uvx",
      "args": [
        "memshelf-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "memshelf-mcp": {
      "command": "uvx",
      "args": [
        "memshelf-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "memshelf-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "memshelf-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "memshelf-mcp": {
      "command": "uvx",
      "args": [
        "memshelf-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "memshelf-mcp": {
      "command": "uvx",
      "args": [
        "memshelf-mcp"
      ]
    }
  }
}
```

## Tools

- `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

## 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.

## Alternatives

- [Compound Memory](https://ai-powered.com/mcp/compound-memory): Compound Memory is an open-source MCP server for knowledge and memory.
- [memgit](https://ai-powered.com/mcp/memgit): memgit is a freemium MCP server for knowledge and memory.
- [Memoria](https://ai-powered.com/mcp/memoria): Memoria is an open-source MCP server for knowledge and memory.
- [Memtomem](https://ai-powered.com/mcp/memtomem): Memtomem is an open-source MCP server for knowledge and memory.
- [Remem](https://ai-powered.com/mcp/remem): Remem is an open-source MCP server for knowledge and memory.
- [Mnemolith](https://ai-powered.com/mcp/mnemolith): Mnemolith is an open-source MCP server for knowledge and memory.
- [Memroot](https://ai-powered.com/mcp/memroot): Memroot is a freemium MCP server for knowledge and memory.
- [open-memex](https://ai-powered.com/mcp/open-memex): open-memex is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/memshelf-mcp
