> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rigaly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Connector (MCP)

> Manage your loyalty program by talking to Claude or ChatGPT

Rigaly ships a remote [MCP](https://modelcontextprotocol.io) server so you can run your loyalty program from an AI assistant — look up customers, issue points, validate reward codes, create promotions, and more, all in plain language.

```
MCP endpoint:  https://api.rigaly.com/mcp
```

## What the assistant can do

The connector exposes the same operations as the Business API, as \~46 tools:

| Area                 | Examples                                                                                                 |
| -------------------- | -------------------------------------------------------------------------------------------------------- |
| Customers            | "Look up [maria@example.com](mailto:maria@example.com) — how many points does she have?"                 |
| Points               | "Give Maria 500 points for today's purchase"                                                             |
| Redemptions          | "Validate code ABC123 and complete it"                                                                   |
| Rewards & promotions | "Create a 'Free coffee' reward for 1,000 points" (add artwork with a hosted [image URL](/guides/images)) |
| Raffles & levels     | "Start a raffle ending August 31st, 200 points per entry"                                                |
| Mass codes           | "How many codes from the Summer batch have been claimed?"                                                |
| Insights             | "Summarize my reviews this month" / "Show my at-risk customers"                                          |

Every tool that changes data is marked destructive, so your assistant asks for confirmation before acting.

## Connect from Claude

1. In Claude, open **Settings → Connectors → Add custom connector**.
2. Enter `https://api.rigaly.com/mcp` and follow the prompts.
3. Claude opens the Rigaly consent screen — sign in with your **business account** and review the requested access (`read` for viewing data, `write` for managing it).
4. Click **Approve**. You're connected — try *"What's my business info on Rigaly?"*

Access is scoped to your business only, and you can disconnect at any time from Claude's settings (or revoke from your dashboard by contacting support).

## Connect from other MCP clients

Any MCP client that supports **Streamable HTTP + OAuth 2.1** can connect the same way — the server publishes standard discovery metadata:

```
https://api.rigaly.com/.well-known/oauth-authorization-server
https://api.rigaly.com/.well-known/oauth-protected-resource/mcp
```

For development tools that pass headers directly (e.g. Claude Code, MCP Inspector, custom agents), you can skip OAuth and authenticate with a [Business API key](/authentication) instead:

```json theme={null}
{
  "mcpServers": {
    "rigaly": {
      "type": "http",
      "url": "https://api.rigaly.com/mcp",
      "headers": {
        "Authorization": "Bearer rgly_sk_YOUR_API_KEY"
      }
    }
  }
}
```

API-key connections always carry full read + write access.

### Let your coding agent set it up

Coding agents (Claude Code, Cursor, and similar) can configure the connection themselves — paste this prompt:

```text theme={null}
Add the Rigaly MCP server to this project. It's a remote MCP server
(Streamable HTTP) at https://api.rigaly.com/mcp, authenticated with the
header "Authorization: Bearer <API_KEY>". Ask me for my API key (it starts
with rgly_sk_) and keep it out of version control. When you're done, verify
the connection by calling the get_business_info tool.
```

<Warning>
  Only do this in tools you trust with your API key, and use a dedicated key you can revoke from **Dashboard → API** if needed.
</Warning>

## Create a reward with an image

Rewards, promotions, raffles, and levels all support images, and the connector can attach them. If you have a **hosted image** (your website, a CDN, a design tool's share link), one prompt does everything:

> "Create a 'Free smoothie' reward for 1,500 points and use this image: [https://mysite.com/images/smoothie.png](https://mysite.com/images/smoothie.png)"

The assistant creates the reward,

* **`read`** — view customers, balances, rewards, promotions, raffles, levels, reviews, transactions, devices, and code-batch stats.
* **`write`** — issue/deduct points, complete redemptions, and create/update/delete rewards, promotions, raffles, levels, code batches, and the review questionnaire.

If you grant only `read` at the consent screen, write tools politely refuse. On top of scopes, all Business API protections still apply: your assistant can only ever see your own business, all inputs are validated server-side, rate limits are enforced per connection, and points issued through the connector are billed exactly like PTS or API transactions.

<Note>
  Access tokens expire after 1 hour and refresh automatically. Revoking a connection immediately invalidates its tokens.
</Note>
