API & MCP
Everything a person can do on Ohmforge AC Sweep (Bode plot), a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://ohmforgeacsweep.usefulweb.site/api/v1/calculate– run Ohmforge AC Sweep (Bode plot)GET https://ohmforgeacsweep.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Ohmforge AC Sweep (Bode plot)
Linearises the circuit at its DC operating point and solves the complex MNA equations across a logarithmic frequency sweep. Returns magnitude in dB and unwrapped phase of an output node (optionally relative to an input node), the peak gain, lower/upper −3 dB frequencies, the unity-gain frequency, a Bode chart and CSV.
| Field | Type | Default | Description |
|---|---|---|---|
netlist | textarea | — | SPICE netlist. Subset: R C L V I D Q M E G K, X subcircuit instances with .subckt/.ends (nested, with params), .param and {expressions}, .model, SIN/PULSE/PWL sources, engineering suffixes (k, m, u, n, p, meg). Node 0 is ground. Leave empty when you pass an Ohmforge project instead. |
project | textarea | — | Ohmforge project JSON (optional). Alternative to the netlist: a .ohmforge.json project as saved by the app (format "ohmforge", version 1). |
output (required) | text | "out" | Output node |
input | text | — | Input source (gets AC = 1). Name of the V or I source to excite (e.g. V1). Empty = keep the AC magnitudes from the netlist. |
inputNode | text | — | Reference node (optional). Report V(out)/V(ref) instead of V(out). |
fstart | number | — | Start frequency. Empty = .ac line or 1 Hz. |
fstop | number | — | Stop frequency. Empty = .ac line or 10 MHz. |
pointsPerDecade | integer | — | Points per decade. Empty = .ac line or 20. |
Example request
RC low-pass (fc ≈ 1.59 kHz)
curl -X POST https://ohmforgeacsweep.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"netlist":"* RC low-pass, fc = 1/(2*pi*1k*100n) = 1591.5 Hz\nV1 in 0 DC 0 AC 1\nR1 in out 1k\nC1 out 0 100n\n.ac dec 20 10 1meg","output":"out","input":"V1"}'
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://ohmforgeacsweep.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
ohmforge_ac_sweep - Local stdio connector:
node src/mcp-stdio.ts --tool=ohmforge-ac-sweep
{
"mcpServers": {
"ohmforge-ac-sweep": { "type": "http", "url": "https://ohmforgeacsweep.usefulweb.site/mcp" }
}
}