Skip to main content
Glama
Product Barcode MCP Server

Product Barcode MCP Server

by pipeworx-io
README.md
# @pipeworx/product-barcode

Look up any retail product by barcode (UPC-A, EAN-13, EAN-8, GTIN-14) and get name, brand, category, image and size, with the answering source named.

Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 2082+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.

## Tools

- `product_barcode_lookup(barcode, sources?, _apiKey?)` — validates the GTIN check digit first (a wrong digit is refused with the digit it should be, and nothing is sent upstream), then asks the open product databases (Open Food Facts, Open Beauty Facts, Open Pet Food Facts, Open Products Facts) and only if none holds the code asks UPCitemdb. Returns `source`, `source_name`, `source_url`, `name`, `brand`, `category`, `image`, `size`, and `sources_checked` listing every source asked and what it said. `sources: "open_only"` never calls UPCitemdb; `"upcitemdb_only"` skips the open databases.

## Auth

Keyless. The free UPCitemdb trial endpoint needs no key but allows 100 lookups a day per IP, and every Pipeworx caller shares that allowance. When it is used up the tool returns `found:false, reason:"upstream_rate_limited"` with the HTTP 429 named, never an empty success. To use your own allowance, pass a UPCitemdb paid-plan key as `_apiKey`; the pack then calls UPCitemdb's keyed path with it as `user_key`.

## Data sources

- Open Food Facts, Open Beauty Facts, Open Pet Food Facts, Open Products Facts — community databases (ODbL), keyless, no daily cap.
- UPCitemdb — general merchandise database; free trial plan (100 requests a day, no sign-up, same database as the paid plans) and paid plans with a key. Plans and terms: https://devs.upcitemdb.com/ and https://www.upcitemdb.com/terms. Its terms disclaim accuracy ("as-is") and licence the service for the customer's own operations.

Notes for the next person: UPCitemdb records are user-contributed and can be wrong (the codes we checked sometimes carry a title and description from different products), so the Open databases are asked first and `source` is always stated. A code the open databases list with no data entered (a bare scan) is treated as not found there. UPCitemdb answers an unknown but well-formed code with HTTP 200 and an empty `items`, and a code it does not accept with HTTP 400 `INVALID_UPC`.

## Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):

```json
{
  "mcpServers": {
    "product-barcode": {
      "url": "https://gateway.pipeworx.io/product-barcode/mcp"
    }
  }
}
```

### What this endpoint actually serves

`tools/list` at `https://gateway.pipeworx.io/product-barcode/mcp` returns the tools in the table
above **plus five Pipeworx tools**: `ask_pipeworx`, `discover_tools`, `ask_pipeworx_grounded`, `company_register_search` and `company_facts`.
`ask_pipeworx` answers a question this pack does not cover by routing across the
whole catalog, without adding a second MCP server.

Add an option to the same URL:

- `https://gateway.pipeworx.io/product-barcode/mcp?meta=1` lists this pack's tools plus **up to 48 shared Pipeworx tools** (48 when this README was
generated; a connection without an account lists fewer, and its own `tools/list` is the
exact answer on any given day).
- `https://gateway.pipeworx.io/product-barcode/mcp?meta=0` lists this pack's tools alone.

Or connect to the full Pipeworx gateway to get every pack's tools listed
directly, instead of just this one's:

```json
{
  "mcpServers": {
    "pipeworx": {
      "url": "https://gateway.pipeworx.io/mcp"
    }
  }
}
```

Both URLs reach the same gateway and the same 2082+ data sources. The
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
reaches all of them from either one (it is not listed on a `?meta=0` connection).

## No MCP client? Call it over HTTP

This pack takes your own API key (`_apiKey`) — we don't front one for it, so there's no curl here that would run without it. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/product_barcode_lookup`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.

## Run it from npm

`@pipeworx/mcp-product-barcode` is a local stdio bridge to the Pipeworx gateway: your MCP client
starts it with `npx`, and it forwards every call to the same
`https://gateway.pipeworx.io/product-barcode/mcp` endpoint shown above. It needs network access;
there is no offline mode.

```json
{
  "mcpServers": {
    "product-barcode": {
      "command": "npx",
      "args": ["-y", "@pipeworx/mcp-product-barcode"]
    }
  }
}
```

Without a key it calls anonymously, capped at 50 calls a day. A free account
raises that to 200 a day: get a key at https://pipeworx.io/signup and add
`"env": { "PIPEWORX_API_KEY": "<your key>" }` to the server entry.
The key is sent as a Bearer token, the same way a hosted connection sends it,
so calls are metered and billed exactly as they are there.

It lists **only** this pack's tools by default. Set `PIPEWORX_META_TOOLS=1` to
also list `ask_pipeworx` and the other gateway-wide tools.

Behind an HTTPS proxy: Node's built-in `fetch` does not read `HTTPS_PROXY` by
default. Newer Node releases honour it when `NODE_USE_ENV_PROXY=1` is set; check
your Node version's documentation.

## Using with ask_pipeworx

Instead of calling tools directly, you can ask questions in plain English —
this works on the pack endpoint above as well as on the full gateway:

```
ask_pipeworx({ question: "your question about Product Barcode data" })
```

The gateway picks the right tool and fills the arguments automatically.

## More

- [Docs and guides](https://pipeworx.io/docs)
- [pipeworx.io](https://pipeworx.io)

## License

MIT