Skip to content
barcoder

MCP Connector

barcoder-codec

A local MCP server that exposes the Barcoder encyclopedia to AI agents. Search standards, generate scannable barcodes, decode images, and identify payloads — all from Claude Code or any MCP-compatible client.

Install

Quick start

The server ships as a Node/TypeScript package inside the repo. No hosting, no ports — it runs as a stdio subprocess that Claude Code starts on demand.

Step 1 — Clone and install

git clone https://github.com/barcoder/barcoder.git cd barcoder/mcp npm install

Step 2 — Build the server

npm run build   # from mcp/ — emits mcp/dist/server.js

Step 3 — Open Claude Code

claude # On first connect, approve the project MCP server trust prompt

That is all. The .mcp.json file (committed in the repo root) tells Claude Code how to start the server. No configuration files to edit, no environment variables to set.

Manual MCP setup

If you are not using Claude Code, the .mcp.json at the repo root defines a stdio server at mcp/dist/server.js. Point your MCP client at it:

// .mcp.json
{
  "mcpServers": {
    "barcoder-codec": {
      "type": "stdio",
      "command": "node",
      "args": ["./mcp/dist/server.js"],
      "env": {
        "BARCODER_DOCS_DIR": "./docs"
      }
    }
  }
}

The server reads from docs/standards/ to build an in-memory search index at startup. Set BARCODER_DOCS_DIR if your docs live elsewhere.

Tool Catalog

The server exposes 9 tools across four domains: search, encoders, generation, and decoding.

ping

tool

Health check. Returns server name and version.

{
  "tool": "ping",
  "args": {}
}

search_standards

tool

Search the standards encyclopedia. Supports query, type filter, playground-only, and limit.

{
  "tool": "search_standards",
  "args": {
    "query": "pix",
    "with_playground_only": true
  }
}

get_standard

tool

Full detail for one standard by id, including playground field schema and defaults.

{
  "tool": "get_standard",
  "args": {
    "id": "pix"
  }
}

list_encoders

tool

Enumerate all available barcode/QR encoders (40+). Optionally filter by query string.

{
  "tool": "list_encoders",
  "args": {}
}

get_encoder_schema

tool

Get the form schema for one encoder — field definitions, types, defaults, and a sample payload.

{
  "tool": "get_encoder_schema",
  "args": {
    "encoder": "wifi-qr"
  }
}

generate_code

tool

Build a scannable barcode/QR image from structured field input. Returns payload + rendered PNG/SVG.

{
  "tool": "generate_code",
  "args": {
    "encoder": "pix",
    "values": {
      "mode": "static",
      "keyType": "evp",
      "pixKey": "123e4567-e89b-12d3-a456-426614174000",
      "merchantName": "Store",
      "merchantCity": "CITY",
      "mcc": "5411"
    }
  }
}

identify_payload

tool

Identify a raw/pasted payload string — returns matching standard, confidence score, and decoded fields.

{
  "tool": "identify_payload",
  "args": {
    "text": "upi://pay?pa=merchant@okhdfcbank&am=100&cu=INR"
  }
}

decode_image

tool

Decode an image file or base64 string into barcode/QR payload(s). Supports QR, Code128, PDF417, DataMatrix, Aztec, EAN/UPC.

{
  "tool": "decode_image",
  "args": {
    "image_path": "./receipt.png"
  }
}

scan_and_identify

tool

End-to-end: decode an image AND identify what standard each symbol belongs to. Returns payload, top match, and links.

{
  "tool": "scan_and_identify",
  "args": {
    "image_path": "./receipt.png"
  }
}

How It Works

The server imports the same ~40 encoder modules and the 31-pattern matcher that the frontend website uses. It never reimplements encoding or identification logic. This means the MCP tools always produce the same payloads as the web playgrounds.

Image decoding uses sharp for rasterization and zxing-wasm for multi-format barcode detection — QR, Code128, PDF417, DataMatrix, Aztec, EAN/UPC, ITF, and more.

Design principle

One source of truth. The MCP server imports the frontend's ENCODERS registry and matcher.ts — never reimplements them. A reimplementation would silently drift from the ~40 golden-vector-tested encoders.

source · mcp/