Skip to main content
Alpha release. The SDK’s API surface is still moving — breaking changes will ship in minor versions while it’s on 0.x. Pin an exact version (cosmon-agent-sdk==0.1.1) in pipelines you don’t want to fix on upgrade day.
The Cosmon Agent SDK lets you drive the Nexus agent from your own Python code. You describe an engineering outcome — “run a static structural study on this bracket and report the peak stress” — and the agent reasons about the model, plans the operations, drives the CAD/CAE software, recovers from errors, and reports back. Anything an engineer can do in the Nexus app, your code can script, batch, and embed. It works the way the Claude Agent SDK exposes Claude Code: your code talks to the Nexus app already installed and signed in on the machine, not to a cloud API. Under the hood the SDK is a small MCP client — it connects to the local MCP server the app exposes and drives the agent through a single run tool.

Why it’s different from a CAD/CAE API

The usual way to automate engineering software is each vendor’s scripting API — the SolidWorks API, Abaqus Python, PyAnsys, COMSOL’s model API. Those are imperative: you script every operation, one tool at a time, and the script breaks the moment a model isn’t quite what you assumed. The Nexus SDK is goal-level and agentic:

Outcomes, not operations

Describe the result. The agent plans the steps, adapts to the actual model, and handles the edge cases — instead of replaying a brittle macro.

One surface, every platform

The same SDK drives SolidWorks, Abaqus, Ansys, COMSOL, and Fluent — not a different API per vendor.

The same agent as the app

No capability gap: anything Nexus can do interactively, your code can trigger.

Autonomy you dial

From unattended batches to interactive runs where your code answers the agent’s questions and approves its actions — set by the handlers you pass.

The connection model

Four pieces are involved: your code (the SDK), the Nexus app running the agent, the LLM it reasons with, and the CAD/CAE software on your machine. Everything but the model runs locally — including your login and billing, which stay inside the app.

The agent loop

A run isn’t a single call to the model — the agent works in a loop, driving your CAD/CAE software one step at a time and adapting to what it finds, exactly as it does in the app. The SDK streams each step back to you as it happens:
  • Your code never holds an API key. Authentication and billing stay in the installed app. The SDK discovers the running app on localhost and rides it.
  • It acts on the machine it runs on. Like the app, the SDK drives the CAD/CAE software installed locally — that’s the whole point.
  • SDK runs stay out of the app’s UI. A scripted run executes exactly like a chat, but it doesn’t appear in the app’s conversation list — your script owns it. Use a session to keep context across turns; conversations persist and are resumable until you delete them (or mark a run ephemeral). The Guide walks through both.
The SDK requires the Nexus app to be running, signed in, with Developer access turned on (Settings → Developer access). It connects only over loopback and authenticates with a per-launch token the app writes locally — nothing is exposed off the machine.

What you can ask for

A prompt you’d type into the Nexus app is a prompt you can send from the SDK — same agent, same capabilities. So the question “what can the SolidWorks agent do?” has the same answer whether you drive it by chat or by code. The capability guides list what each platform handles, each with a library of example prompts you can lift straight into client.run(...):

Geometry creation

Sketches, features, assemblies, part families — from a description.

Drafting & DFX

Drawings, GD&T, BOMs, and design-for-X checks.

Simulation preprocessing

Cleanup, mesh, materials, and boundary conditions.

Postprocessing

Extract results, compare studies, and report.
See Supported Software for the full platform and version list.

When to use it

Batch automation

Run the same study across dozens of parts, unattended.

Pipelines & CI

Trigger an analysis from a build step or a data pipeline.

Custom tooling

Wire Nexus into an internal app, notebook, or web service.

Reproducible runs

Capture a workflow as code you can re-run and version.

Next steps

Quickstart

Install, enable Developer access, and run your first agent in Python.

Guide

Stream the run, answer the agent with handlers, and run unattended batches.

Examples

Runnable scripts for every capability — streaming, sessions, batches, images.

Python reference

Clients, runs, interaction handlers, streaming, and errors.

Command line

The cosmon CLI — check the connection and run tasks from the shell.