# mengram

Keeps facts, past sessions and learned workflows across agent runs, so a coding session survives /clear and auto-compaction.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 204
- Author: alibaizhanov
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/alibaizhanov/mengram
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/mengram

## What it does

The server splits memory into three kinds: semantic facts about you and the repo, episodic records of earlier sessions, and procedures that get refined when a step failed. You can search them, ask a question and get a synthesized answer with citations, or list episodes and workflows. Queries work in Russian, Spanish or Chinese as well, because retrieval runs on multilingual embeddings with rerank.

In Claude the plugin wires hooks plus a skill. Session start loads your profile, each prompt triggers a recall search, and the reply is followed by a background save. A policy gate can stop a risky Bash command when it matches a procedure with a poor track record. Hook installers also exist for Codex and Cursor. Cursor has no per-prompt context hook, so recall mid-conversation goes through the MCP tools; session start and compaction stay automatic.

An API key from mengram.io is required. Store it once in `~/.mengram/config.json` or hand it to the SDK constructor after `pip install mengram-ai` or `npm install mengram-ai`. Every fact carries the host and timestamp that wrote it, so a filesystem path learned on macOS stays out of a Linux session. No key, no memory: the server rejects the connection.

## Requirements
- Remote server: `https://mengram.io/mcp`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http mengram https://mengram.io/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add mengram --url https://mengram.io/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mengram": {
            "url": "https://mengram.io/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mengram": {
            "type": "http",
            "url": "https://mengram.io/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http mengram https://mengram.io/mcp
```

## When to use it
- keep project context between agent sessions
- restore working state after `/clear` and auto-compaction
- pick up an unfinished task on a repo branch
- pull a fact out of earlier conversations by query
- share one memory across Codex and Cursor

## Example prompts
- Install Mengram following https://mengram.io/agent-install.txt, my email is you@example.com
- Give me back the working context from the last session on this branch
- Search my memory for how deploys are set up in this repo

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

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