# AI / Agent access (MCP)

Let your own AI assistant — Claude, ChatGPT, or a custom agent — read and manage your Assemblified data over MCP.

import { CardGrid, LinkCard, Aside } from "@astrojs/starlight/components";
import Term from "~/components/Term.astro";
import DocUpdated from "~/components/DocUpdated.astro";

**AI / Agent access** lets you connect your own AI assistant — Claude (desktop, web, or CLI), ChatGPT, or a custom agent — to your Assemblified data over **MCP** (the Model Context Protocol). Once connected, you can ask your assistant about your <Term def="bom">bills of materials</Term>, <Term def="assembly-bill">assembly BOMs</Term> (the app's newer name for subassemblies), <Term def="raw-material">materials</Term>, <Term def="work-order">work orders</Term> and reports in plain language — and, if you allow it, have the assistant do the work for you.

In the Assemblified admin this is **Settings → Connections → API & agent access**.

{/* prettier-ignore */}
<Aside type="note" title="Open beta">
API & agent access is currently in **open beta**. It requires an **active Assemblified subscription**, and access may move to the **Enhanced** plan in the future. Open **Settings → Connections → API & agent access** to create API keys or connect a web chat.
</Aside>

## On this page

- What you can do with it
- How it works (code mode)
- Large results and failed runs
- What the API covers
- Built-in workflow recipes
- Read-only by default
- Where to next

## What you can do with it

Connect an AI assistant and ask things like:

- _"Which of my finished goods can I build right now, and what's the limiting component?"_
- _"List every material that isn't used in any bill yet."_
- _"Register these Shopify variants as materials and build a bill for the Gift Box Deluxe."_
- _"Set the pre-assembled count for this assembly BOM to 12 at my main location — I just counted them."_
- _"Plan a work order for 40 Oak Tables and tell me what I'm short of."_
- _"Run the top-selling finished goods report for last month."_

The assistant reads live data from your store — and, with write access, makes the changes for you — so there's no copy-pasting product IDs or exporting spreadsheets.

## How it works (code mode)

Assemblified exposes a single, powerful tool to your assistant called **`run`**. Instead of the assistant chaining dozens of small requests, it writes a short program against a typed `app` API and Assemblified runs it once, safely, in an isolated sandbox:

{/* prettier-ignore */}
```js
run("return await app.rawMaterials.list({});")
```

This "code mode" approach lets the assistant search, filter, join, and summarise your data in one step — for example, finding the right Shopify variants, registering them as materials, and composing a bill from them — without you writing any code yourself. You just ask in plain language; the assistant writes the program.

Eight more tools sit beside `run`:

- **`search`**: finds the right methods for a question. The API is organised as a catalogue of topics, each topic lists its methods, and each method has its input and result types. An assistant searches that catalogue first, so it only loads what it needs.
- **`describe_api`**: the live, typed definition of the topics or methods the assistant picked (`{ namespaces: ['billOfMaterials'] }` or a list of methods). Called with no arguments, it returns short guidance followed by the whole definition, which is very large. If your chat client struggles, telling it which area you mean is the single most useful hint you can give it.
- **`list_docs`** and **`get_doc`**: this very documentation site, so the assistant can ground its answers in how Assemblified actually works instead of guessing. An assistant can narrow the index with `q` (a literal phrase in a page's slug, title or description) and `prefix` (a page or section slug); both must match when used together. It can request a readable page with `get_doc({ slug, plainText: true })`. Without that option, it receives the original Markdown. If the readable page is missing, the assistant can explicitly try the original; it is not fetched automatically and may also be missing.
- **`search_docs`**: searches this documentation by question and answers the best-matching sections, each with the page `get_doc` reads; matching pages in the docs of the other P&H Cloud Solutions apps are listed apart, with their links.
- **`whoami`**: which store the connection belongs to, whether it is read only or read and write, the kind of connection (an API key, or a connector you approved with a connection code), its label, and the API version. Ask _"Which store am I connected to?"_ to check a new connection.
- **`list_skills`** and **`get_skill`**: the [built-in workflow recipes](#built-in-workflow-recipes). `list_skills` names them; `get_skill` loads one, complete with the shared rules it builds on, so any assistant can follow it.

Connecting is light: when your assistant connects, Assemblified sends a short introduction (about 10,000 characters) rather than the full definition of every method, and the assistant looks up the rest when a question needs it. This source documents API **2.25**; ask `whoami` for the version your connection is serving.

## Large results and failed runs

- **Large answers are shortened.** When a successful result is longer than about 24,000 characters, Assemblified shortens it and marks clearly what was left out and how much, so the assistant knows the answer is incomplete. IDs and paging details are always kept, so the assistant can fetch the rest page by page. It can also ask for the whole result on a single call.
- **Results that changed something are never shortened.** If a run wrote anything, its result comes back in full, because it is the record of what was saved.
- **A failed run says what happened.** The error lists which app calls ran and how each one ended, and states whether repeating the whole run is safe. A run that may already have saved changes is reported as not safe to repeat, so a careful assistant checks what was saved before it tries again.

## What the API covers

The `app` API is organised into **27 topics**, each with a one-line summary the assistant can search. These are the ones a connection can reach:

- **Bills and BOMs** — `billOfMaterials` and `assemblyBills` (your finished goods and your reusable assembly BOMs, with their composition, per-location rules, <Term def="pre-assembled">pre-assembled stock</Term> and a **buildable** calculator that matches the app's Buildable column), `billVersions` (a bill's saved history and the way back to it) and `bulkBomRules` (the saved rules the bulk bill builder replays).
- **Materials and stock** — `rawMaterials` (Shopify-linked and <Term def="virtual-material">virtual</Term>), `metafields` (stored values on a material), `inventory` (real per-location levels, pre-assembled and residual figures, what is committed, what is allocated, and restocking) and `inventoryGuard` (the check that finds lines Shopify would reject before a stock push).
- **Manufacturing** — `workOrders` (the whole work-order surface: plan, edit, transition, build runs, QC, documents, purchase orders, the work-order catalogues and [order production](/features/agent-access/operating-work-orders/#order-production) for one reserved order) and `assembleTasks` (the lighter task list).
- **Your Shopify store** — `shopify` (search products and variants, list locations), `orders` (the per-order bill breakdown a warehouse packs from) and `orderReservations` (what one order has reserved, line by line, and what each line still owes).
- **Catalogues** — `costFactors` (additional costs), `units` and `unitConversions`, `materialTags`, `metafieldDefinitions`, `importTemplates` (discover the four supported import schemas and manage saved mappings), `assignees` (the people a work order can be assigned to) and `entityGroups`.
- **Saved views**: `savedViews` lists and inspects saved list setups, and reads one current page of matching record IDs for finished goods, assembly BOMs, materials and work orders. Task views support inspection only; report views are excluded. See [Groups & saved views](/features/agent-access/operating-groups-and-views/#saved-views).
- **Insight and admin** — `reporting` (the report catalogue, running a report, and the order-history sync), `dashboard` (the home summary), `search` (the app's own cross-entity search over your records, not to be confused with the `search` tool that finds methods), `executionLogs` (what the app did and whether it worked) and `settings` (read, explain, preflight and change your store settings).

A read-only connection only sees the read methods of each topic.

## Built-in workflow recipes

Assemblified also offers five step-by-step recipes for common jobs. An assistant loads one with `get_skill` (or, if it supports MCP skills, as a skill resource) and follows it, so it takes the same careful route every time:

- **BOM inspection**: read one bill end to end, with its materials, nested assembly BOMs, location rules, cost and buildable units.
- **Shortage investigation**: explain why a bill or a planned build is short, naming the limiting component, where, and by how much.
- **Approved work-order production**: run production on a work order you have approved, from preview through start and completion, and recover from a refused or uncertain step.
- **Bulk material creation**: create many virtual materials with a dry run first, then create after your approval and report the outcome row by row.
- **Inventory preflight and recovery**: find and resolve the lines Shopify would reject before, or after, a stock push.

The recipes share three short sets of rules, which `get_skill` adds below each recipe that needs them: the basics every request follows, how to find the right bill of materials, and the rules every change follows (your explicit approval of exactly that change, one change at a time, and never repeating a change whose outcome is uncertain). When one recipe hands over to another, for example a shortage that leads to production, the assistant loads that recipe too.

Every connection can read the recipes, but a recipe never widens what a connection may do: a read-only connection can read the production recipe and still cannot change anything.

## Read-only by default

By default, AI / Agent access is **read-only**: your assistant can _look at_ your data but cannot change anything. Actions it isn't allowed to take aren't even visible to it.

If you explicitly grant **write access** (a write-scope API key, or a web-chat connection granted write when it's linked), the connection unlocks a large surface. In outline, a write key can:

- build and maintain bills, assembly BOMs, materials and their per-location rules;
- adjust pre-assembled stock, set virtual stock levels and **restock any material at any location — including pushing stock to Shopify**;
- run work orders end to end, including **starting a build run, which moves real Shopify inventory** (Enhanced plan);
- save and restore a bill's versions (Enhanced plan), and push a computed cost to Shopify;
- maintain your catalogues — units, tags, metafield definitions, import templates, assignees, groups and the bulk-builder rules;
- **change your store settings**, and refresh or restart the reporting sync.

{/* prettier-ignore */}
<Aside type="caution" title="Write access is broader than it used to be">
A write-scope key is not limited to editing BOMs. It can move real stock and change how your store behaves. Grant it deliberately, prefer a read key for anything exploratory, and read [Managing access & security](/features/agent-access/managing-and-security/) before you hand one out. The operating pages below describe each write surface in detail.
</Aside>

{/* prettier-ignore */}
<Aside type="note">
A read-only connection is safe to experiment with: the worst it can do is read data it's allowed to read, scoped to your single store. Write access is opt-in per key or connection and can be revoked at any time.
</Aside>

## Where to next

{/* prettier-ignore */}
<CardGrid>
	<LinkCard title="Create an API key" href="/features/agent-access/api-keys/" description="Issue a key for a desktop or command-line client." />
	<LinkCard title="Connect a desktop / CLI client" href="/features/agent-access/connect-a-client/" description="Claude Desktop, Claude Code, Codex, custom agents." />
	<LinkCard title="Connect claude.ai or ChatGPT" href="/features/agent-access/connect-web-chat/" description="The web-chat connector flow with a one-time code." />
	<LinkCard title="What the assistant can read" href="/features/agent-access/what-the-agent-can-read/" description="The full read-only data surface." />
	<LinkCard title="Managing access & security" href="/features/agent-access/managing-and-security/" description="Revoke keys and connections; the security model." />
</CardGrid>

### The operating pages

Each one describes a write surface in detail: what it can do, what it refuses, and what needs a plan.

{/* prettier-ignore */}
<CardGrid>
	<LinkCard title="BOMs & assembly BOMs" href="/features/agent-access/operating-boms-and-assemblies/" description="Build, compose, stock and configure finished goods and assembly BOMs." />
	<LinkCard title="Materials & stock" href="/features/agent-access/operating-raw-materials-and-stock/" description="Register materials, set virtual levels, restock and reconcile." />
	<LinkCard title="Repairs" href="/features/agent-access/operating-repairs/" description="Preview a fix, apply it in a later step, and read the record of every repair." />
	<LinkCard title="Work orders" href="/features/agent-access/operating-work-orders/" description="Plan a build, run it, review it, and order what is missing." />
	<LinkCard title="Bill versions" href="/features/agent-access/operating-bill-versions/" description="Snapshot a BOM, compare two versions, and restore one." />
	<LinkCard title="Reports" href="/features/agent-access/operating-reports/" description="The report catalogue and running a report over a period." />
	<LinkCard title="The reporting sync" href="/features/agent-access/operating-reporting-sync/" description="Check, refresh and restart the order-history copy reports are built on." />
	<LinkCard title="Settings" href="/features/agent-access/operating-settings/" description="Read, explain and change your store settings safely." />
	<LinkCard title="Groups & saved views" href="/features/agent-access/operating-groups-and-views/" description="Group bills, assembly BOMs and materials; what the assistant sees of saved views." />
	<LinkCard title="Bulk bill-builder rules" href="/features/agent-access/operating-bulk-bom-rules/" description="The saved rules the bulk builder replays over a grid." />
	<LinkCard title="Units & conversions" href="/features/agent-access/operating-units/" description="The unit catalogue and the conversions between units." />
	<LinkCard title="Material tags" href="/features/agent-access/operating-material-tags/" description="Maintain and apply your material tag list." />
	<LinkCard title="Metafield definitions" href="/features/agent-access/operating-metafield-definitions/" description="The custom fields your materials carry." />
	<LinkCard title="Import templates" href="/features/agent-access/operating-import-templates/" description="Discover import fields and save mappings from your file headers." />
</CardGrid>

<DocUpdated date="2026-11-19" />