# Connect with AI

Chat with your Data Stores and your Image Library from Claude, Codex, ChatGPT, or Cursor.

## See it work

Example chat:

- **You:** How many records are in my store?
  - **Agent:** Count: 1,248 records in Partner Demo Guests.
- **You:** Show me the latest 3 records.
  - **Agent:** Returned 3 rows (alice@…, bob@…, cara@…).
- **You:** Update alice@example.com score to 100.
  - **Agent:** Upserted 1 record.
- **You:** Find our holiday logos.
  - **Agent:** Found 2 images in the Client Logos folder.

## MCP endpoint

```text
https://dev.niftyimages.com/mcp
```

Already connected to `/store_mcp`? Leave it. It is the same server.

## Three steps

1. **Get an API key.** A Store API Key (`store-…`) opens one store. An account API key opens every store and the Image Library.
2. **Add the MCP server** in Codex or Claude Code (below).
3. **Chat** once tools load.

## 1. Get an API key

Pick the key by what you want the AI app to reach. It is only shown the tools that key can use.

- **Store API Key: one store.** Open a store → copy the key from store details. It starts with `store-` and can query, add, update, import and delete records in that one store. Nothing else.
- **Account API key: everything.** Make one on the API Keys page. It reaches every store, can create and delete stores, and gets the Image Library tools when your plan has the Image Library.

Screenshot: `/images/store_mcp/store_api_key.png`

Use a Store key when one store is enough: mistakes stay inside that store. Never put the key in the URL. Use the Authorization header only.

## Codex (step 2)

Configured in the Codex app (not the terminal).

1. Open **Settings → Plugins → MCP → Add Server**.
2. Fill in:
   - **Name** — e.g. `niftyimages` (local label only; rename freely)
   - **URL** — `https://dev.niftyimages.com/mcp`
   - **HTTP headers** — add key `Authorization`, value `Bearer <your UI key>` (prefer a Store key)

Do not put the key in the URL.

Screenshot: `/images/store_mcp/codex_store_mcp.png`

## Claude Code

```bash
claude mcp add --transport http niftyimages https://dev.niftyimages.com/mcp \
  --header "Authorization: Bearer $YOUR_TOKEN"
```

- **Name is yours to choose.** The label `store-mcp` is only a local name in Claude Code—you can change it (e.g. `nifty-store`).
- **Replace the token.** Swap `$YOUR_TOKEN` for your real NiftyImages API key (prefer a Store key). Do not commit or share the key.

## What your AI app can do

Two sets of tools on one server. Your key decides which are listed.

- **Data Stores.** Count and search records, get one, add or update rows, change a few fields on a row, import a CSV, and delete records. With an account key: list, create, update and delete stores too.
- **Image Library.** Search images by name, description, label, file name or folder. Look at an image and its versions, see which designs use it, list folders and labels, and add an image from a public link or a file attached in ChatGPT. Needs an account key on a plan with the Image Library.

Changing the designs that use an image isn't a tool yet. The [Image Library API](/docs/image-library.md) has the full list of what the library can do.

## Try these

- “What store can I use?”
- “How many VIP guests are in California?”
- “Update alice@example.com score to 100.”
- “Import this CSV into the store.”
- “Find our holiday logos in the library.”
- “Which designs use the spring banner?”
- “Add this image to the Logos folder: https://example.com/logo.png”
- “Show me the biggest images in the library.”

