# Brainy MCP server

> Provides a shared knowledge base and task queue to enable safe collaboration and coordination between multiple AI agents.

- Repository: https://github.com/memokar/brainy
- Page: https://hostedmcp.org/servers/memokar/brainy
- Transport: remote
- Stars: 0
- License: AGPL-3.0
- Latest version: 0.2.0

## Install

### Claude Code

```sh
claude mcp add brainy -- docker run -i --rm ghcr.io/memokar/brainy:0.2.0
```

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

```json
{
  "mcpServers": {
    "brainy": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/memokar/brainy:0.2.0"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "brainy": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/memokar/brainy:0.2.0"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"brainy","type":"stdio","command":"docker","args":["run","-i","--rm","ghcr.io/memokar/brainy:0.2.0"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "brainy": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/memokar/brainy:0.2.0"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add brainy -- docker run -i --rm ghcr.io/memokar/brainy:0.2.0
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.brainy]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/memokar/brainy:0.2.0"]
```

### Gemini CLI

```sh
gemini mcp add -s user brainy docker -- run -i --rm ghcr.io/memokar/brainy:0.2.0
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "brainy": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/memokar/brainy:0.2.0"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `BRAINY_DB_PATH` | no | no |  |
| `BRAINY_KNOWLEDGE_ROOT` | no | no |  |
| `BRAINY_TOKEN` | no | no |  |
| `BRAINY_WEB_SESSION_KEY` | no | no |  |

## FAQ

### How does Brainy prevent multiple agents from working on the same task?

It uses atomic task claims with leases and claim tokens to ensure exactly one agent wins a task while others receive a conflict.

### Where is the knowledge stored?

Knowledge is stored as plain Markdown files within a Git repository, providing history and rollback capabilities.

### Can humans review changes made by AI agents?

Yes, agents can propose knowledge changes which a human can then approve or reject via a web UI or Telegram.

### Does Brainy require many dependencies to run?

No, it is built using the pure Python standard library and SQLite, resulting in a tiny attack surface.
