# MemStack MCP server

> Provides a persistent memory pipeline for AI agents to store, retrieve, summarize, and prune interactions to maintain context without bloating token usage.

- Repository: https://github.com/isiomaC/memstack
- Page: https://hostedmcp.org/servers/isiomac/memstack
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 0.8.5

## Install

### Claude Code

```sh
claude mcp add memstack -- npx -y @memstack/mcp
```

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

```json
{
  "mcpServers": {
    "memstack": {
      "command": "npx",
      "args": [
        "-y",
        "@memstack/mcp"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "memstack": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@memstack/mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"memstack","type":"stdio","command":"npx","args":["-y","@memstack/mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "memstack": {
      "command": "npx",
      "args": [
        "-y",
        "@memstack/mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add memstack -- npx -y @memstack/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.memstack]
command = "npx"
args = ["-y", "@memstack/mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user memstack npx -- -y @memstack/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "memstack": {
      "command": "npx",
      "args": [
        "-y",
        "@memstack/mcp"
      ]
    }
  }
}
```

## FAQ

### How does MemStack help with LLM context windows?

It prevents the need to stuff everything into the context window by storing interactions, retrieving only what is relevant, and summarizing old memories to save tokens.

### Can MemStack be used with different LLM providers?

Yes, it is pluggable and supports various LLM adapters including OpenAI, DeepSeek, OpenRouter, Together AI, and Gemini.

### Does MemStack protect sensitive information?

Yes, it includes a pattern-based check that refuses to store memories containing credentials like private keys, passwords, or tokens.

### How does MemStack handle memory for coding agents like Claude Code?

It provides a shared memory per project, allowing different agents to recall decisions and conventions made in previous sessions.
