# MCP connection

Connect ChatGPT, the Claude app, Claude Code, Codex, or another OAuth-capable MCP client to your iStores account. The assistant can inspect your storefront, manage your catalog, edit theme files, and generate branding assets through the hosted iStores Design Ops server.

MCP stands for **Model Context Protocol**: it lets an assistant discover available iStores tools and call them on your behalf. You describe a task in normal language; the app selects a tool, asks for any required inputs and shows the result.

You do not need to install or host an MCP server. Connecting an assistant gives it access to the store you authorize, so start with a read-only request before making changes.

## Choose your app

| App | Start here |
|---|---|
| Codex desktop, CLI or IDE extension | [Codex connection steps](#connect-with-codex) |
| ChatGPT | [ChatGPT connection steps](#connect-with-chatgpt) |
| Claude desktop or web | [Claude app connection steps](#connect-with-the-claude-app-desktop--web) |
| Claude Code | [Claude Code connection steps](#connect-with-claude-code) |
| Another coding assistant | [Remote MCP requirements](#other-mcp-clients) |

After connecting, follow [Verify your connection and explore tools](#verify-your-connection-and-explore-tools).

For coding assistants, use the minimal [MCP bot guide](https://apidocs.istores.co.il/mcp-bots.md).

## Connection Details

| Field | Value |
|---|---|
| Server name | `istores-design-ops` |
| MCP URL | `https://api.istores.co.il/mcp` |
| Transport | Streamable HTTP |
| Authentication | OAuth 2.0 through your iStores account |
| Company and store | Selected automatically from the company active when you approve access |

Add the server URL without a manually configured `Authorization` header. Your MCP client obtains and sends the OAuth access token after you sign in.

The API key from [Company settings](https://app.istores.co.il/client/settings/company) is for the regular API. It is not accepted by the current MCP authentication flow.

## Before Connecting

1. Use an MCP client that supports remote HTTP servers and OAuth.
2. Sign in to your iStores dashboard and select the company/store you want the assistant to use.
3. Add the MCP server using one of the instructions below.
4. Complete the browser login and approve the requested permissions.

If your account manages several companies, select the intended company before approving access. Changing the company in the dashboard later does not change an existing MCP token. Sign out of the MCP connection and authenticate again to connect another company.

The store user must sign in and approve access. If the browser already has an iStores session, it can go straight to the permission screen. Automatic client registration identifies the assistant application; it does not authorize access to a store. An OAuth authentication method of `none` means the application does not use a client secret, while user login, consent and PKCE are still required.

## Connect with ChatGPT

Add a custom MCP app/connector using `https://api.istores.co.il/mcp` and OAuth authentication. Let ChatGPT identify or register its client automatically; leave manually configured API keys and client secrets empty. Complete the iStores browser login and approve access for the intended company, then enable the connection in your chat.

See [OpenAI's MCP setup guide](https://learn.chatgpt.com/docs/extend/mcp) for the controls available in your ChatGPT version and workspace.

## Connect with the Claude App (Desktop / Web)

No terminal commands are needed for this setup.

Claude app setup instructions

1. Open Claude and go to **Customize → Connectors**, or open [Connectors](https://claude.ai/customize/connectors) in your browser using the same Claude account.
2. Choose **+ Add → Add custom connector**.
3. Enter **iStores Design Ops** as the name and `https://api.istores.co.il/mcp` as the remote MCP server URL. Click **Continue**.
4. Review the detected OAuth settings. Choose **Sign in now**. For **OAuth client**, use **Claude's published identity** or **Register automatically**. Leave your own client ID/secret and request headers empty; iStores supports automatic client identification.
5. Finish adding the connector. If it is not connected yet, click **Connect**.
6. In the browser, sign in to iStores, ensure the intended company is selected, and approve access.
7. Open a Claude chat, click **+ → Connectors**, and enable **iStores Design Ops**.

Try: **Inspect my current store and list its products. Do not change anything yet.**

For Team or Enterprise accounts, an authorized organization administrator must add the connector first; each member then connects individually. If the app does not show the add option, use the browser Connectors page above.

See the [official Claude custom connector guide](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp).

## Connect with Claude Code

Run in your terminal:

Claude Code setup instructions

```bash
claude mcp add --transport http --scope user istores-design-ops https://api.istores.co.il/mcp
```

Inside an interactive Claude Code session, open:

```text
/mcp
```

Select `istores-design-ops`, start authentication, and complete the iStores login and permission approval in your browser. Then check the connection:

```bash
claude mcp list
```

### If You Already Added an API Key

Remove the old user-scoped entry, then add it again without a header:

```bash
claude mcp remove istores-design-ops --scope user
claude mcp add --transport http --scope user istores-design-ops https://api.istores.co.il/mcp
```

Open `/mcp` again and authenticate. If the old entry was added with a different scope, remove that entry using its original scope.

A configured `Authorization` header prevents Claude Code from falling back to OAuth when that header is rejected. See the [official Claude Code MCP documentation](https://code.claude.com/docs/en/mcp#authenticate-with-remote-mcp-servers).

## Connect with Codex

Use the desktop app's MCP settings or configure the server from the CLI. For a local Codex host, the desktop app, CLI and IDE extension share MCP configuration.

Codex setup instructions

### Desktop setup

If your desktop client has **MCP servers** in Settings, add a server named `istores-design-ops`, select **Streamable HTTP** and enter `https://api.istores.co.il/mcp`. Save and restart the connection, then choose **Authenticate** to complete iStores sign-in. If these controls are unavailable in your version, use the CLI setup below.

### CLI setup

Run these commands in the environment where your Codex client runs:

```bash
codex mcp add istores-design-ops --url https://api.istores.co.il/mcp
codex mcp login istores-design-ops
codex mcp list
```

Complete the iStores login and permission approval in the browser opened by the login command. Then open a chat and ask the assistant to discover the connected tools. A configured server entry alone does not confirm that authentication or tool discovery succeeded.

Codex can use its published client metadata automatically. Its local browser callback uses a temporary loopback port, which can change on each login. Do not manually register that port or replace the callback URL; let Codex manage it.

### Configure Manually

Alternatively, add this entry to `~/.codex/config.toml`:

```toml
[mcp_servers.istores-design-ops]
url = "https://api.istores.co.il/mcp"
enabled = true
```

Then run `codex mcp login istores-design-ops`. Reload your Codex session if the new server is not visible.

For an existing entry, remove manually configured `Authorization` values from `http_headers` or `env_http_headers`, and remove `bearer_token_env_var` for this server before using OAuth. Keep only one definition of this server in the configuration that applies to your session.

See the [official Codex MCP documentation](https://developers.openai.com/codex/mcp).

## Other MCP Clients

Add a remote HTTP MCP server with URL `https://api.istores.co.il/mcp`, choose OAuth authentication, and follow the browser login flow. Leave custom API key and `Authorization` header fields empty.

Connection requirements

The client must support OAuth discovery and either dynamic client registration or a supported client metadata document. A client that only supports static API key headers cannot use this connection method.

## Verify your connection and explore tools

Ask your assistant:

```text
Discover the tools available on my istores-design-ops MCP connection.
List what you can read and what would change my store.
Read my available store languages and summarize the result.
Do not create, update, delete, generate images or spend credits.
If access is missing, explain what I need to reconnect or authorize.
```

The MCP client handles connection setup and tool discovery. `tools/list` returns tool names, descriptions and input schemas. The app may expose this catalog through its tool search or connection panel rather than a button named `tools/list`.

A successful read with `list_languages` confirms that the assistant can call the connected server. Ask it to show a short summary rather than credentials or the full connection metadata. If tools are missing, reconnect, approve the required access and refresh the app's tool catalog.

How an assistant should select and call a tool

1. Discover the tools exposed by the current connection. Do not infer a tool from a REST endpoint or from this guide alone.
2. Inspect the chosen tool's input schema. Use its exact argument names and required fields.
3. Read the current resource and use the returned IDs. For example, use `list_modules` before editing a module.
4. For a change, show the proposed arguments, explain the effect and obtain approval before calling the write tool.
5. Read the result and verify the changed resource. After a timeout, check the current state before retrying a write.

The app sends tool calls through the MCP connection. A REST path such as `GET /modules` is documentation for the REST API; it is not a tool name. Similarly, `layoutId` in a tool schema and `layout_id` inside an API payload are not interchangeable.

## What the Server Can Do

Available tools and usage guidance

| Area | Available tools |
|---|---|
| Setup and inspection | `create_launch_plan`, `inspect_brand_assets`, `inspect_storefront` |
| Store languages | `list_languages` |
| Products | `list_products`, `get_product`, `create_product`, `update_product`, `delete_product` |
| Categories | `list_categories`, `get_category`, `create_category`, `update_category`, `delete_category` |
| Options | `list_options`, `get_option`, `create_option`, `update_option`, `delete_option` |
| Custom CSS/JS and snapshots | `read_theme`, `list_theme_versions`, `update_theme`, `create_snapshot`, `list_snapshots`, `rollback_snapshot` |
| Editable theme files | `list_theme_files`, `read_theme_file`, `update_theme_file`, `delete_theme_file` |
| Branding and media | `upload_media`, `update_logo`, `update_banner` |
| AI image generation | `check_demo_budget`, `list_brand_ai_prompts`, `generate_logo`, `generate_banner`, `generate_product_image`, `get_ai_generation_result` |

Use the schemas returned by `tools/list` for each tool's required fields. OAuth scopes advertised by the server do not mean that a matching MCP tool exists for every regular API endpoint. For example, payment setup is handed off to the dashboard link returned by `create_launch_plan`.

### Start with a Read-Only Request

After connecting, ask:

```text
Use the iStores MCP connection to inspect my current store and list its products.
Do not create, update, delete, generate, or publish anything yet.
```

For a storefront redesign workflow, see [iStores AI Storefront Designer](https://apidocs.istores.co.il/ai-storefront-designer).

### Changes, Media, and Backups

- Ask the assistant to explain changes and obtain your approval before changing a live store.
- `update_theme` replaces the full custom CSS value. Read the existing CSS first and keep `createBackup` enabled; it defaults to `true`.
- Non-empty JavaScript is blocked by `update_theme`. Use the editable files returned by `list_theme_files` for supported theme JS changes.
- `create_snapshot` and `rollback_snapshot` cover custom CSS and JS only. They do not back up products, categories, options, logos, banners, or the whole store.
- Theme file updates and resets create separate file snapshots by default. `rollback_snapshot` does not restore those file snapshots. Resetting a file with `delete_theme_file` restores the system version, not an earlier custom version.
- Product/category/option deletion requires `confirmed: true` after you approve the exact ID. Theme file reset requires confirmation of the exact path.
- Use public, server-fetchable image URLs for product and branding updates. Chat-local files and session-only links are not accessible to the MCP server. `upload_media` accepts image data; its `filePath` refers to a file on the MCP host.
- AI generation consumes credits. Check `check_demo_budget` first. An insufficient balance may trigger a paid credit top-up; approve spending before generation.
- Image generation is asynchronous. Poll `get_ai_generation_result` with the same `resultId`, respecting `pollAfterSeconds` and `maxWaitSeconds`. Do not start another generation while the existing job is processing. Check the completed result's `data.applied` before applying branding again.

## Store design, layouts and modules

You can ask the assistant to change general design settings, mobile options, existing page layouts, header/footer settings, modules and individual banners. Start with the [Store design guide](https://apidocs.istores.co.il/design) for examples and the [Modules and banners guide](https://apidocs.istores.co.il/modules) for content editing.

Design tools, permissions and examples

| Area | Tools | OAuth scope |
|---|---|---|
| General design | `read_design_settings` / `update_design_settings` | `themes:read` / `themes:update` |
| Existing layouts | `list_layouts`, `get_layout` | `modules:read` |
| Layout settings | `update_layout_settings` | `modules:update` |
| Shared header/footer | `read_global_settings` / `update_global_settings` | `modules:read` / `modules:update` |
| Read modules | `list_modules`, `get_module` | `modules:read` |
| Add a module | `create_module` | `modules:create` |
| Edit, move or reorder modules | `update_module`, `reorder_modules` | `modules:update` |
| Remove a module/banner | `delete_module`, `delete_banner` | `modules:delete` |

Read the current values first, then send only the fields you want to change. Omitted settings and banners remain saved. Supplied settings lists replace that list; banner removal uses `delete_banner`. Use the schemas returned by `tools/list` for exact arguments. If access is missing, reconnect and approve the required scope.

Product lists and sliders support up to two banners between products. Use `create_module`/`update_module` with `payload.settings.banners_enabled` (0/1), `payload.settings.banners_interval` (integer >=1 when enabled), and `payload.banners` for desktop/mobile images. Interval 2 inserts banners after products 2 and 4, once each, including across list pagination. Omitted banners remain saved and count toward the two-banner limit. Disabling banners preserves their images. Set `payload.settings.banners_desktop_columns` to 1 (default) or 2 for all banners in the module on screens >=992 px; smaller screens keep one space. If a wide banner does not fit in the remaining grid columns, it starts on the next row and following products fill the gap. Its visible position may therefore be later than the configured product interval. Recommended artwork for 1 space: desktop/mobile 900 × 1200 px (3:4). For 2 spaces: desktop 1800 × 1200 px (3:2), mobile/tablet 900 × 1200 px. See [Banners between products](https://apidocs.istores.co.il/modules#banners-between-products).

Read inline banner IDs through `get_module`/`list_modules`. Use `update_banner` to replace existing desktop/mobile images from public URLs, or `update_module` for banner fields using uploaded CDN URLs. Use `delete_banner` for explicit removal; `inspect_brand_assets` discovers the separate branding banner module.

These writes affect the live store immediately. Ask the assistant to explain the specific changes and wait for approval, then inspect the affected pages in a browser on desktop and mobile. A storefront preview link shows the current state; it is not an isolated draft preview.

CSS/JS snapshots do not back up design settings, layouts, modules or banners. Keep the current read responses before editing; they help restore earlier values but cannot automatically recover deleted content. Deletion tools require `confirmed: true` only after you approve the exact module or banner.

Try this:

~~~text
Read my current design and list my homepage modules.
Show me how to display two product columns on mobile.
Keep every setting and banner I did not ask to change.
Wait for my approval before making this live change.
~~~

## Troubleshooting

Common connection errors

| Message or symptom | What to do |
|---|---|
| `Token missing` / needs authentication | Complete OAuth login. An unauthenticated connection receives HTTP 401 so the client can discover the login flow. |
| `Company not found` after using a settings API key | Remove the manually configured key/header and reconnect with OAuth. Use the MCP sign-in flow instead of an API settings token. |
| `Company not found` after OAuth login | Authenticate again with the intended company selected. If it continues, contact support with the `request_id`. |
| `Server rejected the configured Authorization header` / OAuth fallback disabled | Remove the manually configured `Authorization` header and authenticate again. |
| `Invalid token` | Remove stale manual credentials and reconnect through OAuth. |
| `Token expired` | Let the client refresh the token, or sign in again if refresh fails. |
| `Invalid token audience` | Use the exact MCP URL above and obtain a token through this MCP connection. A token for another resource cannot be reused. |
| HTTP 402 / `Payment owe detected` | Resolve the company's outstanding payment in the dashboard. |
| HTTP 429 | Wait before retrying and reduce the frequency of requests. |
| OAuth `invalid_grant` | Restart authentication. The authorization code may be expired/used, the refresh token unavailable, or the callback/PKCE values mismatched. |
| OAuth `invalid_client` / `OAuth client is not registered` | Reconnect using automatic client identification or registration. If it repeats, contact support with the client name, version and attempt time; an incompatible client metadata document can also cause this error. |
| OAuth `invalid_request` / `Redirect URI does not match registered client` | Use the callback generated by your MCP client. Temporary ports are supported for registered HTTP loopback callbacks; the rest of the callback must match. External callbacks must match exactly. Contact support if an unchanged client-generated callback is rejected. |
| Storefront inspection blocked | Use the returned storefront URL in a browser. Bot protection can block server-side inspection; provide a screenshot or relevant HTML if needed. |

When contacting support, include your client name, the MCP URL, the error, and `request_id` when present. Do not send access tokens, refresh tokens, API keys, or complete authorization callback URLs.

## OAuth Flow for Developers

MCP clients handle these steps automatically; merchants do not need to create a client ID or exchange tokens manually.

Discovery and token endpoints

| Step | Endpoint / behavior |
|---|---|
| Discover the protected resource | `GET https://api.istores.co.il/.well-known/oauth-protected-resource/mcp` |
| Discover authorization endpoints | `GET https://api.istores.co.il/.well-known/oauth-authorization-server` |
| Register a client when needed | `POST https://api.istores.co.il/mcp/oauth/register` |
| Request authorization | `GET https://api.istores.co.il/mcp/oauth/authorize`; redirects to the dashboard for login and consent |
| Exchange the authorization code | `POST https://api.istores.co.il/mcp/oauth/token` with `grant_type=authorization_code`, `client_id`, `redirect_uri`, `code`, and `code_verifier` |
| Call MCP | The client sends the issued access token as `Authorization: Bearer <access_token>` to `/mcp` |
| Refresh access | The token endpoint accepts `grant_type=refresh_token`, `client_id`, and `refresh_token` |

The flow uses Authorization Code with PKCE (`S256`). Authorization codes are single-use and valid for five minutes. Default access token lifetime is one hour; default refresh token lifetime is 90 days. Use the token response's expiry fields rather than hard-coding these defaults.

Request only the scopes your workflow needs. Catalog tools use `products:read`, `products:create`, `products:update` and `products:delete` for products, categories and options. Custom CSS/JS and snapshots use `themes:read` or `themes:update`; editable theme files use `themes:files:read` or `themes:files:update`. Media uploads and logo updates require `themes:assets`; banner updates require `modules:update`. AI generation requires `themes:generate`, plus `themes:assets` to apply a logo or `modules:update` to apply a banner. Store inspection, AI prompt/result reads and budget inspection use `themes:read`. Missing scope errors require reconnecting with the needed permissions; a read-only grant cannot authorize these writes.

Client identification supports both HTTPS Client ID Metadata Documents (CIMD) and dynamic client registration (DCR). Discover the current server capabilities instead of hard-coding a client ID. For CIMD, the client must support public-client authentication (`none`); when a document provides `token_endpoint_auth_methods_supported`, iStores uses that list rather than requiring its legacy singular preference to be `none`. A client offering only `private_key_jwt` is not supported.

Authorization requests include `response_type=code`, `client_id`, `redirect_uri`, `code_challenge`, `code_challenge_method=S256`, and the MCP `resource`; use `state` to correlate the browser callback and `scope` to request the permissions needed. Keep the same exact `redirect_uri`, including its temporary port, when exchanging the authorization code. The user completes login and consent in their browser; assistants should not request their iStores password in chat.

Use the MCP resource URL `https://api.istores.co.il/mcp` as the OAuth `resource`. Sign in with the store you want the assistant to access.

## Saved custom CSS/JS versions

Use `list_theme_versions` with `kind: "css"` or `kind: "js"` to get up to 30 saved versions, newest first. Entries contain only `date`, `version` and `version_id`; no code is included. Empty history returns an empty list in the response envelope.

Version history tools

Pass a returned `version_id` with the same `kind` to `read_theme` to read that version's content. Omitting `version_id` preserves the existing current-code read. The response keeps `kind`, `code` and `bytes`. These tools only read; they do not activate, save or roll back a version. A supplied ID must be a positive integer belonging to this store and code type.

See [Saved CSS/JS versions](https://apidocs.istores.co.il/design#saved-cssjs-versions) for examples, API equivalents and the difference between editor history and MCP snapshots. Use IDs returned for your connected store.
