B

Brainllm

by miisodev · io.github.miisodev/brainllm

An MCP server that gives Claude and other MCP clients persistent, graph-structured memory by storing it in a self-hosted TriliumNext knowledge base, so sessions resume with context instead of starting from zero.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-miisodev-brainllm": {
      "command": "npx",
      "args": [
        "-y",
        "brainllm"
      ],
      "env": {
        "TRILIUM_BASE_URL": "<VALUE>",
        "TRILIUM_ETAPI_TOKEN": "<YOUR_VALUE>",
        "TRILIUM_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_MODE": "core",
        "BRAINLLM_TZ": "<VALUE>",
        "BRAINLLM_OWNER_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_OAUTH_SECRET": "<YOUR_VALUE>",
        "BRAINLLM_PUBLIC_URL": "<VALUE>",
        "BRAINLLM_ALLOW_UNAUTHENTICATED_HTTP": "<VALUE>",
        "BRAINLLM_TRUST_PROXY": "<VALUE>",
        "PORT": "<VALUE>",
        "MCP_AUTH_TOKEN": "<VALUE>",
        "BRAINLLM_CONFIG": "<VALUE>"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-miisodev-brainllm": {
      "command": "npx",
      "args": [
        "-y",
        "brainllm"
      ],
      "env": {
        "TRILIUM_BASE_URL": "<VALUE>",
        "TRILIUM_ETAPI_TOKEN": "<YOUR_VALUE>",
        "TRILIUM_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_MODE": "core",
        "BRAINLLM_TZ": "<VALUE>",
        "BRAINLLM_OWNER_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_OAUTH_SECRET": "<YOUR_VALUE>",
        "BRAINLLM_PUBLIC_URL": "<VALUE>",
        "BRAINLLM_ALLOW_UNAUTHENTICATED_HTTP": "<VALUE>",
        "BRAINLLM_TRUST_PROXY": "<VALUE>",
        "PORT": "<VALUE>",
        "MCP_AUTH_TOKEN": "<VALUE>",
        "BRAINLLM_CONFIG": "<VALUE>"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-miisodev-brainllm": {
      "command": "npx",
      "args": [
        "-y",
        "brainllm"
      ],
      "env": {
        "TRILIUM_BASE_URL": "<VALUE>",
        "TRILIUM_ETAPI_TOKEN": "<YOUR_VALUE>",
        "TRILIUM_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_MODE": "core",
        "BRAINLLM_TZ": "<VALUE>",
        "BRAINLLM_OWNER_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_OAUTH_SECRET": "<YOUR_VALUE>",
        "BRAINLLM_PUBLIC_URL": "<VALUE>",
        "BRAINLLM_ALLOW_UNAUTHENTICATED_HTTP": "<VALUE>",
        "BRAINLLM_TRUST_PROXY": "<VALUE>",
        "PORT": "<VALUE>",
        "MCP_AUTH_TOKEN": "<VALUE>",
        "BRAINLLM_CONFIG": "<VALUE>"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-miisodev-brainllm": {
      "command": "npx",
      "args": [
        "-y",
        "brainllm"
      ],
      "env": {
        "TRILIUM_BASE_URL": "<VALUE>",
        "TRILIUM_ETAPI_TOKEN": "<YOUR_VALUE>",
        "TRILIUM_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_MODE": "core",
        "BRAINLLM_TZ": "<VALUE>",
        "BRAINLLM_OWNER_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_OAUTH_SECRET": "<YOUR_VALUE>",
        "BRAINLLM_PUBLIC_URL": "<VALUE>",
        "BRAINLLM_ALLOW_UNAUTHENTICATED_HTTP": "<VALUE>",
        "BRAINLLM_TRUST_PROXY": "<VALUE>",
        "PORT": "<VALUE>",
        "MCP_AUTH_TOKEN": "<VALUE>",
        "BRAINLLM_CONFIG": "<VALUE>"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-miisodev-brainllm": {
      "command": "npx",
      "args": [
        "-y",
        "brainllm"
      ],
      "env": {
        "TRILIUM_BASE_URL": "<VALUE>",
        "TRILIUM_ETAPI_TOKEN": "<YOUR_VALUE>",
        "TRILIUM_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_MODE": "core",
        "BRAINLLM_TZ": "<VALUE>",
        "BRAINLLM_OWNER_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_OAUTH_SECRET": "<YOUR_VALUE>",
        "BRAINLLM_PUBLIC_URL": "<VALUE>",
        "BRAINLLM_ALLOW_UNAUTHENTICATED_HTTP": "<VALUE>",
        "BRAINLLM_TRUST_PROXY": "<VALUE>",
        "PORT": "<VALUE>",
        "MCP_AUTH_TOKEN": "<VALUE>",
        "BRAINLLM_CONFIG": "<VALUE>"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-miisodev-brainllm": {
      "command": "npx",
      "args": [
        "-y",
        "brainllm"
      ],
      "env": {
        "TRILIUM_BASE_URL": "<VALUE>",
        "TRILIUM_ETAPI_TOKEN": "<YOUR_VALUE>",
        "TRILIUM_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_MODE": "core",
        "BRAINLLM_TZ": "<VALUE>",
        "BRAINLLM_OWNER_PASSWORD": "<YOUR_VALUE>",
        "BRAINLLM_OAUTH_SECRET": "<YOUR_VALUE>",
        "BRAINLLM_PUBLIC_URL": "<VALUE>",
        "BRAINLLM_ALLOW_UNAUTHENTICATED_HTTP": "<VALUE>",
        "BRAINLLM_TRUST_PROXY": "<VALUE>",
        "PORT": "<VALUE>",
        "MCP_AUTH_TOKEN": "<VALUE>",
        "BRAINLLM_CONFIG": "<VALUE>"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
TRILIUM_BASE_URL Yes URL of the TriliumNext instance (local, or an HTTPS reverse-proxy/tunnel URL)
TRILIUM_ETAPI_TOKEN secret No ETAPI bearer token. Required unless TRILIUM_PASSWORD is set
TRILIUM_PASSWORD secret No Alternative to the token: BrainLLM mints one on first start and caches it beside brainllm.json, reusing it across restarts. Also used by `bun run init`
BRAINLLM_MODE No `core` (default) or `full` (adds the raw ETAPI surface) Default: core
BRAINLLM_TZ No IANA timezone (e.g. `Africa/Johannesburg`) so dates stamp in *your* day on hosted deploys; unset = host clock
BRAINLLM_OWNER_PASSWORD secret No Enables the OAuth 2.1 / CIMD endpoints, required for claude.ai. The password you type on the consent screen
BRAINLLM_OAUTH_SECRET secret No Optional 32+ character deployment secret for signing OAuth tokens; rotate it to invalidate old tokens.
BRAINLLM_PUBLIC_URL No Override the derived public origin when a proxy rewrites `Host`. Must match the URL you enter in the client exactly
BRAINLLM_ALLOW_UNAUTHENTICATED_HTTP No Explicit trusted-network-only escape hatch for HTTP mode. Never enable on a public interface.
BRAINLLM_TRUST_PROXY No Trust forwarded host/protocol headers for OAuth discovery only when a trusted reverse proxy sets them.
PORT No Presence switches to HTTP-connector mode
MCP_AUTH_TOKEN No Static bearer token accepted on `/mcp` — what Claude Code and `mcp-remote` send
BRAINLLM_CONFIG No Absolute file path for `brainllm.json` on persistent-volume deploys

Similar servers