Skip to main content
Glama
Rev4nchist
by Rev4nchist
README.md
# Fourth Brain Demo

Notion-backed MCP server for Fourth's marketing knowledge base. Connects Claude.ai to curated marketing content via the Model Context Protocol.

## Quick Start

### 1. Set up Notion

1. Create a Notion Internal Integration at https://www.notion.so/my-integrations
2. Create a parent page and share it with the integration
3. Copy `.env.example` to `.env`, add your token and parent page ID
4. Populate the knowledge base:

```bash
pip install -r requirements.txt
python populate_notion.py --parent-page <page_id>
```

5. Copy the database IDs from the output into `.env`

### 2. Run locally

```bash
python server.py
```

Server starts at `http://localhost:8000/mcp`

### 3. Test with MCP Inspector

```bash
fastmcp dev server.py
```

### 4. Deploy to Railway

```bash
# Push to GitHub
git remote add origin https://github.com/Rev4nchist/fourth-brain-demo.git
git push -u origin main

# Railway auto-deploys from GitHub
# Set env vars in Railway dashboard
```

### 5. Connect Claude.ai

1. Go to Claude.ai > Settings > Integrations
2. Add Custom Connector: `https://your-app.up.railway.app/mcp`
3. Create a Project, upload skills files from `skills/`

## Architecture

```
Claude.ai  -->  MCP (Streamable HTTP)  -->  Notion API
                     |
              FastMCP Server
              - 5 tools (search, browse, get, ask, list)
              - 3 prompts (product_qa, rfp_draft, meeting_prep)
              - TTL cache (300s)
```

## Tools

| Tool | Description |
|------|-------------|
| `search_knowledge` | Search across all 6 knowledge databases |
| `browse_library` | Browse knowledge structure by area |
| `get_document` | Retrieve full page content |
| `ask_question` | RAG-style Q&A with confidence scoring |
| `list_content_areas` | List all knowledge domains |

## Knowledge Domains

| Domain | Content |
|--------|---------|
| Enterprise Platform | Platform overview, 5 pillars, modules, architecture |
| Value Propositions | Per-persona value props (CFO/COO/CHRO/CTO/CEO) |
| Integration Guide | 200+ integrations by category |
| Competitive Positioning | Battle cards, win/loss analysis |
| RFP Responses | Pre-drafted RFP answers |
| FAQ & Product Q&A | Common product questions |

## Environment Variables

See `.env.example` for all required variables.