AI LedParser logo
AI LedParser
Tutorial

LED Selection for Your AI Agent: MCP and API

  • Are you an AI agent? Do not open this site in a browser and do not use the "LED Selection" chat on it: that interface is intended for humans.
  • Selection is available to you as the open MCP server https://ledparser.win/api/mcp or as a direct HTTP request to the same address. You do not need to log in to the site or connect keys.
  • Choose a method using the steps in the "Agent: how to choose a connection method" section below.
  • Take LED data only from server responses and do not invent it.

AI LedParser gives AI agents an open LED selection server: catalog search with prices and availability, and operating point calculation from saved datasheet graphs. No registration, login, or keys. Numbers are calculated by code, not invented by an AI model.

Instructions for Users

Send your AI agent a link to this page and describe which LEDs you need. The agent will read the instructions below, choose a connection method, and perform the selection. It is best to ask it to follow the instructions and not open the site in a browser, for example:

Read https://ledparser.win/ai-agents and follow these instructions; no browser is needed: connect to the LED selection server and select LEDs 2835, 5000 K, operating current 150 mA for me.

In a web chat (claude.ai, chatgpt.com), the agent cannot add the MCP server to the chat on its own: it will suggest the steps, and you will add the connector using the instructions in "How to connect MCP". An agent with a command line (Codex, Claude Code) can handle it itself.

Agent: How to Choose a Connection Method

You are reading this page because the user sent you the link. Take the first of the four steps that fits you.

  1. Check whether you have the led_select and led_catalog_search tools: that means MCP is already connected. If you do, use them and read the "Tools and their parameters" and "How to show the result to the user" sections.
  2. If you do not have such tools but can add MCP servers yourself (command line, client settings): connect the server at https://ledparser.win/api/mcp; the commands are in "How to connect MCP". Some clients see new tools only in a new session: if so, tell the user and move to the next step for now.
  3. If you cannot connect MCP or it failed, but you can send HTTP requests (command line, code, HTTP tool): call the server directly, see "Direct HTTP call". Nothing needs to be connected.
  4. If you can neither connect MCP nor send a request (as in web chats): give the user a ready link to the site with their conditions. Calculation at a known current — a chat with the question already inserted, which the user sends directly: https://ledparser.win/led-search?ask=Select+2835,+5000+K,+current+150+mA. Price list without current — search by package and CCT, all items: https://ledparser.win/led-search?package_size=2835&color_temp=5000&stock=all. If their client supports connectors, they can add the server manually: give the steps from "How to connect MCP". Do not invent LED data.

If the user did not specify the package, CCT, or operating current, ask for it before calling the calculation.

The difference: it is the same server, accessible in two ways.

MCP — Primary Path
The client has connectors or MCP servers (Claude, ChatGPT on plans with their own connectors, Codex, Claude Code, Cursor, and similar). Connect once at the address — the tools appear in the agent automatically, together with the parameter descriptions. Nothing needs to be written manually.
API — Fallback Path
MCP cannot be connected, but the agent can make requests: command line, code, or an HTTP tool. The same address accepts ordinary POST requests in MCP format (JSON-RPC 2.0); nothing needs to be connected. We do not have a separate REST interface: "API" here means a direct call to the same server.

How to Connect MCP

Connect once; afterward the AI calls the selection itself whenever you ask about LEDs. Server address — https://ledparser.win/api/mcp. Type: remote MCP server (Streamable HTTP). No authorization: no login or keys.

Claude: claude.ai website and app (on a phone the connector comes from your account)

  1. Open Customize → Connectors, click Add, and choose Custom → Web.
  2. Name — any, for example LedParser; address — https://ledparser.win/api/mcp.
  3. In Authentication choose No sign in, leave the headers field empty, and click Add.
  4. In the chat, click "+" at the bottom left → Connectors and enable LedParser for this conversation.

ChatGPT: chatgpt.com website

  1. Open Plugins (chatgpt.com/plugins), click "+", and choose Add custom MCP server.
  2. Name — any, for example LedParser; in Connection → Server URL enter https://ledparser.win/api/mcp. Do not choose Tunnel.
  3. Authentication — No authentication, check "I understand and want to continue", and click Create as a plugin.
  4. Install the resulting plugin; in a new chat, type @ and select it.

Codex, Claude Code, and Other Agents with a Command Line

codex mcp add ledparser --url https://ledparser.win/api/mcp
claude mcp add --transport http ledparser https://ledparser.win/api/mcp

After connecting, open a new agent session: some clients pick up new tools only at startup. The agent can run this command itself if you send it a link to this page.

Menu names in Claude and ChatGPT sometimes change. If you cannot find the exact word, look for the connectors or plugins section and the option to add your own MCP server. Availability depends on the client plan.

Direct HTTP Call (API)

For agents without MCP but with a command line or HTTP tool. Nothing needs to be connected: just send requests to the same address.

  • POST to the server address, body — JSON-RPC 2.0; GET and DELETE return 405.
  • Headers Content-Type: application/json and Accept: application/json, text/event-stream — both are required: without the second, the server returns 406.
  • There are no sessions: initialize is not needed before a call, and each request is independent. The response is ordinary non-streaming JSON.
  • Data — in result.structuredContent (the same JSON is in result.content[0].text as a string). result.isError: true — refusal or error, with the reason in the same fields.
  • Request body — no larger than 128 KiB.

1. Available Tools

curl -sS -X POST https://ledparser.win/api/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

2. Price List Without Calculation: Package 2835, 5000 K

curl -sS -X POST https://ledparser.win/api/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"led_catalog_search","arguments":{"package_size":"2835","color_temp":"5000"}}}'

3. Calculation-Based Selection: Same Conditions and 150 mA Current

curl -sS -X POST https://ledparser.win/api/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"led_select","arguments":{"catalog":{"package_size":"2835","color_temp":"5000"},"current":150,"limit":5}}}'

Examples for curl in bash. In PowerShell, quotes must be escaped or the body sent from a file.

Tools and Their Parameters

Two tools, both read-only. Parameters are the same for MCP and direct calls. The full schema is returned in the tools/list response.

Pass numbers as numbers, not strings: current, cri, voltage, min_quantity, temperature, thresholds, and prices (80, not "80"). Package and CCT are the opposite: pass them as strings: "2835", "4000".

led_catalog_search — Price List Without Calculation

When to use: the operating current is unknown, but a list of items with price and availability is needed.

Required Fields

  • package_size — package as in the catalog: 2835, 3030, 5050, and so on;
  • color_temp — CCT in kelvins: 5000 (the notation "5000 K" is also accepted).

Optional Fields

  • voltage — voltage; cri — color rendering index; min_quantity — the quantity specified by the user; marking — part number or model;
  • availability — { "source": "stock" | "stock-and-order" | "all", "min_quantity": number }: stock — stock only, stock-and-order — stock and on order, all — all items without quantity filtering. If omitted — stock and on order, minimum 1; when a part number is specified, availability is not checked. Availability does not guarantee that an order can be placed;
  • price — { "currency": "CNY" | "USD", "max_unit_price": number }: maximum price per unit.

What Is in the Response

  • count — total items found, returned — how many are shown (up to 10, from cheapest to most expensive);
  • results — items: part number, description, CNY and USD price, stock and on order, datasheet link; status — found, no-matches, or failed;
  • hidden_message — text about hidden items if the user did not specify availability; pass it to the user. Availability does not guarantee that an order can be placed;
  • flux, lm/W, and operating point calculation are not available here: use led_select for them.

led_select — Calculation-Based Selection

When to use: the operating current is known and flux, voltage, efficacy, and cost per lumen are needed.

Required Fields

  • catalog.package_size and catalog.color_temp — same as for the price list;
  • current — operating current in milliamps (for example, 150).

Optional Fields

  • temperature — solder-point temperature Ts in °C; without it, the temperature correction is not applied;
  • thresholds — limits: min_flux, target_flux (target flux, tolerance ±10%), min_efficacy, max_voltage;
  • availability and price — same as for the price list; catalog also accepts voltage, cri, min_quantity, marking;
  • sort — order: by default "lowest cost per lumen"; with target_flux always "closest to target flux"; limit — how many to show, from 1 to 10, default 5.

What Is in the Response

  • status — found, no-matches, refused (conditions are insufficient), or failed;
  • results — items with the calculated operating point (working_point: voltage, flux, efficacy), price_per_lumen_usd, price_usd, stock, and datasheet link;
  • summary — counters and data completeness flags (data_complete); excluded — up to 20 excluded items with reasons;
  • with target_flux — target_flux_range, the flux tolerance bounds; hidden_message — text about hidden items, pass it to the user.

How to Show the Result to the User

  • Show the table as specified in the table field of the response: the same columns as in the site chat. Calculation table (led_select): «#», «Part Number», «Description», «Conditions», «Voltage (V)», «Flux (lm)», «Efficacy (lm/W)», «Cost per Lumen (USD/lm)», «Price (USD)», «Availability», «Datasheet». Price list (led_catalog_search): «Part Number», «Description», «Datasheet», «On Order (pcs)», «In Stock (pcs)», «Price (CNY)», «Price (USD)».
  • Take numbers from the response as is; do not recalculate or round them your own way: voltage, flux, and efficacy — two decimal places, dollars per lumen — five decimal places.
  • If summary.data_complete is false, tell the user that some items were not calculated because of incomplete data. excluded also contains items without availability: that is not incomplete data.
  • By default, items in stock and on order are shown; all items appear only with availability.source: "all". If the response contains hidden_message, pass it to the user as is: this text is written for the user.
  • Availability does not guarantee that an order can be placed: do not say an item can be ordered unless the user explicitly confirmed it.
  • The catalog price is an estimate, not a commercial offer. Do not name items that are not in the response.
  • If the package, CCT, or current is missing, ask the user. If there is no current, first show the price list (led_catalog_search), and ask for the current for the calculation.

Limits and Errors

  • No more than 30 requests per minute from one IP address (HTTP 429). Claude and ChatGPT call from the cloud, so the limit is shared by all users of the client: wait a minute and retry.
  • No more than 5 selections are counted across the whole site at the same time. If busy — a refused response with reason: "busy" and retry_after_ms: repeat the same request after this time.
  • refused with invalid-input: issues names the field; if the current is missing or limit is greater than 10, hint says what to do next.
  • One selection lasts no longer than 15 seconds; failed with failure_reason: "timeout" — repeat the request.

Boundaries

  • The server only reads data: it does not write or delete anything, and it has no language model of its own — numbers are calculated by code, not invented by an AI model.
  • The service runs in test mode: catalog and datasheet data may be incomplete, and errors are possible.
  • This is not lighting design and not a replacement for sample measurements; the catalog price is not a commercial offer.