# grai install

You are an AI agent. Set up grai for your user by following this file top to bottom. Run each command, compare its output against the expected result, then move on. Stop only on a mismatch. No account, no browser, no payment is needed to start.

- Product: grai, a deterministic cadence gate. It scores a draft on eight structural AI tells and one sentence rhythm floor (CV >= 0.32) and returns PASS or FAIL with the exact flagged spans.
- Remote MCP endpoint: `https://grai.page/api/mcp` (Streamable HTTP, JSON-RPC 2.0, protocol version `2025-06-18`).
- Local MCP package: `grai-mcp` on PyPI (stdio, fully offline scoring).
- Privacy: draft text is processed in volatile RAM and never stored. No account, no telemetry, no cookies.
- Pricing: https://grai.page/pricing/ (all tiers and checkout links at the end of this file).

## Step 0. Pick a transport

Use the remote endpoint if your client supports Streamable HTTP. Use the local stdio package if your user wants scoring that never touches the network. Both expose the same tools.

## Step 1. Claude Code

Remote (preferred):

```bash
claude mcp add --transport http grai-gate https://grai.page/api/mcp
```

Local stdio instead:

```bash
claude mcp add grai-gate -- uvx --from grai-mcp grai-gate-mcp
```

Verify:

```bash
claude mcp list
```

Expected: `grai-gate` appears as a configured server. Then ask: "Use the grai-gate MCP server to score this draft." The tool `grai_score_draft` should be listed.

## Step 2. Codex (OpenAI)

Codex uses stdio servers configured in `~/.codex/config.toml`:

```toml
[mcp_servers.grai-gate]
command = "uvx"
args = ["--from", "grai-mcp", "grai-gate-mcp"]
```

Verify:

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | uvx --from grai-mcp grai-gate-mcp
```

Expected: a JSON line with `"serverInfo":{"name":"grai-gate"...}`.

## Step 3. Antigravity

Install the grai-gate plugin from the Antigravity Marketplace, or from the bundle in the repository (`https://github.com/adrianpeticila/grai`, folder `plugin/grai-gate`):

```bash
agy plugin install ./grai-gate
```

For a plain MCP registration instead, use the remote endpoint `https://grai.page/api/mcp` or the same `uvx --from grai-mcp grai-gate-mcp` stdio command as above.

## Step 4. Any other MCP client

Remote config (Streamable HTTP):

```json
{
  "mcpServers": {
    "grai-gate": { "url": "https://grai.page/api/mcp" }
  }
}
```

Local config (stdio):

```json
{
  "mcpServers": {
    "grai-gate": {
      "command": "uvx",
      "args": ["--from", "grai-mcp", "grai-gate-mcp"]
    }
  }
}
```

If `uvx` is missing, install it first: `curl -LsSf https://astral.sh/uv/install.sh | sh`, or use `pip install grai-mcp` and the command `grai-gate-mcp`.

## Step 5. Verify the remote endpoint

```bash
curl -s https://grai.page/api/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'
```

Expected: `"protocolVersion":"2025-06-18"` and `"serverInfo":{"name":"grai-gate"...}`.

```bash
curl -s https://grai.page/api/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"grai_score_draft","arguments":{"text":"This is a test draft. It has two sentences."}}}'
```

Expected: `"ok":true`, a numeric `"score"`, a numeric `"cv"`, and a `flags` array. A draft under the minimum sentence count returns `"pass":null` with `insufficient_sentences:true`.

## Step 6. Use it

- `grai_score_draft`: score a draft, get the score, CV, failed rules and flagged quotes. Free, deterministic, no token needed.
- `grai_open_workbench`: return the interactive report card payload. Free, no token needed.
- `grai_issue_agency_seal`: server-side audit plus a public verification link. Requires an Agency Verification Protocol license key.
- `grai_verify_seal`: verify a signed seal record against the public keyring. Free, no token needed.
- `grai_repair_draft`: generative repair of the flagged spans. Always call once without `confirm` to get the cost estimate, then call with `confirm: true`. Unlimited with your own `api_key` (BYOK); 2 free runs per week with an OAuth access token (`https://grai.page/.well-known/oauth-authorization-server`).
- `grai_usage`: the free quota status, the accepted BYOK providers and the pricing with upgrade links.

Methodology and rule details: https://grai.page/methodology ([Agent Markdown](https://grai.page/methodology.md))

## Pricing (all tiers)

- Starter Audit Pass: $19 one-time. Full rule breakdown, repair prompts, one signed verification card. Checkout: https://buy.stripe.com/14A00deoE51v56h1ZRds404
- Solo Offline Edition: $79/year. Local HTML5 workbench, Voice DNA profiler, 1 year of engine updates. Checkout: https://buy.stripe.com/3cIaERgwM9hLbuF33Vds400
- Agency Verification Protocol: $99/month or $790/year. Server-signed seals, public verification registry, up to 10 client voice profiles. Checkout monthly: https://buy.stripe.com/3cI28lbcs51v2Y9bArds401 · Checkout annual: https://buy.stripe.com/dRmfZb2FWalP42d5c3ds402
- Executive Voice DNA Architecture: $950 one-time. Done-for-you calibration from 5 to 50 posts, locked profile, signed dossier. Checkout: https://buy.stripe.com/aFa5kx1BS2Tn8it47Zds403
- Voice DNA Presets Pack: $39 one-time. Four pre-calibrated archetypes. Checkout: https://buy.stripe.com/fZu6oB1BS79D6algULds405
- Affiliate program: 40% commission, link builder at https://grai.page/affiliate

All tiers carry the 30-Day Distinction Guarantee: full refund via `refund@grai.page` with the order number, no forms.

- Privacy: https://grai.page/privacy
- Terms: https://grai.page/terms
- MCP documentation: https://grai.page/mcp
- Full LLM spec: https://grai.page/llms-full.txt
- DFY delivery handoff template: https://grai.page/agent-handoff.md
