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

# How AI Agents Use Closient

> How AI agents look up products from barcodes, resolve GTINs to product data, and answer GS1 Digital Link questions using the Closient MCP server.

This page answers the questions developers and AI assistants actually ask
when they want to connect an agent to product data. Each question is
answered first; deeper reference links live at the bottom.

## How can AI agents look up product data from a barcode?

Closient runs a hosted [Model Context Protocol](https://modelcontextprotocol.io)
(MCP) server that any MCP-compatible AI client — Claude Code, Claude Desktop,
Cursor, VS Code, Windsurf — can call directly. Point the client at
`https://www.closient.com/mcp/http`; no local install, no API key for the
unauthenticated tools.

Out of the box, an agent can:

* **Validate a GTIN** (barcode number) with [`validate_gtin`](/guides/mcp-tools)
* **Resolve a GTIN to a product page** with [`resolve_gtin`](/guides/mcp-tools)
* **Look up structured product data** (brand, name, image, description) with [`lookup_product`](/guides/mcp-tools)
* **Search by natural language** ("organic peanut butter") with [`search_products`](/guides/mcp-tools)
* **Compare two products** with [`compare_products`](/guides/mcp-tools)
* **Check local availability** with [`check_availability`](/guides/mcp-tools)
* **Generate a Digital Link QR URL** (authenticated) with [`generate_qr_url`](/guides/mcp-tools)

With an OAuth token scoped `products:write` / `dashboard:write`, a
brand-owner agent can also enter and edit catalog data — create a
product, update basic info/dimensions/GPC classification, upload images
and documents, add videos, and set nutrition facts and ingredients. See
the full write-tool list in [MCP Tools Reference](/guides/mcp-tools).

Install in one command from a terminal:

```bash theme={null}
claude mcp add closient --transport http https://www.closient.com/mcp/http
```

See [Install the Closient MCP Server](/guides/mcp-install) for one-click and
JSON-fallback instructions for every supported client.

## Is there an MCP server for GTIN resolution?

Yes. Closient operates a hosted MCP server at
`https://www.closient.com/mcp/http` (Streamable HTTP transport;
`/mcp/sse` retained for legacy SSE clients). It exposes read tools that
work without auth — including resolving a GTIN to its public product
page or Digital Link target — plus a set of OAuth-gated write tools for
QR generation and full brand-owner product entry (create/update
products, images, documents, videos, nutrition, ingredients). See
[MCP Tools Reference](/guides/mcp-tools) for the complete list.

The server is GS1 Digital Link aware: when an agent passes a GTIN, it
normalises to GTIN-14 and follows the same resolution rules that power
the public `/01/<gtin>` resolver — so an agent always sees the same
destination a consumer's scanner sees.

## How do I connect my AI agent to product data?

If your agent is an MCP client, point it at the hosted server.
[Install instructions](/guides/mcp-install) cover all major clients.
[Quickstart](/guides/mcp-quickstart) walks through your first resolution
in under two minutes.

If your agent is custom-built (no MCP support), use the REST API
directly. The [`/products` endpoint](/api-reference/products) returns
structured product data; the [`/01/<gtin>` resolver](/api-reference/resolver)
returns the Digital Link target. Both are AI-agent friendly — JSON
responses, no scraping required.

## What's the difference between calling the MCP server and the REST API?

| Aspect        | MCP Server                          | REST API                                                    |
| ------------- | ----------------------------------- | ----------------------------------------------------------- |
| Best for      | AI agents, IDE assistants           | Custom code, integrations                                   |
| Transport     | JSON-RPC over Streamable HTTP / SSE | HTTPS / JSON                                                |
| Auth          | OAuth 2.1 (only for write tools)    | API key (`X-API-Key`)                                       |
| Discovery     | Tool list returned at connect       | OpenAPI spec at [`/api-reference`](/api-reference/overview) |
| Schemas       | Tool input/output JSON schemas      | OpenAPI 3.1 per domain                                      |
| Local install | None — hosted                       | None — hosted                                               |
| Streaming     | Native                              | Webhook subscriptions                                       |

Read the deeper comparison: [MCP Server vs REST API for AI Agent Integration](/prompts/api-vs-mcp).

## What product data can the MCP server return?

For any GTIN, the MCP server exposes:

* Brand, product name, description, category (GPC)
* Product images, dimensions, weight
* GS1 certifications and claims
* Local retailer availability (where stocked, with confidence levels)
* Resolver rule destination — where a scan of the barcode currently routes
* Compatibility / comparison data when querying multiple GTINs

The full schema for each tool is documented in
[MCP Tools Reference](/guides/mcp-tools).

## How is the MCP server authenticated?

Most tools are public — no token required. Authenticated tools
(`generate_qr_url`, and the [product write tools](/guides/mcp-tools)) use
**OAuth 2.1 with a step-up authorization flow**: the agent first connects
unauthenticated, calls a public tool, and only triggers the OAuth dance
when it tries to call an authenticated tool. There's no upfront token
registration for the common case. The write tools require an end-user
token (the `authorization_code` grant) rather than `client_credentials` —
every write is attributed to the authorizing user in the audit trail.

For agents that need authenticated access from connect time, Closient
supports three client registration paths: Client-Initiated Metadata
Discovery (CIMD), Dynamic Client Registration (DCR), and manual
pre-registration. See [MCP Authentication](/guides/mcp-authentication).

## Can I use the MCP server in my own application (not Claude/Cursor)?

Yes — any client that speaks the Model Context Protocol can connect.
The Streamable HTTP transport is the modern default; the SSE transport
is kept for older clients. The [protocol spec](https://modelcontextprotocol.io)
documents the wire format; Closient implements the standard, so any
conformant client works without bespoke code.

## Where do I learn more?

<CardGroup cols={2}>
  <Card title="Install the MCP Server" icon="download" href="/guides/mcp-install">
    One-click and CLI install for Claude Code, Cursor, Claude Desktop, VS Code, Windsurf.
  </Card>

  <Card title="MCP Quickstart" icon="rocket" href="/guides/mcp-quickstart">
    Two-minute walkthrough from `ping` through your first resolution.
  </Card>

  <Card title="MCP Tools Reference" icon="wrench" href="/guides/mcp-tools">
    Input/output schemas and example JSON-RPC envelopes for every tool.
  </Card>

  <Card title="MCP Authentication" icon="key" href="/guides/mcp-authentication">
    OAuth 2.1 step-up flow, scopes, and client registration options.
  </Card>
</CardGroup>

<script
  type="application/ld+json"
  dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
  "@type": "Question",
  "name": "How can AI agents look up product data from a barcode?",
  "acceptedAnswer": {
    "@type": "Answer",
    "text": "Closient runs a hosted Model Context Protocol (MCP) server at https://www.closient.com/mcp/http. Any MCP-compatible AI client — Claude Code, Claude Desktop, Cursor, VS Code, Windsurf — can connect with one command and call tools that validate GTINs, resolve them to product data, search the catalog by natural language, compare products, and check local availability."
  }
},
{
  "@type": "Question",
  "name": "Is there an MCP server for GTIN resolution?",
  "acceptedAnswer": {
    "@type": "Answer",
    "text": "Yes. Closient operates a hosted MCP server at https://www.closient.com/mcp/http using the Streamable HTTP transport. It exposes read tools covering GTIN validation, resolution, product lookup, natural-language search, comparison, and local availability, plus OAuth-gated write tools for QR URL generation and full brand-owner product entry (create/update products, images, documents, videos, nutrition, ingredients). The server is GS1 Digital Link aware and follows the same resolution rules that power the public /01/<gtin> resolver."
  }
},
{
  "@type": "Question",
  "name": "How do I connect my AI agent to product data?",
  "acceptedAnswer": {
    "@type": "Answer",
    "text": "If your agent is an MCP client, point it at https://www.closient.com/mcp/http. If your agent is custom-built, use the REST API: the /products endpoint returns structured product data and the /01/<gtin> resolver returns the Digital Link target. Both return JSON, no scraping required."
  }
},
{
  "@type": "Question",
  "name": "What's the difference between calling the MCP server and the REST API?",
  "acceptedAnswer": {
    "@type": "Answer",
    "text": "The MCP server is optimised for AI agents and IDE assistants — JSON-RPC over Streamable HTTP/SSE, OAuth only for write tools, tool list returned at connect. The REST API is optimised for custom code and integrations — HTTPS/JSON, X-API-Key authentication, OpenAPI 3.1 specs per domain. Both are hosted; no local install for either."
  }
},
{
  "@type": "Question",
  "name": "How is the MCP server authenticated?",
  "acceptedAnswer": {
    "@type": "Answer",
    "text": "Most tools are public — no token required. Authenticated tools, including generate_qr_url and the brand-owner product write tools, use OAuth 2.1 with a step-up authorization flow: the agent connects unauthenticated, and only triggers the OAuth dance when it tries to call an authenticated tool. Three client registration paths are supported: CIMD, DCR, and manual pre-registration."
  }
},
{
  "@type": "Question",
  "name": "Can I use the Closient MCP server in my own application, not Claude or Cursor?",
  "acceptedAnswer": {
    "@type": "Answer",
    "text": "Yes. Any client that speaks the Model Context Protocol can connect. The Streamable HTTP transport is the modern default; the SSE transport is kept for older clients. Closient implements the standard protocol, so any conformant client works without bespoke code."
  }
}
]
}) }}
/>
