A minimal, Git-native, declarative BIM engine & Model Context Protocol (MCP) Server for AI agents and humans.
pip install debim==0.9.0 Copy PIP instructions
"debim originated from a simple desire: to make AI calculate accurate Bills of Quantities (BOQ). Asking an LLM to guess building dimensions directly in text leads to fatal hallucinations. An exact mathematical model (BIM) is essential, yet traditional IFC files are bloated and overwhelm AI context windows. The solution is Declarative YAML — but the resulting Building-as-Code engine proved far more transformative than our initial goal."
Traditional BIM tools (like Revit or Archicad) were conceived over 25 years ago for humans clicking with computer mice. They lock architectural data inside heavy, proprietary gigabyte files (.rvt), charge thousands of dollars in annual licenses, and remain completely opaque to modern automation and AI agents.
debim is built on 6 Core Architectural Tenets:
If you use an AI coding assistant (like Antigravity, Cursor, Claude Code, Jules, or ChatGPT/Copilot), you don't even need to install it manually!
"Please read https://github.com/PRIDA-TAKON/debim and AGENTS.md, install debim in my environment, and run debim --help to verify."
Your agent will inspect the repository, install the dependencies, and verify everything automatically.
debim natively implements the official Model Context Protocol (MCP) via FastMCP (Python SDK). It provides LLMs and AI Agents (such as Claude Desktop, Cursor, Cline, Windsurf, Devin, and Antigravity) with deterministic tools to model, inspect, calculate, compile, and visualize buildings directly via function calling.
Add debim to your MCP configuration (claude_desktop_config.json or .cursor/mcp.json):
{ "mcpServers": { "debim": { "command": "debim", "args": ["mcp"] } } } Or run via Docker:
{ "mcpServers": { "debim": { "command": "docker", "args": ["run", "-i", "--rm", "ghcr.io/prida-takon/debim:latest"] } } } Exposed MCP Tools MCP Tool Description Input Parameters debim_validate Validates YAML manifest syntax, structural grid alignments, storey heights, and material references. manifest_yaml: str debim_qto Computes deterministic Quantitative Take-Off (concrete vol, formwork area, rebar kg, structural steel, timber, masonry). manifest_yaml: str debim_cost_template Extracts materials used by the building model and generates a minimal project-scoped price catalog template. manifest_yaml: str debim_cost Maps QTO quantities against unit prices, calculates total project cost, and optionally exports BOQ to CSV. manifest_yaml: str, prices_yaml?: str, export_csv_path?: str debim_compile_ifc Compiles declarative YAML into an open, standardized buildingSMART IFC4 model (.ifc). manifest_yaml: str, output_ifc_path: str debim_generate_viewer Generates a standalone, zero-dependency interactive 3D WebGL HTML viewer with section cut and layer tree. manifest_yaml: str, output_html_path: str Running the MCP Server Locally # Start MCP server over stdio debim mcp 🚀 Quickstart 1. Installation debim is officially available on PyPI and requires Python 3.11+.
Choose your operating system and preferred terminal:
# Option A: Isolated CLI (Recommended via pipx or uv tool) pipx install "debim[all]" # or: uv tool install "debim[all]" # Option B: Standard pip python -m pip install --upgrade pip pip install "debim[all]" # Option C: Windows Package Manager (Zero-Python / One-Click Native) # Note: Manifest is currently pending upstream review on microsoft/winget-pkgs # winget install debim # Verify installation debim --help 🍎 macOS (Terminal / zsh) # Option A: Native Homebrew Tap (Recommended on macOS) brew install PRIDA-TAKON/debim/debim # Option B: Isolated CLI (via pipx) brew install pipx pipx ensurepath pipx install "debim[all]" # Option C: uv tool uv tool install "debim[all]" # Option D: Virtual Environment python3 -m venv .venv source .venv/bin/activate pip install "debim[all]" # Verify installation debim --help 🐧 Linux (Ubuntu / Debian / Fedora / Arch) # Option A: Isolated CLI (Recommended on Ubuntu 23.04+ / Debian 12+) sudo apt update && sudo apt install -y python3-pip python3-venv pipx pipx ensurepath pipx install "debim[all]" # Option B: Virtual Environment python3 -m venv .venv source .venv/bin/activate pip install "debim[all]" # Option C: uv tool uv tool install "debim[all]" # Verify installation debim --help 📦 Package Extras Summary Package Target Command Included Capabilities Core pip install debim Fast CLI, Declarative YAML engine, 3D WebGL viewer generator, QTO, Thai CGD ว480 BOQ (ปร.4/ปร.5), Modular replication, Pure-Python STEP export All (Recommended) pip install "debim[all]" Full suite: Core + IFC4 Compiler (ifcopenshell) + FastMCP Server + DOCX Specification Builder IFC only pip install "debim[ifc]" Core + buildingSMART IFC4/IFC4X3 compiler (ifcopenshell) MCP only pip install "debim[mcp]" Core + Model Context Protocol server for Claude / Cursor / Antigravity DOCX only pip install "debim[docx]" Core + Specification Book compiler to Microsoft Word (python-docx) 🐳 Docker Container (Zero-Install & Sandbox) If you prefer not to install Python locally or want to run debim in an isolated sandbox for AI agents:
# Pull official pre-built image from GitHub Container Registry (GHCR) docker pull ghcr.io/prida-takon/debim:latest # Run debim MCP Server over stdio for AI Agents / Claude Desktop docker run -i --rm ghcr.io/prida-takon/debim:latest # Or execute CLI commands in your current directory docker run --rm -v "${PWD}:/workspace" -w /workspace ghcr.io/prida-takon/debim:latest debim --help # Alternatively, build the container image locally from source docker build -t debim . 🔒 Air-Gapped Sandboxes & Zero-Dependency Execution (Pure Standard Library) In highly secured enterprise environments, air-gapped VMs, or LLM Code Interpreter sandboxes (e.g., ChatGPT Advanced Data Analysis, Claude Artifacts, Gemini Code Execution, Kaggle) where internet access and pip install are restricted:
# Run standalone zero-dependency engine (Pure Python Standard Library: math, json, re, argparse) # Requires ZERO pip packages: python skills/debim/scripts/debim_zero.py validate -m model.debim python skills/debim/scripts/debim_zero.py qto -m model.debim 🛠️ Install from Source (Development) git clone https://github.com/PRIDA-TAKON/debim.git cd debim pip install -e ".[all,dev]" 2. Basic Commands (v0.8.0) # Initialize a new project debim init my-project # Validate schema syntax, structural continuity & bounding-box clash detection debim validate -m examples/farnsworth_house/project.yaml # Run automated building code compliance checks (pytest) debim test # Calculate Quantitative Take-Off (Concrete m3, formwork m2, rebar kg) debim qto -m examples/farnsworth_house/project.yaml # Generate official Thai Government BOQ (CGD ว480 with Factor F & steel density) debim boq --rules cg-v480 --province nakhon_ratchasima -m project.debim -o dist/boq_v480.csv # Generate project-scoped price template with international classifications debim cost template -m examples/farnsworth_house/project.yaml -o prices.template.yaml # Estimate project budget & export commercial BOQ to CSV debim cost -m examples/farnsworth_house/project.yaml -p examples/farnsworth_house/prices.yaml -o dist/boq.csv # Scaffold a new BIM element class boilerplate debim scaffold element IfcRailing # Preview 3D model in your browser (Three.js with Hierarchical Layer Explorer) debim view -m examples/farnsworth_house/project.yaml # Compile declarative YAML to standard IFC4 building model debim compile -m examples/farnsworth_house/project.yaml -o dist/farnsworth_house.ifc # Launch Model Context Protocol (MCP) server over stdio debim mcp 🏗️ Example project.yaml schema: IFC4-Minimal project: id: PRJ-2026-001 name: "Townhouse-Feasibility" units: { length: METER, area: SQUARE_METER, volume: CUBIC_METER } # 1. Spatial Structure spatial_structure: storeys: - id: L1 name: "Level 1" elevation: 0.00 height: 3.50 - id: L2 name: "Level 2" elevation: 3.50 height: 3.20 # 2. Reference Grid Axes grids: axes_x: { A: 0.00, B: 4.00, C: 8.00 } axes_y: { 1: 0.00, 2: 5.00, 3: 10.00 } # 3. Materials materials: - id: CONC_240 name: "Concrete 240 ksc" category: concrete unit_cost_ref: "MAT-CONC-01" - id: AAC_75 name: "AAC Block 7.5cm" category: masonry unit_cost_ref: "MAT-AAC-01" # 4. Elements elements: # Column placed at grid intersection [A, 1] - class: IfcColumn tag: C-A1 material: CONC_240 profile: { shape: BOX, width: 0.20, depth: 0.20 } placement: grid: [A, 1] base_storey: L1 top_storey: L2 reinforcement: main: "4-DB16" stirrups: "RB6 @ 0.15m" # Beam spanning between [A, 1] and [B, 1] - class: IfcBeam tag: B-A1_B1 material: CONC_240 profile: { shape: BOX, width: 0.20, depth: 0.40 } placement: from_grid: [A, 1] to_grid: [B, 1] storey: L2 reinforcement: main_top: "2-DB16" main_bottom: "3-DB20" stirrups: "RB9 @ 0.15m" # Wall with door host-child relationship - class: IfcWall tag: W-A1_A2 material: AAC_75 thickness: 0.075 height: 3.10 placement: from_grid: [A, 1] to_grid: [A, 2] storey: L1 children: - class: IfcDoor tag: D1 dimensions: { width: 0.90, height: 2.00 } offset_distance: 1.20 🔬 Empirical Research & Benchmark debim prioritizes engineering precision and reproducible open science on our Kaggle Cloud Multi-Core Benchmark Suite:
Evaluating blind 3D geometric fidelity against ground-truth IFC models using Geometry Variant Deduplication + Balanced Macro-Averaging across 4,695 representative building elements:
👉 Want to inspect raw visual data or reproduce tests yourself? Explore the full dataset and code on the Kaggle Benchmark Notebook.
Rigorously benchmarked against 407 real-world projects across architectural, structural, and complex hospital MEP domains:
📖 Read Full Research Paper: debim: An Empirical Study of Declarative Building-as-Code on 407 Heterogeneous Real-World OpenBIM Models 📦 Kaggle Public Benchmark Dataset: debim-5000-ifc-benchmark ⚡ Kaggle Automated Stress Test: debim-ifc-stress-test
bim building-as-code openbim ifc declarative cad ai-agents mcp model-context-protocol fastmcp
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




