- Home
- Skills
- APIs & Backend
- Desktop App Node Sidecar Engine Host (stdio, no port)
Desktop App Node Sidecar Engine Host (stdio, no port)
Native desktop apps often need logic that already exists as a JavaScript library: a tax or pricing engine, a PDF form filler, a redaction tokenizer, a renderer.
$29
Works with the AI Agents you already use
Desktop App Node Sidecar Engine Host (stdio, no port)
Example session with this skill installed
I need to run a Node-based PDF form filler inside my C# WinForms app. How do I define a 'fill-pdf' operation and call it from the app?
- Read your context and instructions
- Compiled the desktop app node
I have defined the operation in the host script and configured the C# client to call it.
Implementation details
In scripts/host.mjs, the operation is added to the engine:
import { createHost, fail } from './host.mjs';
import { fillPdfBuffer } from 'pdf-lib-wrapper';
const ops = {
'fill-pdf': async ({ templatePath, data }) => {
try {
const result = await fillPdfBuffer(templatePath, data);
return { bytesSent: result.length, path: templatePath };
} catch (err) {
throw fail('PDF_ERROR', err.message, { templatePath });
}
}
};
createHost(ops).serve();
In your C# WinForms project, use the SidecarClient to invoke it:
var client = new SidecarClient("node.exe", "host.mjs", AppContext.BaseDirectory);
try
{
var args = new { templatePath = "form.pdf", data = new { Name = "John Doe" } };
var result = await client.Call("fill-pdf", args);
Console.WriteLine($"Filled: {result["path"]}");
}
catch (SidecarException ex) when (ex.Code == "PDF_ERROR")
{
MessageBox.Show($"Failed to fill PDF: {ex.Message}");
}
Next steps
- Add the
pdf-libdependency to your sidecar'spackage.json. - Copy
reference/SidecarClient.csinto your .NET solution. - Run the smoke test to verify
node.execan see the host script.
Connects securely to your tools. The creator never sees your data.
About this skill
Native desktop apps often need logic that already exists as a JavaScript library: a tax or pricing engine, a PDF form filler, a redaction tokenizer, a renderer. Rewriting it forks the logic, embedding a browser is heavy, and a local HTTP port means firewall prompts and port clashes. This is the thin alternative.
Host (host.mjs): a JSON-lines server over stdin/stdout. One request object per line in, one reply per line out, answered in order through a single queue; { id, ok, result } or { id, ok: false, error: { code, message, errors? } }; UNKNOWN_OP, BAD_REQUEST, LINE_TOO_LONG (16 MiB ceiling, not buffered) and ENGINE_ERROR with messages capped at 500 characters; prototype names cannot be dispatched; the process exits when stdin closes. createHost(ops) builds a host from your own operations table; the pattern for lazy engine loading keeps startup in milliseconds.
Clients: client.mjs for Node and reference/SidecarClient.cs for .NET 8+, both implementing the same rules: lazy start on first call, replies matched by id so several calls can be in flight, pending calls failed with ENGINE_STOPPED when the process exits and a transparent restart on the next call, ENGINE_TIMEOUT per call, ENGINE_MISSING when the runtime or script is absent, and close/Dispose ending the host by closing its stdin.
3 tests: dispatch and the error contract, the real stdio protocol with a spawned host, and the client against a host that crashes and sleeps (restart, timeout, close). reference/runtime-pinning.md: pinning node.exe by SHA-256, start arguments, the symlink pitfall, the build-time smoke test and the contract rules.
Node 20+, no packages, no network.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Single ordered queue per host instance. Payloads over 16 MiB require file-based transfer. .NET client provided as source code rather than a compiled library.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 17 days ago
- Software
Node.js 20+