gsc-burvis
by comcreate-io
README.md
# gsc-burvis
A self-hostable MCP server that gives AI assistants direct, analysed access to your search data.
gsc-burvis connects to Google Search Console and stores each property's history in its own warehouse, so every query runs against your data rather than a quota-limited API call. The statistics run on the server: change points, anomalies, forecasts, cannibalisation and decay. Claude, ChatGPT, Cursor, Codex and Gemini receive finished answers with their provenance, not raw rows to sum. GA4, Bing, Yandex, Merchant Center and Google Ads follow in later milestones.
It runs on your own machine or server with your own Google Cloud OAuth client. There are no accounts, billing or telemetry outside your own instance.
> **Status:** milestone M0, the foundation. It covers Google sign-in, workspaces, the OAuth 2.1 server for MCP clients, API keys, Search Console ingest and the first tools (`list_sites`, `get_account_info`). The analysis tools arrive in later milestones.
## Architecture
```
MCP clients (Claude Code, Claude app, ChatGPT, Cursor, ...)
│ Streamable HTTP + OAuth 2.1 / API key
▼
┌─────────────── Cloudflare Tunnel or Caddy (TLS) ───────────────┐
│ │
│ app-web MCP endpoints, OAuth server, sign-in, web UI │
│ app-worker scheduled ingest: backfill, nightly, top-ups │
│ (one image, two roles) │
│ │ │ │
│ Postgres 16 ClickHouse │
│ users, workspaces, encrypted Search Console facts │
│ connections, keys, audit log per grain, 16 months+ │
└──────────────────────────────────────────────────────────────────┘
one docker compose project
```
- **app-web** serves the MCP endpoints, the OAuth 2.1 authorisation server (with dynamic client registration and PKCE) and the small web UI for connections and API keys. It applies database migrations when it starts.
- **app-worker** pulls Search Console data on a schedule. A new property is backfilled for the full history Google still holds, about 16 months. Recent days are re-pulled until Google marks them final.
- **Postgres** holds the application state. Google refresh tokens are encrypted at rest with a key that only you hold.
- **ClickHouse** holds the fact tables. Because the warehouse keeps rows past Google's 16-month limit, its history becomes irreplaceable after the first year, so back it up (see below).
## Quickstart
Requirements: Docker with Compose v2.24 or newer (Docker Desktop, OrbStack or Docker Engine) on linux/amd64 or arm64, and a Google Cloud OAuth client ([walkthrough](docs/self-host.md#1-create-the-google-oauth-client)).
```sh
git clone https://github.com/comcreate-io/gsc-burvis.git
cd gsc-burvis
cp deploy/.env.example deploy/.env
# Generate secrets and paste them into deploy/.env
python3 -c "import base64, os; print(base64.urlsafe_b64encode(os.urandom(32)).decode())" # BURVIS_ENCRYPTION_KEY
openssl rand -hex 32 # BURVIS_SESSION_SECRET
openssl rand -hex 24 # POSTGRES_PASSWORD
openssl rand -hex 24 # CLICKHOUSE_PASSWORD
# Add GOOGLE_OAUTH_CLIENT_ID / GOOGLE_OAUTH_CLIENT_SECRET, set BURVIS_BASE_URL
# and BURVIS_ALLOWED_EMAILS (who may sign in), then:
docker compose -f deploy/compose.yaml up -d --build
docker compose -f deploy/compose.yaml ps
curl -fsS http://127.0.0.1:8000/health
```
Compose refuses to start while `BURVIS_SESSION_SECRET`, `BURVIS_ENCRYPTION_KEY` or either database password is empty.
Open `BURVIS_BASE_URL` in a browser, sign in with Google, and connect your Search Console properties. The worker starts the backfill on its own.
Set `BURVIS_ALLOWED_EMAILS` (comma-separated emails or domains) before the server is reachable from the internet. It applies from the very first sign-in: only a listed account can create the default workspace and become its owner, and only listed accounts can join it afterwards.
The stack listens only on `127.0.0.1`. To reach it from Claude's cloud apps you need a public HTTPS address:
| Where it runs | Public entry | Command |
|---|---|---|
| Home or office machine (for example a Mac mini) | Cloudflare Tunnel, no open ports | `docker compose -f deploy/compose.yaml --profile tunnel up -d` |
| VPS with a public IP | Caddy with automatic Let's Encrypt | `docker compose -f deploy/compose.yaml --profile caddy up -d` |
| Your laptop, Claude Code only | none | `docker compose -f deploy/compose.yaml up -d` |
The full step-by-step guide, including the Google Cloud setup, is in [`docs/self-host.md`](docs/self-host.md).
## MCP endpoints
| Path | What it serves |
|---|---|
| `/mcp` | The full tool set |
| `/mcp/core` | A smaller core set for clients that cap how many tools they load |
| `/mcp/rank-checker` (alias `/mcp/rank`) | The rank-checking tools, plus the two workspace discovery tools `list_sites` and `get_account_info` |
All of them use Streamable HTTP. Clients authenticate with either:
- **OAuth 2.1.** The client discovers the authorisation server from the endpoint (RFC 9728 and RFC 8414 metadata), registers itself (RFC 7591) and sends you to a consent page. Read access maps to `mcp:read`. Ticking "allow changes" adds `mcp:write`.
- **An API key.** Create one in the web UI. It is shown once and starts with `burvis_live_`. Keys are either read-only or read and write, and you can revoke them at any time.
### Claude Code
```sh
# OAuth: Claude Code opens the browser to sign in on first use
claude mcp add --transport http burvis https://mcp.example.com/mcp
# Or with an API key
claude mcp add --transport http burvis https://mcp.example.com/mcp \
--header "Authorization: Bearer burvis_live_xxxxxxxxxxxxxxxx"
```
When Claude Code and the server share a machine, `http://localhost:8000/mcp` works too. In that case set `BURVIS_BASE_URL=http://localhost:8000`.
### Claude app (claude.ai, desktop, mobile)
Open **Settings → Connectors → Add custom connector** and enter `https://mcp.example.com/mcp`. For the OAuth client, choose **Register automatically** (dynamic client registration) and leave the client ID and secret fields empty. gsc-burvis does not publish a fixed client identity; each connector registers its own client, then Claude opens the consent page. The Claude app calls your server from Anthropic's cloud, so the URL must be public HTTPS (through the tunnel or Caddy).
## Worker commands
The worker runs on its own schedule, but every job can also be started by hand inside the worker container:
```sh
dc() { docker compose -f deploy/compose.yaml "$@"; }
dc exec app-worker burvis-worker migrate # apply ClickHouse migrations
dc exec app-worker burvis-worker sync [--site sc-domain:example.com]
dc exec app-worker burvis-worker backfill --site sc-domain:example.com [--days N | --start-date YYYY-MM-DD --end-date YYYY-MM-DD]
dc exec app-worker burvis-worker verify --site sc-domain:example.com [--days N | --start-date YYYY-MM-DD --end-date YYYY-MM-DD] [--tolerance PCT]
```
`burvis-worker run` is the scheduler loop itself and already runs as the worker container's command, so do not start a second one with `exec`. `--workspace <slug>` picks the workspace when a property is connected in more than one. See [Backfill and warehouse verification](docs/self-host.md#8-backfill-and-warehouse-verification).
## Backups
`deploy/backup.sh` writes a Postgres dump and a ClickHouse backup every night into `deploy/backups/nightly/<date>/`, promotes Sundays to `weekly/`, and keeps 14 nightly and 8 weekly sets. Schedule it with cron or launchd, and keep a copy off the machine. Keep `BURVIS_ENCRYPTION_KEY` safe in a separate place: without it, the stored Google connections cannot be decrypted. See [Backups and restore](docs/self-host.md#7-backups-and-restore).
## Development
```sh
uv sync --extra dev
uv run pytest
uv run ruff check .
```
## License
The server is licensed under the [GNU Affero General Public License v3.0](LICENSE) (AGPL-3.0-only). You can run, modify and self-host it freely. If you offer a modified version to others over a network, you must publish your changes under the same license. Skill definitions under `skills/` that derive from MIT-licensed work keep their MIT license and attribution (see `skills/LICENSE-upstream`).
Copyright (C) 2026 ComCreate.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues