# GrantAi Memory

A local memory layer for AI agents that keeps project knowledge, files, and session context available across tasks. It also supports shared memory between agents.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: solonai-com
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/solonai-com/grantai
- Updated: 2026-09-18
- HTML: https://affpapa.org/en/nevibecode/mcp/grantai-memory

## What it does

GrantAi Memory adds persistent local storage to an AI agent through MCP. It can keep knowledge, files, project state, code snippets, Git history, and session summaries, then retrieve stored material by its identifier instead of searching for approximate matches.

The server exposes tools such as `grantai_teach`, `grantai_infer`, `grantai_learn`, `grantai_project`, `grantai_git`, and `grantai_capture`. Agents connected to the same instance use one shared memory pool. Optional `speaker` and `from_agents` values provide attribution and filtering.

The Claude Code setup runs the Docker image and passes `GRANTAI_LICENSE_KEY` into it. Docker must be available for this command, and the placeholder must be replaced with the required key.

## Requirements
- Needs: Docker
- Environment variables: `GRANTAI_LICENSE_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env GRANTAI_LICENSE_KEY=<GRANTAI_LICENSE_KEY> --transport stdio grantai-memory -- docker run -i --rm -e GRANTAI_LICENSE_KEY ghcr.io/solonai-com/grantai-memory:1.8.5
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add grantai-memory --env GRANTAI_LICENSE_KEY=<GRANTAI_LICENSE_KEY> -- docker run -i --rm -e GRANTAI_LICENSE_KEY ghcr.io/solonai-com/grantai-memory:1.8.5
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "grantai-memory": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "GRANTAI_LICENSE_KEY",
                "ghcr.io/solonai-com/grantai-memory:1.8.5"
            ],
            "env": {
                "GRANTAI_LICENSE_KEY": "<GRANTAI_LICENSE_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "grantai-memory": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "GRANTAI_LICENSE_KEY",
                "ghcr.io/solonai-com/grantai-memory:1.8.5"
            ],
            "env": {
                "GRANTAI_LICENSE_KEY": "<GRANTAI_LICENSE_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GRANTAI_LICENSE_KEY=<GRANTAI_LICENSE_KEY> grantai-memory docker run -i --rm -e GRANTAI_LICENSE_KEY ghcr.io/solonai-com/grantai-memory:1.8.5
```
Replace <…> with your own values

## When to use it
- keep project context across agent sessions
- share stored knowledge between multiple agents
- import files and directories for later recall
- track project state and Git history
- save code snippets and session summaries

## Example prompts
- Store the API authentication rules in memory with `grantai_teach`.
- Import the `docs` directory for future tasks with `grantai_learn`.
- Retrieve the current project state with `grantai_project`.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
