# Piia Engram

A local identity layer that lets several coding agents share your preferences, past decisions and project context. No cloud account involved.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 163
- Author: Patdolitse
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Patdolitse/piia-engram
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/piia-engram

## What it does

Piia Engram keeps your working preferences, quality bar, lessons from earlier tasks and project context as JSON and Markdown files under `~/.engram/`. Claude, Codex, Cursor and Windsurf all read the same store, so none of them has to ask again which framework you use or how you like your tests written.

The AI proposes entries; you decide what sticks. Anything risky — credentials, shell commands, MCP config, permission rules — sits in a queue until you approve it, while low and medium writes land automatically and stay reversible. Setting `ENGRAM_APPROVAL=strict` makes every write wait for you. Run `engram preview --html` to see the exact payload an agent would get, including what governance held back.

Setup starts with `pip install piia-engram && engram setup`. The wizard detects your installed tools, lists the config files it plans to touch and backs each one up before writing. Python 3.10 or newer is required. Decline at the confirmation step and nothing on disk changes.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `ENGRAM_MCP_STARTUP_SYNC`, `ENGRAM_TOOLS`, `PYTHONIOENCODING` — 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 ENGRAM_MCP_STARTUP_SYNC=<ENGRAM_MCP_STARTUP_SYNC> --env ENGRAM_TOOLS=<ENGRAM_TOOLS> --env PYTHONIOENCODING=<PYTHONIOENCODING> --transport stdio piia-engram -- uvx piia-engram
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from piia-engram <command>

### Codex

**Platform CLI**
```bash
codex mcp add piia-engram --env ENGRAM_MCP_STARTUP_SYNC=<ENGRAM_MCP_STARTUP_SYNC> --env ENGRAM_TOOLS=<ENGRAM_TOOLS> --env PYTHONIOENCODING=<PYTHONIOENCODING> -- uvx piia-engram
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from piia-engram <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "piia-engram": {
            "command": "uvx",
            "args": [
                "piia-engram"
            ],
            "env": {
                "ENGRAM_MCP_STARTUP_SYNC": "<ENGRAM_MCP_STARTUP_SYNC>",
                "ENGRAM_TOOLS": "<ENGRAM_TOOLS>",
                "PYTHONIOENCODING": "<PYTHONIOENCODING>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from piia-engram <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "piia-engram": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "piia-engram"
            ],
            "env": {
                "ENGRAM_MCP_STARTUP_SYNC": "<ENGRAM_MCP_STARTUP_SYNC>",
                "ENGRAM_TOOLS": "<ENGRAM_TOOLS>",
                "PYTHONIOENCODING": "<PYTHONIOENCODING>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from piia-engram <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e ENGRAM_MCP_STARTUP_SYNC=<ENGRAM_MCP_STARTUP_SYNC> -e ENGRAM_TOOLS=<ENGRAM_TOOLS> -e PYTHONIOENCODING=<PYTHONIOENCODING> piia-engram uvx piia-engram
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from piia-engram <command>

## When to use it
- carry one working profile across Claude and Codex
- inspect what an agent will receive before a task starts
- record a post-incident lesson so the agent applies it later
- hold credential and shell-command writes until you approve them
- point several editors at a single local context source

## Example prompts
- Refactor the auth module and load my Engram profile first
- Show me which knowledge about me piia-engram is exposing
- Save this decision to Engram: keep auth middleware out of business logic

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