# robrain

Stores engineering decisions and rejected alternatives in Postgres. Prevents coding agents from repeating approaches your team already dismissed.

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

## What it does

The server monitors workspace sessions and extracts architectural decisions directly into Postgres. Records store the selected direction alongside a dedicated `rejected[]` field for discarded options. When an agent starts work in a new session, it pulls this background context and halts before proposing a dismissed pattern.

The pipeline uses two core parts: Perception extracts structured entries, while Synthesis performs batch checks across the whole database. Running `npx robrain synth` flags conflicts. You can also trace past reasoning for an individual file with `npx robrain explain <path>`.

Without an active Perception instance and valid `PERCEPTION_API_KEY` and `PERCEPTION_API_URL` values, the server cannot process queries. Self-hosting requires Docker for Postgres and API keys for both Anthropic and OpenAI under the default configuration.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `PERCEPTION_API_URL`, `PERCEPTION_API_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 PERCEPTION_API_URL=<PERCEPTION_API_URL> --env PERCEPTION_API_KEY=<PERCEPTION_API_KEY> --transport stdio robrain -- npx -y robrain
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add robrain --env PERCEPTION_API_URL=<PERCEPTION_API_URL> --env PERCEPTION_API_KEY=<PERCEPTION_API_KEY> -- npx -y robrain
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "robrain": {
            "command": "npx",
            "args": [
                "-y",
                "robrain"
            ],
            "env": {
                "PERCEPTION_API_URL": "<PERCEPTION_API_URL>",
                "PERCEPTION_API_KEY": "<PERCEPTION_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "robrain": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "robrain"
            ],
            "env": {
                "PERCEPTION_API_URL": "<PERCEPTION_API_URL>",
                "PERCEPTION_API_KEY": "<PERCEPTION_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e PERCEPTION_API_URL=<PERCEPTION_API_URL> -e PERCEPTION_API_KEY=<PERCEPTION_API_KEY> robrain npx -y robrain
```
Replace <…> with your own values

## When to use it
- prevent coding agents from proposing previously rejected design decisions
- share architectural context across different teammates and editors
- detect contradictory technical positions across sessions via `synth`
- inspect why a specific file was modified using `explain`

## Example prompts
- Why did we decide against using Express for this microservice?
- Check our recorded decisions before modifying the database migration.
- List the alternative approaches we ruled out for user authentication.

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