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

# Connect an AI client

> Connect an assistant to the InsightChain MCP server, with setup for each client and the tools by the question they answer.

InsightChain is a Model Context Protocol server. Add it to the assistant your team already uses, and it can answer from your own supply-chain data: what is at risk, what to move or buy, what a tariff costs, whether an item is admissible.

```text Server URL theme={null}
https://api.insightchain.ai/v1/mcp
```

## Two ways to sign in

**With your account.** Clients that connect by URL (Claude, ChatGPT, Cursor, Claude Code) open a consent screen. You sign in to InsightChain, pick the organization and the permissions, and approve. Nothing to copy, and you can disconnect the app at any time under [API keys](https://insightchain.ai/dashboard/api-keys).

**With an API key.** For servers and scripts. Create a key under [API keys](https://insightchain.ai/dashboard/api-keys) and send it as `Authorization: Bearer YOUR_API_KEY`.

| Permission | What it allows |
| - | - |
| `read` | Read your organization's data and the agents' findings. |
| `execute` | Draft orders from recommendations, acknowledge alerts, start syncs. Includes Read. |
| `approve` | Approve, reject and run orders. Organization admins only. |
| `ingest` | Push records into InsightChain. Reads nothing back. |

## Set up your client

### Claude Code

Your account or an API key.

1. With your account: add the server, then run `/mcp` inside Claude Code and choose Authenticate. Your browser opens the consent screen.
2. With an API key: add the server with an Authorization header. Nothing else to do.

```bash With your account theme={null}
claude mcp add --transport http insightchain https://api.insightchain.ai/v1/mcp
```

```bash With an API key theme={null}
claude mcp add --transport http insightchain https://api.insightchain.ai/v1/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"
```

### Claude Desktop and claude.ai

Signs in with your account.

1. Open Settings, then Connectors, then Add custom connector.
2. Name it InsightChain and paste `https://api.insightchain.ai/v1/mcp` as the URL.
3. Choose Connect. Sign in to InsightChain, pick the organization and the permissions, and approve.

```text Connector URL theme={null}
https://api.insightchain.ai/v1/mcp
```

### Cursor

Your account or an API key.

1. Add the server to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project).
2. With an API key, keep the headers block. Without it, Cursor opens the consent screen the first time the server is used.

```json ~/.cursor/mcp.json theme={null}
{
  "mcpServers": {
    "insightchain": {
      "url": "https://api.insightchain.ai/v1/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

### ChatGPT

Signs in with your account.

1. Open Settings, then Connectors, and create a connector (your workspace admin may need to turn on developer mode).
2. Paste `https://api.insightchain.ai/v1/mcp` as the MCP server URL and choose OAuth as the authentication.
3. Sign in to InsightChain, pick the organization and the permissions, and approve.

```text MCP server URL theme={null}
https://api.insightchain.ai/v1/mcp
```

### OpenAI SDK (Responses API)

Uses an API key.

1. Pass the server as a tool of type mcp, with your API key in the Authorization header.
2. The sample sets `require_approval` to `never`, so no tool call waits for you. Use a key with only the `read` scope here; for a key that can change something, set `require_approval` to `always` and answer the approval requests in your code.

```python Python theme={null}
from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="gpt-5",
    tools=[{
        "type": "mcp",
        "server_label": "insightchain",
        "server_url": "https://api.insightchain.ai/v1/mcp",
        "headers": {"Authorization": "Bearer YOUR_API_KEY"},
        "require_approval": "never",
    }],
    input="What is at risk in our supply chain this week?",
)
print(response.output_text)
```

### Anthropic SDK (Messages API)

Uses an API key.

1. Name the server in `mcp_servers` with your API key as its authorization token, and reference it from an `mcp_toolset` tool.

```python Python theme={null}
import anthropic

client = anthropic.Anthropic()
response = client.beta.messages.create(
    model="claude-opus-5-5",
    max_tokens=16000,
    betas=["mcp-client-2025-11-20"],
    mcp_servers=[{
        "type": "url",
        "url": "https://api.insightchain.ai/v1/mcp",
        "name": "insightchain",
        "authorization_token": "YOUR_API_KEY",
    }],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "insightchain"}],
    messages=[{"role": "user", "content": "What should we move or buy this week?"}],
)
for block in response.content:
    if block.type == "text":
        print(block.text)
```

### Any other client

The server speaks Streamable HTTP: POST JSON-RPC messages to the URL. To look around before wiring anything, use the MCP Inspector.

```bash cURL theme={null}
curl -X POST "https://api.insightchain.ai/v1/mcp" \
  -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call",
        "params": { "name": "get_stockout_projections", "arguments": { "limit": 5 } } }'
```

```bash MCP Inspector theme={null}
npx @modelcontextprotocol/inspector --cli https://api.insightchain.ai/v1/mcp \
  --transport http --header "Authorization: Bearer YOUR_API_KEY" --method tools/list
```

## What you can ask

The server URL lists a short set of tools, chosen for the four questions teams ask most. An assistant picks better from a short list. Each tool is shown with a question it answers.

### What is at risk?

| Tool | A question it answers |
| - | - |
| `get_supply_chain_status` | What data do you have for us, and how fresh is it? |
| `get_disruption_signals` | Which disruptions are active in Vietnam right now, and do any touch our suppliers? |
| `get_disruption_exposure_by_product` | Is item 10042 exposed to any active disruption? |
| `get_stockout_projections` | What will we run out of in the next two weeks? |
| `get_po_risk` | Which open purchase orders are most at risk of arriving late? |
| `list_alerts` | Which high-severity alerts are still open? |

### What should I move or buy?

| Tool | A question it answers |
| - | - |
| `get_rebalance_recommendations` | Which locations should send stock to which, and how many units? |
| `get_purchase_proposals` | What do we need to buy this week, and from which supplier? |
| `list_recommendations` | Which recommendations are waiting for a decision? |
| `explain_recommendation` | Why are you recommending we move 200 units to the Chicago store? |
| `list_orders` | Which orders are approved but not yet executed? |
| `order_action` | Can you turn this transfer recommendation into an order for approval? |

### What does this tariff cost me?

| Tool | A question it answers |
| - | - |
| `check_tariff` | What duty applies to HS 6109.10 from Vietnam into the US? |
| `calculate_landed_cost` | What is the landed cost of \$50,000 of cotton T-shirts from Bangladesh to the UK? |
| `get_tariff_impact` | How much extra duty are we paying on open orders, by supplier? |

### Is this item admissible?

| Tool | A question it answers |
| - | - |
| `check_product_admissibility` | Can we import HS 8516.29 heaters made in China into Germany? |
| `list_recalls` | Have any of our products been recalled recently? |

## More tools, by area

More tools come in sets. Connect to a set by adding its name to the URL, or combine sets with `?toolsets=trade,risk`. For every tool at once, use `https://api.insightchain.ai/v1/mcp/all`.

A set decides which tools are listed, not which can be called: a client that knows a tool by name can call it on any of these URLs. Tools of a module your organization does not have are not listed.

### Inventory

Demand, forecasts, replenishment, stockouts, transfers, purchases, markdowns and expiry.

`https://api.insightchain.ai/v1/mcp/inventory`

| Tool | A question it answers |
| - | - |
| `get_stockout_projections` | What will we run out of in the next two weeks? |
| `get_rebalance_recommendations` | Which locations should send stock to which, and how many units? |
| `get_purchase_proposals` | What do we need to buy this week, and from which supplier? |
| `get_po_risk` | Which open purchase orders are most at risk of arriving late? |
| `get_replenishment_params` | What is the reorder point for item 10042 at the Dallas DC? |
| `get_demand_forecast` | How many units of item 10042 will we sell over the next 30 days? |
| `get_demand_stats` | Which items have intermittent demand at our stores? |
| `get_forecast_accuracy` | How accurate were our forecasts last quarter, and where were they worst? |
| `check_forecast` | Is my forecast of 1,200 units for item 10042 next month too high? |
| `get_new_product_forecast` | How many units should we buy for a style launching next month? |
| `get_merchandise_plan` | How much open-to-buy do we have in outerwear for the next 90 days? |
| `get_size_allocation` | How should we split 500 units of this dress across stores and sizes? |
| `get_markdown_candidates` | Which styles should we mark down before the season ends on March 31? |
| `get_expiry_risk` | How much inventory value will expire unsold in the next 30 days? |
| `get_expiry_actions` | What should we do with the yogurt lots expiring next week? |
| `get_esg_footprint` | Which trade lanes contribute most to our estimated carbon footprint? |

### Disruptions and risk

Disruption events and exposure, and country and location risk.

`https://api.insightchain.ai/v1/mcp/risk`

| Tool | A question it answers |
| - | - |
| `get_disruption_signals` | Which disruptions are active in Vietnam right now, and do any touch our suppliers? |
| `get_disruption_exposure_totals` | How much open order value is at risk from disruptions in the next two weeks? |
| `get_disruption_event_exposure` | Which suppliers and items does the typhoon in Taiwan put at risk? |
| `get_disruption_exposure_by_product` | Is item 10042 exposed to any active disruption? |
| `get_country_risk_profiles` | Which countries are sanctioned or rated high risk? |
| `get_location_risk` | Are there sanctions that affect sourcing from Myanmar? |
| `list_alerts` | Which high-severity alerts are still open? |
| `acknowledge_alert` | Can you mark the stockout alert for the Boston store as resolved? |

### Trade and customs

Duties, landed cost, import tax, customs documents, screening, and how tariff changes hit your orders.

`https://api.insightchain.ai/v1/mcp/trade`

| Tool | A question it answers |
| - | - |
| `check_tariff` | What duty applies to HS 6109.10 from Vietnam into the US? |
| `calculate_landed_cost` | What is the landed cost of \$50,000 of cotton T-shirts from Bangladesh to the UK? |
| `get_import_tax` | What import VAT applies in Germany on a 20,000 euro shipment? |
| `generate_customs_documents` | Can you draft a commercial invoice and packing list for this shipment? |
| `screen_denied_party` | Is this new supplier in Turkey on any denied-party list? |
| `get_tariff_impact` | How much extra duty are we paying on open orders, by supplier? |
| `get_tariff_impact_briefs` | What does the new steel tariff mean for us, in plain words? |
| `get_tariff_impact_history` | How has our tariff exposure changed over the last month? |
| `get_duty_orders` | Are there anti-dumping orders on HS 7604.21 from China? |
| `get_tariff_actions` | Which additional US duties apply to goods from India today? |
| `get_trade_announcements` | Were there any new trade announcements this week? |
| `get_country_risk_profiles` | Which countries are sanctioned or rated high risk? |
| `get_location_risk` | Are there sanctions that affect sourcing from Myanmar? |

### Product compliance

Recalls, admissibility verdicts and product passports.

`https://api.insightchain.ai/v1/mcp/compliance`

| Tool | A question it answers |
| - | - |
| `check_product_admissibility` | Can we import HS 8516.29 heaters made in China into Germany? |
| `list_compliance_verdicts` | Which of our items are blocked from entering France? |
| `list_recalls` | Have any of our products been recalled recently? |
| `get_recall_exposure` | Where is the recalled space heater in our network right now? |
| `screen_denied_party` | Is this new supplier in Turkey on any denied-party list? |
| `list_passports` | Which passports for our denim line are still in draft? |
| `get_passport` | What is missing from the passport for style 88310? |

### Recommendations and orders

The approval loop: recommendations, their evidence, orders and alerts.

`https://api.insightchain.ai/v1/mcp/actions`

| Tool | A question it answers |
| - | - |
| `list_recommendations` | Which recommendations are waiting for a decision? |
| `explain_recommendation` | Why are you recommending we move 200 units to the Chicago store? |
| `list_orders` | Which orders are approved but not yet executed? |
| `order_action` | Can you turn this transfer recommendation into an order for approval? |
| `list_alerts` | Which high-severity alerts are still open? |
| `acknowledge_alert` | Can you mark the stockout alert for the Boston store as resolved? |

### Merchandising

`https://api.insightchain.ai/v1/mcp/merch`

| Tool | A question it answers |
| - | - |
| `get_merchandise_plan` | How much open-to-buy do we have in outerwear for the next 90 days? |
| `get_markdown_candidates` | Which styles should we mark down before the season ends on March 31? |
| `get_size_allocation` | How should we split 500 units of this dress across stores and sizes? |
| `get_new_product_forecast` | How many units should we buy for a style launching next month? |

### Data and connections

What data the organization has, how fresh it is, and the state of its connections.

`https://api.insightchain.ai/v1/mcp/data`

| Tool | A question it answers |
| - | - |
| `get_supply_chain_status` | What data do you have for us, and how fresh is it? |
| `list_connections` | When did our SAP connection last sync? |
| `list_sync_runs` | Did last night's sync fail, and why? |
| `start_connector_sync` | Can you refresh our SAP data now? |

## Results

Every tool declares the shape of its answer (`outputSchema`) and returns it as `structuredContent`, with the same JSON as text for older clients. The list carries each answer's top-level fields; add `?schemas=full` for every field.

A result is at most 32,000 bytes. A larger one is cut at whole rows and says so: `truncated: true`, how many rows were left out, and a `next_cursor`. Call the same tool with the same arguments and `cursor` set to it for the next part.

One tool call is one request against your limits (120 a minute and the daily quota of the key or connection). Listing tools and the protocol's own messages do not use the daily quota. Tools that change something say so, and the clients you chat with ask before running them.

## Prompts and resources

Clients that show prompts get four starting points: a weekly risk review, a move-or-buy plan, a tariff cost check and an admissibility check. Clients that attach resources can attach a recommendation, a product passport or an item by its id.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.