I gave my browser CAD an MCP server. Now the model builds parts for 5 roubles
DEV Community

I gave my browser CAD an MCP server. Now the model builds parts for 5 roubles

I make KontrCAD - a parametric CAD that runs entirely in a browser. Not a viewer and not a mesh toy: sketches with a constraint solver, extrude, loft, sweep, fillets, assemblies. Everything is computed on the client, with no server round trips.

For a year the app had one obvious gap. Every simple part - a case for a board, a bracket, a lid for a box - I built by hand. The same twenty operations, in the same order, every time. So I did what everyone does in 2026: I gave the model tools.

Why MCP fits a CAD unusually well

KontrCAD stores a project as a list of operations. A tool never touches geometry: it writes a parameterised operation into the model, and an executor replays the list. That is why a 2,000-operation project weighs 160 KB and why you can step through someone else's build like a slideshow.

The important part: the document is already an API. create_primitive with a box and dimensions, extrude with a sketch region, boolean_subtract, fillet_chamfer with edge coordinates. Every button in the UI writes exactly the same operation. Which is precisely the shape of a tool call.

So an assistant does not "generate a mesh". It builds the same parametric model a human would, step by step, and afterwards you can open the history and change any number in it. The output stays editable. That is the difference from "AI generated an STL" demos: you get a model, not a mesh.

Two transports: browser and desktop

Web version (WebMCP). The editor registers its tools inside the tab, and a client attached to that tab drives it directly. Chrome 126+ or Edge, plus a client that speaks WebMCP - the DeepSeek Harness extension, for example. Nothing to install, and the assistant sees exactly what you see. The catch is that the client does not always discover the tools immediately and has to be nudged.

Desktop (Streamable HTTP). The Electron build starts a local MCP server on http://127.0.0.1:3100/mcp. Streamable HTTP, the transport current clients expect. It lives only while the app runs, listens on loopback only, and has no auth - fine for localhost, a terrible idea to expose.

If you work in a browser, use the first option; if you want a "full" assistant inside Cursor or Claude Desktop, use the second.

89 tools, and the context bill

The server exposes 89 tools: eight groups plus three meta-tools.

  • core - scene reading, 18 primitive types, transforms, booleans, 3D text.
  • history - undo/redo/jump, parameter edits, operation descriptions.
  • lesson - teaching mode: lesson state, step navigation, view/practice, UI highlighting.
  • sketches - planes, entities, constraints, DOF analysis, extrude/revolve/sweep/loft.
  • images - viewport screenshot, preview render, a four-view mosaic.
  • library, files, advanced - model library, projects and export, fillets, threads, gears, arrays, assemblies.

Dumping 89 schemas into every request is a good way to burn money and confuse the model. So the web build starts with core only - 15 tools plus 3 meta - and the assistant opens the group it needs when it realises it needs it.

What actually saved tokens:

  • get_help(topic). Long instructions are not in the schemas. The model asks for the one it needs, when it needs it. Schemas stay short.
  • batch. Several operations in one call, with rollback: true: if a step fails, the scene returns to the state before the batch instead of leaving debris that the model then has to clean up with more calls.
  • expect. Many tools accept the expected bounding box and volume. The model learns immediately that the size is wrong - no separate "let me check" round trip.
  • Render for the model, not for humans. Instead of four screenshots it can request one image with four views, the part framed. One image instead of four, and no need to stitch context.

The built-in chat

External clients are fine for people who already live in Cursor. Everyone else wants a button. So there is an AI tab inside the editor. You paste a provider key and it stays on your device - no proxy through my servers, which also means I never see your chats.

DeepSeek, OpenAI, Claude through OpenRouter, Gemini, Groq, Mistral, GigaChat, Ollama, or any OpenAI-compatible endpoint. The model list comes from the provider's API, so new models appear without an app update.

Roles turned out to be the most useful part:

  • Engineer builds and edits, no confirmations. The default.
  • Teacher explains and makes the student do the work. Ask it to "do it for me" and it answers with a two-to-four step plan and asks you to do step one.
  • Analyst reads the scene - dimensions, edge coordinates, degrees of freedom - and asks before touching anything.

Destructive calls from the last two arrive as a card with the tool name and arguments: allow or reject. If nobody answers within three minutes, the call is dropped.

The unexpected win was the Teacher role in classrooms: the assistant stopped being a "do my homework" button and became a TA that refuses to do the exercise.

What does not work

Models cannot read minds. "Make it pretty" produces garbage. You have to state dimensions and what mates with what.

Quality varies a lot. DeepSeek and Claude produce sane operation sequences. Weak and local models are still worth a try - a box, a lid, a bracket, especially through Ollama, where nothing leaves your machine. But do not expect a steam locomotive. For assemblies I would reach for something bigger.

And never let an assistant loose on a project you care about without a backup. The operation history is the undo button, and it has saved me more than once.

The bill

A chess set, built entirely by the assistant: 7.6M tokens, 99% of them cached. About 5 roubles - roughly six cents - for the whole model, not per operation.

Caching does the heavy lifting. The tool schemas and the conversation barely change between steps, so almost everything is a cache hit. Without it the same run would cost an order of magnitude more.

That number is the real argument for MCP in a CAD: a full parametric model costs less than a coffee.

KontrCAD is free and runs without registration: kontrcad.ru. The MCP setup guide is here. If you build something with it, I would genuinely like to see what breaks.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.