# Connect a desktop or CLI client

Point Claude Desktop, Claude Code, Codex, or a custom agent at Assemblified with an API key.

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

Desktop and command-line assistants — **Claude Desktop**, **Claude Code**, **Codex**, and custom agents — connect to Assemblified with an [API key](/features/agent-access/api-keys/) sent as a bearer token. (Web-chat apps like claude.ai and ChatGPT connect differently — see [Connect claude.ai or ChatGPT](/features/agent-access/connect-web-chat/).)

## On this page

- What you need
- The connection URL
- Connecting your assistant
- Trying it out
- Correcting a program error

## What you need

- An active Assemblified subscription (API & agent access is in open beta).
- An [API key](/features/agent-access/api-keys/) you've already created and copied.
- An MCP-capable assistant that lets you add a custom MCP server with a bearer token. Assemblified supports the MCP protocol versions 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25 and 2026-07-28. Protocol support alone does not guarantee that every client or version can connect; see [connection troubleshooting](/features/agent-access/managing-and-security/#troubleshooting-a-connection).

## The connection URL

Your store has a single MCP connection URL. Open **Settings → Connections → API & agent access**. The exact URL is shown in its **Connect your LLM** card and ends in `/mcp`:

{/* prettier-ignore */}
```text
POST https://<your-assemblified-app-url>/mcp
Authorization: Bearer asmk_…
```

You give your assistant two things: this **URL** and your **API key** (the `asmk_…` value) as the bearer token.

## Connecting your assistant

The exact steps depend on the app, but the shape is always the same:

{/* prettier-ignore */}
<Steps>

1. In your assistant, add a **custom MCP server** (sometimes called a "connector" or "tool server").
2. Set the server **URL** to the `/mcp` URL shown on the API & agent access page.
3. Set the **authorization** to a bearer token and paste your `asmk_…` key.
4. Save. Your assistant should now list Assemblified's nine tools: **`run`** (the main one), **`search`**, **`describe_api`**, **`list_docs`**, **`get_doc`**, **`whoami`**, **`list_skills`**, **`get_skill`** and **`search_docs`**. What each one does is on the [overview](/features/agent-access/overview/#how-it-works-code-mode).

</Steps>

{/* prettier-ignore */}
<Aside type="note">
    Each assistant has its own way of storing MCP servers (a config file, a settings screen, or a CLI command). Check that app's own
    documentation for *where* to add a custom MCP server with a bearer token; the **values** to enter are the URL and key above.
</Aside>

## Trying it out

Once connected, ask your assistant a question in plain language, such as _"List my materials."_ Behind the scenes it calls the `run` tool with a short program:

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

If it comes back with your real materials, you're connected. You can also ask _"Which store am I connected to?"_: the assistant answers with your store, the key's scope and the label you gave the key. If Assemblified returns `401` with a JSON `unauthorized` message, check the URL, bearer-token configuration and [revocation state](/features/agent-access/managing-and-security/#revoking-access). Replace a key only if it is unusable or lost. For other refusals or connection failures, follow [connection troubleshooting](/features/agent-access/managing-and-security/#troubleshooting-a-connection).

## Correcting a program error

If your assistant reports a JavaScript syntax error, ask it to correct the program before trying again. Some short programs include a line and column or a hint to check the end of the code. Other errors may have less specific guidance. Programs must use JavaScript; TypeScript examples describing available actions are reference material.

Before repeating a program that changes data, ask your assistant to inspect its call report and check whether any changes already happened. A failed program can still have completed an earlier change. Read back the affected material or bill before approving another attempt; an error alone does not mean it is safe to repeat the whole program.

## See also

- [API keys](/features/agent-access/api-keys/) — creating and revoking the key you paste here.
- [What the assistant can read](/features/agent-access/what-the-agent-can-read/) — the full list of data it can reach.
- [Build and stock BOMs from your catalog via the API](/guides/build-boms-via-api/) — the end-to-end assistant workflow.

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