Skip to main content
Glama
README.md
# company-brain-mcp

MCP server exposing the Company Brain (Supabase GraphRAG knowledge store) to AI agents.

Runs three transports simultaneously:

- **Streamable HTTP** (`POST /mcp`) — Claude web (claude.ai) and Claude Code HTTP entries
- **Legacy SSE** (`GET /sse` + `POST /messages`) — n8n `mcpClientTool` (v2.15)
- **stdio** (`dist/index.js`) — local Claude Code via `.mcp.json`

## Tools (16)

Account-centric:
- `get_account_summary`
- `list_account_meetings`
- `get_account_facts`
- `get_account_health_signals`
- `get_account_context_graph`
- `find_accounts_by_tag`
- `find_similar_accounts`
- `find_similar_accounts_by_description`

Retrieval / graph:
- `search_meeting_chunks` (hybrid HNSW + FTS + tag)
- `search_people`
- `get_meeting_transcript`
- `get_person_meetings`
- `get_org_hierarchy`
- `query_tag_trends`
- `search_product_docs`
- `search_call_log` (RingCentral calls by phone/person/direction)

## Setup

```bash
npm install
npm run build
```

## Environment

Create `/etc/brain-mcp/env` (chmod 600) or an `.env`:

```
SUPABASE_URL=https://<project>.supabase.co
SUPABASE_SERVICE_ROLE_KEY=<service role key>
GEMINI_API_KEY=<gemini key>
MCP_API_KEY=<openssl rand -hex 32>
MCP_PORT=3100
ALLOWED_ORIGINS=https://claude.ai,https://<n8n-host>
GOFLEET_ORG_ID=<org uuid>
```

> `brain` must be listed in Supabase Dashboard → Settings → API → Exposed Schemas.

## Run

```bash
npm run start        # stdio (local Claude Code)
npm run start:http   # HTTP + SSE server on MCP_PORT
```

Production (PM2):

```bash
pm2 start ecosystem.config.cjs
pm2 save && pm2 startup
```