Skip to main content
Glama
buildpredict-mcp

buildpredict-mcp

by MaazMedia
README.md
# buildpredict-mcp

Model Context Protocol server for **BuildPredict** — construction project risk analysis. This package is a thin client that calls the hosted BuildPredict REST API; it does not duplicate any business logic.

## Install

```bash
npm install -g buildpredict-mcp
```

Or run on demand with `npx buildpredict-mcp`.

## Configure

Set the following environment variables (required unless noted):

| Variable                  | Purpose                                                     |
|---------------------------|-------------------------------------------------------------|
| `BPIQ_API_URL`            | Base URL (default `https://buildpredict.vercel.app`)        |
| `BPIQ_SUPABASE_URL`       | Supabase project URL                                        |
| `BPIQ_SUPABASE_ANON_KEY`  | Supabase anon key                                           |
| `BPIQ_EMAIL`              | *(optional)* Auto-sign-in email                             |
| `BPIQ_PASSWORD`           | *(optional)* Auto-sign-in password                          |

### Claude Desktop

Add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "buildpredict": {
      "command": "npx",
      "args": ["-y", "buildpredict-mcp"],
      "env": {
        "BPIQ_API_URL": "https://buildpredict.vercel.app",
        "BPIQ_SUPABASE_URL": "https://YOUR-PROJECT.supabase.co",
        "BPIQ_SUPABASE_ANON_KEY": "eyJ..."
      }
    }
  }
}
```

## Tools

| Tool                      | Description                                                            |
|---------------------------|------------------------------------------------------------------------|
| `sign_in`                 | Sign in via Supabase (email + password). JWT held in memory.           |
| `sign_out`                | Clear the in-memory session.                                           |
| `whoami`                  | Report the active session.                                             |
| `analyze_risk`            | POST `/api/analyze-risk` → `{ markdown, sources }`.                    |
| `create_checkout_session` | POST `/api/create-checkout-session` (requires signed-in user).         |
| `verify_payment`          | POST `/api/verify-payment`.                                            |
| `stripe_webhook_info`     | Read-only: describes the webhook URL + expected events.                |

The server attaches the Supabase JWT as `Authorization: Bearer <token>` on every outbound call and transparently retries once after refreshing on a 401.

## Develop

```bash
npm install
npm run build      # tsc → dist/
npm run dev        # tsx src/index.ts (stdio)
npm start          # node dist/index.js
```

## License

MIT © 2026 Alexander / PresciaIQ