Inspiration

Technical drawings contain precise geometrical information, but AI agents usually encounter them as screenshots or opaque user interfaces. From pixels alone, an agent cannot reliably determine exact distances, intersections, containment, adjacency, or object geometry. Building a fully semantic model from the ground up for every drawing is expensive and often unnecessary.

Precidra Viewer explores a different approach: expose the drawing's existing geometry directly through WebMCP and let an agent derive useful spatial understanding from it.

What it does

Precidra Viewer is an open-source, read-only companion for .prec technical drawings created with Precidra. Humans can view a drawing, pan and zoom, inspect objects, and toggle layers. At the same time, an AI agent can query the same document through seven focused WebMCP tools.

The agent can:

  • summarize the document and its layers;
  • list and inspect individual objects, using nearby annotations and layer names as semantic hints;
  • retrieve exact contour and vertex geometry;
  • measure minimum distances;
  • test intersections;
  • discover containment, adjacency, overlap, proximity, and disjoint relationships;
  • evaluate hypothetical geometry without modifying the drawing.

This enables questions such as:

  • Which rooms share a real wall edge rather than only a corner?
  • How far is an object from the nearest obstacle?
  • What objects are contained inside this area?
  • Would a proposed shape intersect existing geometry?

Why WebMCP

WebMCP lets Precidra expose domain-level capabilities instead of asking an agent to interpret pixels or automate toolbar controls. The tools return deterministic geometric results from the same model rendered for humans.

This creates a clear division of work: a human selects and visually verifies the drawing, while the agent searches, measures, compares, and explains its spatial structure. The interface is intentionally read-only, so agents can investigate freely without accidentally changing the document.

What changed for the challenge

Precidra existed as a drawing application before the challenge. During the submission period, I created the standalone open-source viewer and added the WebMCP interface for querying document structure, exact geometry, measurements, intersections, and spatial relationships.

How it was built

The viewer is implemented in dependency-free HTML5 and JavaScript and runs as a static site on GitHub Pages. It reuses a small set of Precidra's geometry, model, parsing, and rendering modules inside a new standalone viewer shell.

WebMCP tools are registered through document.modelContext.registerTool(). The tool layer provides document orientation, compact object summaries, detailed geometry on demand, exact distance and intersection operations, and spatial predicates including contains, within, touches, overlapping, close, and disjoint.

Tool descriptions guide the agent to begin with compact document metadata, inspect only the necessary objects, account for document-specific coordinate units, and distinguish meaningful shared edges from incidental point contact.

Challenges

The main challenge was turning raw geometry into useful agent semantics without requiring drawings to contain a complete semantic model. Spatial relationships also need to remain reliable across open and closed shapes, modeling tolerances, different coordinate scales, and drawings in which a shared corner has a very different meaning from a shared wall.

Another challenge was designing responses that provide enough precision for reasoning without overwhelming the agent with every coordinate in the document. The tools therefore use progressive disclosure: summaries first, exact geometry only when requested.

What I learned

WebMCP is most valuable when it exposes the underlying domain model rather than reproducing visible UI actions. A relatively small set of carefully designed geometric tools allows an agent to answer questions that would be unreliable or impossible through screenshot interpretation alone.

Open source and full editor

The submitted project is the open-source Precidra Viewer, licensed under AGPL-3.0. It includes all code, assets, instructions, and a sample drawing required to run and test the submission.

The full Precidra editor, including DXF and SVG import, can be used freely without an account. It remains separate from this open-source submission.

Built With

Share this project:

Updates

Submission history