# Storag for AI agents: zero to first search

This page is for an AI agent that sets up product search for its user. Steps 1 and 2 you can run yourself,
with no key and no person. Steps 3 to 5 need your user in a browser: say the text in step 3 to them as it stands.
Then steps 4 and 5 are yours again. Text version: [https://storag.ai/docs/agents.md](https://storag.ai/docs/agents.md).

What Storag does: product search over one shop's catalogue, best match first: full-text candidates judged for fit
by an LLM (`meta.judged`). Price, stock and sort phrases in the query ("under 150", "in stock", "cheapest") are
applied as filters. A judged answer holds at most 100 products; `total`, paging and `meta.fallback`:
[How /search answers](https://storag.ai/docs/api#description/how-search-answers). The OpenAPI spec at
`https://storag.ai/api/v1/storag/openapi.json` is the reference; if this page and the spec disagree, the spec wins.

## 1. Search the demo over REST (no key)

```bash
curl 'https://storag.ai/api/v1/storag/demo/search?q=waterproof+hiking+boots+under+150+in+stock&page_size=3&src=agents'
```

**Done looks like:** HTTP 200, `total` 15, and `results[0].product.id` `DEMO-1937` (Larchline Waterproof Men's
Hiking Boots, Black, 108.49 EUR). The demo allows 30 requests a minute and 500 a day per IP.

The demo catalogue is fictional. Never present its products to anyone as real stock.

## 2. Connect the demo MCP server (no key)

The demo MCP server is `https://mcp.storag.ai/demo/mcp` (Streamable HTTP, no auth, no session). It has 4 read-only tools:
`search_products`, `text_search_products`, `list_products` and `get_product`. The query argument is `q`.

**Claude Code:**

```bash
claude mcp add --transport http storag-demo https://mcp.storag.ai/demo/mcp
```

**Any client with a JSON MCP config** (`.mcp.json`; Claude Code needs `"type": "http"`):

```json
{
  "mcpServers": {
    "storag-demo": {
      "type": "http",
      "url": "https://mcp.storag.ai/demo/mcp"
    }
  }
}
```

**Claude Desktop or claude.ai:** you cannot add it yourself; tell your user. In Claude Desktop or on claude.ai, open Connectors (Claude Desktop: Settings > Connectors; claude.ai: https://claude.ai/customize/connectors), then Add, then Add custom connector. Name it `Storag demo`, set the URL to
`https://mcp.storag.ai/demo/mcp`, click **Continue** and choose **No sign-in**. On the Free plan, Claude allows one custom
connector. Claude connects from Anthropic's cloud, so this works from any network.

**Done looks like:** `tools/list` names the 4 tools, and `search_products` with
`{"q": "waterproof hiking boots under 150 in stock"}` returns the same products as step 1.

## 3. Hand three steps to your user

Sign-up, the API key and the catalogue import are done in the Storag dashboard; there is no API for them. Tell your
user this:

> To search your own shop's products I need a Storag API key and your product feed. It takes three steps in your
> browser:
>
> 1. Create a free Storag account at [https://storag.ai/signup?ref=agent](https://storag.ai/signup?ref=agent) (Google, GitHub or email). No credit card.
> 2. Open [https://storag.ai/dashboard/api](https://storag.ai/dashboard/api), click **Create key**, name it after me, and paste the key to me. It starts with
>    `pk_` and is shown only once.
> 3. Open [https://storag.ai/dashboard/feed](https://storag.ai/dashboard/feed), paste your shop's Google Shopping feed URL (XML, CSV or TSV), and click
>    **Save feed URL**. Tell me when the import says it is searchable.

If the user has no feed, the Feed page can import a 2,000-product demo feed instead. Then their project searches
fictional products too.

## 4. Check what your key searches

Keep the key out of files you commit: set it as `STORAG_API_KEY` in the environment.

```bash
curl -s 'https://storag.ai/api/v1/storag/products?page_size=1' -H "Authorization: Bearer $STORAG_API_KEY"
```

Read the `catalogue` field before you trust any result:

| Answer | What it means | What you do |
|---|---|---|
| `total` above 0, no `catalogue` field | Your user's own products are live. | Go on to step 5. |
| `"catalogue": "sample"` | The project searches the 2,000-product sample catalogue until its own import is live. | Wait for the import, or tell your user step 3.3 is not done. Never show these products as the shop's. |
| `"catalogue": "none"` and a `notice` | The project has no catalogue yet; nothing was searched. | Tell your user to finish step 3.3. Do not report "no products found". |
| `401` | The key is missing, mistyped or revoked. | Ask your user to copy the key again from [https://storag.ai/dashboard/api](https://storag.ai/dashboard/api). |

## 5. Search your user's catalogue

REST, the same parameters and response as the demo:

```bash
curl -s 'https://storag.ai/api/v1/storag/search?q=waterproof+hiking+boots+under+150&page_size=3' \
  -H "Authorization: Bearer $STORAG_API_KEY"
```

MCP: the keyed server is `https://mcp.storag.ai/mcp`, header `Authorization: Bearer <key>`. It keeps a session; MCP clients
handle that for you. In Claude Code:

```bash
claude mcp add --transport http storag https://mcp.storag.ai/mcp \
  --header "Authorization: Bearer $STORAG_API_KEY"
```

`claude mcp list` shows `✔ Connected` even with a wrong key; the first tool call checks it and fails with
`Invalid Storag API key: ...`. Ask your user to copy the key again.

**claude.ai, Claude Desktop or ChatGPT** (your user does this): Connectors on claude.ai, in Claude Desktop and in ChatGPT sign in with OAuth, which the Storag MCP server does not
offer yet, so they cannot use the key. There, add the keyless demo `https://mcp.storag.ai/demo/mcp` as a custom connector with no
sign-in; for the user's own catalogue, use Claude Code, Cursor, Windsurf, VS Code or n8n.

Claude Desktop can still reach the keyed server as a local command through the `mcp-remote` bridge (needs Node.js 18
or newer): put this in `claude_desktop_config.json` (Settings > Developer > Edit Config) and restart Claude Desktop.

```json
{
  "mcpServers": {
    "storag": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.storag.ai/mcp",
        "--header",
        "Authorization:${AUTH_HEADER}"
      ],
      "env": {
        "AUTH_HEADER": "Bearer pk_your_api_key"
      }
    }
  }
}
```

A wrong key does not stop the connection: Claude connects and lists the four tools, and the first tool call fails with
`Invalid Storag API key: storag-api refused the key sent as 'Authorization: Bearer <key>'`. Copy the key again.

**Done looks like:** HTTP 200 with the user's own products under `results[].product` and no `catalogue` field.
Tell your user it works and show them one result. From here, the user's first week counts as live when the key makes
100 searches on their own products on 2 different days within 7 days of sign-up:
[https://storag.ai/docs/quickstart#description/your-first-week](https://storag.ai/docs/quickstart#description/your-first-week).

## Errors you may see

- 400 bad parameter (the body says which), 401 no or wrong key, 403 the key is not allowed from this origin, 404 not
  found, 429 over the key's per-minute limit or the demo's limits, 502 search backend unavailable. Error bodies are
  JSON with a `message`.

## More

- [llms.txt](https://storag.ai/llms.txt) and [llms-full.txt](https://storag.ai/llms-full.txt): what Storag is, the API and MCP basics
- Human docs: [quickstart](https://storag.ai/docs/quickstart), [API reference](https://storag.ai/docs/api), [MCP server setup](https://storag.ai/docs/mcp)
- [docs.md](https://storag.ai/docs.md): every docs guide as one Markdown file
- [OpenAPI 3.1 spec](https://storag.ai/api/v1/storag/openapi.json)
- [Pricing](https://storag.ai/pricing): Free is $0 with 5,000 searches a month
