# Myco Brain

> Myco Brain is an open-source MCP server for knowledge and memory. Shared, source-backed memory for AI agents on your own Postgres, with client boundaries. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/thegoodguysla/myco-brain
- **MCP Registry name:** io.github.thegoodguysla/myco-brain
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory), [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-11-23

## About

Myco Brain starts from a complaint about agent memory: letting a model maintain its own notes tends to produce duplicates and untraceable summaries. Here the model proposes and fixed rules decide what becomes a fact. Every fact records its source, and a changed fact supersedes the old one while the history stays viewable.

It targets people handling several clients, such as agencies. Clients are split into houses enforced in the database, and a contractor's agent can be bound to one client only, with a separate credential per tool so one can be revoked alone. In Claude Code and Codex, hooks recall relevant facts at session start and before prompts; Cursor, Windsurf and Claude Desktop get an MCP server with brain_memory_context and brain_memory_write.

An optional Docker document engine ingests documents, repos and chat exports, builds a knowledge graph and answers with cited sources through 13 MCP tools. Storage is your own Postgres with pgvector and Node.js 20 or later is required. Embeddings run locally with Ollama when available.

## Features

- **Source-backed facts:** Each fact records where it came from, traceable with brain_why.
- **Superseding history:** Changed facts replace old ones while keeping a history.
- **Client houses:** Database-enforced separation between clients.
- **Per-tool credentials:** See which tool wrote a fact and revoke one tool.
- **Automatic recall:** Hooks in Claude Code and Codex recall facts at session start.
- **Optional document engine:** Ingest repos and documents with a knowledge graph.

## Good for

- Give agents shared memory across sessions and tools
- Keep each agency client's facts isolated
- Trace an answer back to the document it came from
- Import chat history so an assistant knows you from day one

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add myco-brain -- npx -y @mycobrain/mcp-server
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add myco-brain -- npx -y @mycobrain/mcp-server
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.myco-brain]
command = "npx"
args = ["-y", "@mycobrain/mcp-server"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user myco-brain npx -- -y @mycobrain/mcp-server

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "myco-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@mycobrain/mcp-server"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 3 tools changes data; 2 names don't say. From the server's own tool labels and tool names; not verified by us.

- `brain_memory_context`: Recalls relevant facts for a task.
- `brain_memory_write` (name suggests: changes): Records a fact the agent learned.
- `brain_why`: Shows the sources behind a fact.

## FAQ

### Where is memory stored?

In your own Postgres with pgvector, local or any connection string such as Supabase, Neon or RDS.

### Does Myco Brain need API keys?

No. The README says the worker uses your signed-in Claude or Codex CLI, and local Ollama can supply embeddings.

### Is anything merged automatically?

The optional Dream feature is off by default, and nothing changes until you approve a proposal.

### What licence?

Apache-2.0, per the README.

### Is Myco Brain free?

Yes. Myco Brain is open source, so you can use and self-host it for free.

### How do I add Myco Brain to Claude Code?

Run this command in your terminal: claude mcp add myco-brain -- npx -y @mycobrain/mcp-server

### What are the best alternatives to Myco Brain?

The closest alternatives to Myco Brain are Codebase Memory, XERJ, Claude Code Ultimate Guide, Nautilus Compass Memory and Myco: Agent-First Cognitive Substrate.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.
- [Myco: Agent-First Cognitive Substrate](https://ai-powered.com/mcp/myco-agent-first-cognitive-substrate): Myco: Agent-First Cognitive Substrate is an open-source MCP server for knowledge and memory.
- [Source Library](https://ai-powered.com/mcp/source-library): Source Library is an open-source MCP server for knowledge and memory.
- [keepplain-plugin](https://ai-powered.com/mcp/keepplain-plugin): keepplain-plugin is a freemium MCP server for knowledge and memory.
- [Second Brain](https://ai-powered.com/mcp/second-brain-2): Second Brain is a freemium MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/myco-brain
