Commonplace kernel API
    Preparing search index...

    Build models with an AI agent

    An AI agent such as Claude can build a model with the kernel. You describe what you want in words, and the agent makes it one step at a time. It looks at the result, checks it, and saves and exports it. It does this through @commonplace-technologies/kernel-mcp, a server that speaks the Model Context Protocol (MCP), the standard way an agent uses outside tools. You do not write any code.

    You need Node 20 or later and an MCP host: an app that runs agents with tools, such as Claude Code or Claude Desktop.

    Claude Code. In the folder the model should live in, run:

    claude mcp add kernel -- npx -y @commonplace-technologies/kernel-mcp "$PWD/model.json"
    claude

    Claude Desktop. Open Settings, then Developer, then Edit Config, and add the server to claude_desktop_config.json. Use the full path of the file the model should be saved in:

    {
    "mcpServers": {
    "kernel": {
    "command": "npx",
    "args": ["-y", "@commonplace-technologies/kernel-mcp", "/Users/you/Models/pavilion.json"]
    }
    }
    }

    Then restart Claude Desktop.

    The model lives in one file. If the file does not exist yet, the agent starts with an empty model and writes the file when it saves. Your host asks you to approve each tool call unless you allow the tools in advance.

    Describe the model as you would to a colleague, with sizes:

    Build a small garden canopy in meters: a curved roof about 4 m long and 3 m across, rising to 2.6 m, that bends from flat sheet and is 30 mm thick. Put it on two turned columns and cut a rectangular opening in the roof. Check it from two directions, then save it, export STEP, and lay the roof flat for cutting.

    What the agent does with a request like this:

    1. Plans the parts and their sizes.
    2. Builds each part with the kernel's verbs. It makes the roof as a developable sheet, gives it a thickness, and turns each column from a profile.
    3. Cuts and joins with the Booleans. It makes the opening as a box in a body of its own and subtracts that box from the roof.
    4. Looks at the model. The view tool sends the agent a picture, so it sees what it built and corrects what is wrong.
    5. Checks the model. measure gives volume and area and runs the kernel's validator.
    6. Saves and exports: a STEP file for CAD or fabrication, STL or OBJ, and a paper pattern that lays every face flat on pages at a real scale.

    It is worth asking for a check by eye ("look at it from the front and the top") and a report at the end ("tell me what was refused and why").

    The agent uses the same verbs a program uses, with the same rules. Every step either leaves a valid model or is refused. A refusal is a code and a sentence saying why, and the model is left as it was. The agent reads the reason and tries another way. It cannot leave a broken model behind.

    The agent can With
    Make boxes, cylinders, lines, rectangles, circles, arcs and curves make_box, make_cylinder, draw_line, draw_rectangle, draw_circle, draw_arc, draw_curve
    Push and pull faces, thicken sheets, inset outlines offset
    Revolve, loft, sweep along a path, skin between two edges revolve, loft, sweep, skin
    Make sheets that bend from flat stock develop
    Unite, subtract and intersect combine
    Move, turn, copy and scale transform_body, transform_entities
    Round edges, fill openings, erase fillet, patch, erase
    Mark creases and fold mark_crease, fold
    Find faces and edges, measure, check list_faces, list_edges, describe, pick, measure, model_summary
    See the model view
    Undo, redo, save undo, redo, save, set_units
    Export export_model (STEP, STL, OBJ), export_paper_pattern (PDF or SVG)

    The kernel's limits are the agent's limits. It has no general blends, and there are no surface kinds beyond flat, ruled and developable faces (imported parts aside). Refusals and canRun lists every refusal code.

    A model holds named bodies, such as roof, column 1 and cutter. Undo takes back the last edit, whichever bodies it changed. Lengths are in meters unless the agent is told to use other units. Exports are written next to the model file and never outside its folder.

    To run the server from a copy of this repository, for example to try a change to it:

    git clone https://github.com/commonplace-technologies/kernel
    cd kernel
    npm ci
    claude mcp add kernel -- npm --prefix "$PWD" run -s mcp -- "$HOME/model.json"

    The server's source is src/kernel-mcp/. It uses only the two public packages, so it also shows how to drive the kernel from a program.