API & MCP
Everything a person can do on Ohmforge LED Resistor Calculator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://ohmforgeledresistor.usefulweb.site/api/v1/calculate– run Ohmforge LED Resistor CalculatorGET https://ohmforgeledresistor.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Ohmforge LED Resistor Calculator
Calculates the series resistor for one or more LEDs in series: R = (Vs − n·Vf) / I, rounds up to the next E6/E12/E24 value, and then verifies the actual current, LED voltage and resistor dissipation by simulating the circuit with Ohmforge's diode model. Suggests a power rating with 2× margin.
| Field | Type | Default | Description |
|---|---|---|---|
supply (required) | number | 9 | Supply voltage |
colour | select (red, orange, yellow, green, blue, white, ir, custom) | "red" | LED colour |
vf | number | — | Forward voltage (custom). Only used for "Custom". |
current (required) | number | 20 | LED current |
count | integer | 1 | LEDs in series |
series | select (E6, E12, E24) | "E12" | Resistor series |
Example request
Red LED on 9 V at 20 mA
curl -X POST https://ohmforgeledresistor.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"supply":9,"colour":"red","current":20,"count":1,"series":"E12"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://ohmforgeledresistor.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
ohmforge_led_resistor - Local stdio connector:
node src/mcp-stdio.ts --tool=ohmforge-led-resistor
{
"mcpServers": {
"ohmforge-led-resistor": { "type": "http", "url": "https://ohmforgeledresistor.usefulweb.site/mcp" }
}
}