MCP Server
Barcodes and QR codes as a tool for AI agents. MLC Barcode ships a Model Context Protocol server. Connect Claude, Gemini, Cursor or your own agent to it and you can say "make me a payment QR for €49.90 for invoice 1234" in the conversation — and get the finished image back instead of assembling formats by hand.
The server is part of every download: the Windows setup, the Linux suite and the macOS archives, plus as a standalone file.
The eleven tools
| Tool | Purpose | Required |
|---|---|---|
generate_barcode |
Any barcode from raw data: QR, DataMatrix, Aztec, PDF417, Code 128, Code 39, EAN-13, EAN-8, UPC-A, ITF | type, data |
generate_epc_qr |
EPC QR / GiroCode SEPA transfer — every European banking app pre-fills the payment | name, iban |
generate_wifi_qr |
Wi-Fi access (WPA, WEP, open, hidden) | ssid |
generate_vcard_qr |
Business card (vCard 3.0) | first_name, last_name |
generate_event_qr |
Calendar event (iCalendar); time YYYYMMDDTHHMMSS, all-day just YYYYMMDD |
summary, start_time |
generate_crypto_qr |
Payment in Bitcoin, Ethereum and other coins | address |
generate_geo_qr |
Location that opens Google Maps or Apple Maps | latitude, longitude |
generate_tel_qr |
Phone number that opens the dialer | phone_number |
generate_sms_qr |
SMS with recipient and prepared text | phone_number |
generate_email_qr |
Email with recipient, subject and body | to |
decode_barcode |
Reads codes from an image: symbology and content, several per image — to verify generated codes or read photos and scans. Known payloads come back split into fields, e.g. a GiroCode's beneficiary, amount and IBAN with checksum check. | path or image_base64 |
Common options for all tools:
| Option | Meaning |
|---|---|
format |
svg (default, scales without loss) or png |
width, height |
Size in pixels |
fg_color, bg_color |
Colours, e.g. black, #1a1a1c, transparent |
text |
Show a caption below the barcode (the encoded content) |
caption |
Your own caption text, e.g. the product name under an EAN or the name under a vCard |
font_size |
Caption size in pixels (6–200); omitted = automatic. Over-long captions shrink to the barcode width. |
Every successful call returns structured data (structuredContent) next
to the image — including encoded_data: exactly what the code contains,
such as the EAN with its completed check digit or the generated vCard. The
model can check and report it instead of guessing.
Two prompts for the most common jobs
| Prompt | What it does |
|---|---|
payment_qr_from_invoice |
Reads beneficiary, IBAN, amount and reference from invoice text and creates the payment QR — and asks instead of guessing when the IBAN or amount is unclear. |
product_labels |
A list code;label text → one labelled barcode per line; rejected codes are reported together at the end. |
Connecting
The server is called mcp-barcode-server (Windows: mcp-barcode-server.exe)
and speaks stdio by default — the AI client starts it itself.
Where it lives after installation:
- Windows (setup) —
C:\Program Files\MLC Barcode\mcp-barcode-server.exe - Linux suite / macOS archive — wherever you unpacked the archive, e.g.
~/tools/mlc-barcode/mcp-barcode-server
An absolute path is required: clients do not start the server in your working directory, and a relative command fails without a visible message.
Claude Desktop
Edit the file and restart Claude Desktop:
- Windows —
%APPDATA%\Claude\claude_desktop_config.json - macOS —
~/Library/Application Support/Claude/claude_desktop_config.json - Linux —
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"mlc-barcode": {
"command": "C:\\Program Files\\MLC Barcode\\mcp-barcode-server.exe"
}
}
}
On macOS and Linux accordingly:
{
"mcpServers": {
"mlc-barcode": {
"command": "/Users/me/tools/mlc-barcode/mcp-barcode-server"
}
}
}
In JSON every backslash of a Windows path must be doubled.
Claude Code
claude mcp add mlc-barcode -- /path/to/mcp-barcode-server
Gemini CLI
In ~/.gemini/settings.json:
{
"mcpServers": {
"mlc-barcode": {
"command": "/path/to/mcp-barcode-server"
}
}
}
Cursor
In ~/.cursor/mcp.json (global) or .cursor/mcp.json in the project — the
same mcpServers block as above.
Advanced: running it on the network (Streamable HTTP)
For normal use on your own computer you do not need this section — there the AI client starts the server itself (see above).
To run one server for several machines, start it with an address:
mcp-barcode-server -addr :8080
Clients then connect via Streamable HTTP to http://<host>:8080/mcp —
the current network transport of the specification. Older clients that only
speak SSE find the same server at http://<host>:8080/sse.
Browser requests from foreign sites are rejected (protection against DNS rebinding). The server has no authentication of its own — run it only on a trusted network or behind a proxy that authenticates.
Checking that it works
mcp-barcode-server -version
prints the version. In the client, just ask: "Which barcode tools do you have?" — the model should list the eleven tools. If nothing shows up, the path is almost always wrong or the client was not restarted after the change.
Optional: storing in mlcartifact
With -artifact-addr <host:port> (or the environment variable
ARTIFACT_GRPC_ADDR) the server connects to an
mlcartifact service. The tools
then also offer save_artifact and filename, and generated barcodes are
stored there instead of only being returned in the conversation. Without the
flag both options stay out of the schema.
Checked with MCP-Tester
The server is checked against the MCP specification 2026-07-28 with mlc mcp-tester — from the outside, over the real transport, the way a client sees it: quality score 100/100, plus a test script that calls every tool, provokes the error cases and validates the structured results against their schema, and the Streamable HTTP transport rules (headers, error codes, Origin, no sessions). Strict clients such as the official TypeScript SDK reject servers that get this wrong.
More on the protocol
The MCP Handbook explains the Model Context Protocol from the ground up — tools, resources, prompts, transports, security.