# myco-brain

Keeps a shared memory for your agents in your own Postgres. Each fact carries its source, and a newer value replaces the old one without erasing it.

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

## What it does

Myco Brain runs on top of a Postgres database with pgvector. The installer looks for one on your machine or brings one up in Docker, and you can also hand it a connection string for Supabase, Neon, RDS or a self-hosted instance by reference, so the string stays out of your command history. Node.js 20 or later is required.

In Claude and Codex the memory works through hooks: they pull relevant facts at session start and before each prompt, while a background worker reads the finished session and files what is worth keeping. Cursor, Windsurf and Claude Desktop have no hooks, so the server exposes two tools there, `brain_memory_context` and `brain_memory_write`. Clients are separated into houses, and a contractor's agent sees one client only. Every tool holds its own credential, so you can revoke one without disturbing the rest.

No API keys are involved: the worker reads sessions through the `claude` or `codex` CLI you are already signed in to. Ollama handles local embeddings when it is present; without it, recall matches the words in your prompt, which covers names, places and numbers. Dream mode is off and only proposes merging duplicates — nothing changes until you approve. Run `mycobrain-doctor --memory` to check the setup.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add myco-brain -- npx -y @mycobrain/mcp-server
```

### Codex

**Platform CLI**
```bash
codex mcp add myco-brain -- npx -y @mycobrain/mcp-server
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "myco-brain": {
            "command": "npx",
            "args": [
                "-y",
                "@mycobrain/mcp-server"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "myco-brain": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@mycobrain/mcp-server"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add myco-brain npx -y @mycobrain/mcp-server
```

## When to use it
- give several agents one memory backed by your own Postgres
- keep the source of every fact and preserve its edit history
- keep one client's data away from another client's agent
- surface relevant facts at session start without searching by hand
- revoke access for a single tool while others keep working

## Example prompts
- Remember this: the Acme account moves to the new billing in January.
- Show me the history of the fact about the database schema.

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