Canadian Building Code MCP Server

$pip install uv
README.md

AI-powered search for 24,000+ Canadian building code sections.

Canadian Building Code MCP

AI-powered search for 24,000+ Canadian building code sections.

Enable AI assistants to search, navigate, and cite building regulations across NBC, OBC, BCBC, and 13 other Canadian codes.

Works with Claude Desktop and any MCP-compatible client (Cursor, Windsurf, etc.)


Why This Exists

Architects and engineers waste hours searching through thousands of pages of building codes. This MCP server lets AI do the heavy lifting:

You: "What are the fire separation requirements for a 3-storey
     residential building in Saskatchewan?"

Claude: [Searches NBC 2025, finds relevant sections, extracts text]

        "According to NBC 2025 Section 3.2.2.55, Group C buildings
         up to 3 storeys with sprinklers require:
         - Maximum area: 1,800 m²
         - Floor assemblies: 45-min fire-resistance rating
         - Load-bearing walls: Same rating as supported assembly"

Features

Feature Description
24,000+ Sections NBC, OBC, BCBC, ABC, QCC + 11 more codes indexed
Smart Search Fuzzy matching, synonyms, "Did you mean?" suggestions
Token Optimized 81% reduction vs naive approach (v1.2.0)
Copyright Safe BYOD model - coordinates only, you provide the PDF
Jurisdiction Aware Knows which code applies where (ON→OBC, BC→BCBC)

Architecture

┌─────────────────────────────────────────────────────────────┐
│            MCP Client (Claude, Cursor, etc.)                 │
└─────────────────────────┬───────────────────────────────────┘
                          │ MCP Protocol
                          ▼
┌─────────────────────────────────────────────────────────────┐
│                   Building Code MCP Server                   │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐       │
│  │ search_code  │  │ get_section  │  │ get_table    │       │
│  │ (fuzzy+TF-IDF│  │ (BYOD text)  │  │ (markdown)   │       │
│  └──────┬───────┘  └──────┬───────┘  └──────┬───────┘       │
│         │                 │                 │               │
│         ▼                 ▼                 ▼               │
│  ┌─────────────────────────────────────────────────┐        │
│  │              maps/*.json (15.9 MB)              │        │
│  │         Section IDs, pages, keywords, bbox       │        │
│  └─────────────────────────────────────────────────┘        │
│                          │                                  │
│                          ▼ (BYOD mode only)                 │
│  ┌─────────────────────────────────────────────────┐        │
│  │              User's PDF (via PyMuPDF)            │        │
│  │           Text extraction at runtime             │        │
│  └─────────────────────────────────────────────────┘        │
└─────────────────────────────────────────────────────────────┘

Two Modes:

  • Map-Only (default): Returns page numbers & coordinates. No PDF needed.
  • BYOD: Connect your PDF via set_pdf_path for full text extraction.

Quick Start (1 minute)

Option 1: uvx (Recommended)

# Install uv (one-time)
pip install uv

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "building-code": {
      "command": "uvx",
      "args": ["building-code-mcp"]
    }
  }
}

Option 2: pip

pip install building-code-mcp
{
  "mcpServers": {
    "building-code": {
      "command": "building-code-mcp"
    }
  }
}

Example Conversations

Finding Requirements

You: "I'm designing a 6-storey office building in Vancouver.
     What are the fire separation requirements?"

Claude: Let me search the BC Building Code...

[Uses search_code("fire separation office", code="BCBC")]
[Uses get_section("3.2.2.57", code="BCBC")]

Based on BCBC 2024 Section 3.2.2.57, a 6-storey Group D
(business) building requires:
- Sprinkler system: Required
- Floor assemblies: 1-hour fire-resistance rating
- Maximum building area: 7,200 m²

Checking Specific Sections

You: "What does OBC section 9.10.14.1 say about spatial separation?"

Claude: [Uses get_section("9.10.14.1", code="OBC_Vol1")]

OBC Section 9.10.14.1 - Spatial Separation Between Buildings:
"Buildings on the same property shall have spatial separation
between them based on the aggregate area of unprotected openings
in exposing building faces..."

Jurisdiction Lookup

You: "Which building code applies in Calgary?"

Claude: [Uses get_applicable_code("Calgary, Alberta")]

Calgary follows the Alberta Building C

Tools (5)

search_codePerform fuzzy and TF-IDF searches across building codes.
get_sectionRetrieve specific section details and text (BYOD mode for full text).
get_tableExtract table data in markdown format.
get_applicable_codeDetermine which building code applies to a specific jurisdiction.
set_pdf_pathConnect a local PDF for full-text extraction in BYOD mode.

Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "building-code": {
      "command": "uvx",
      "args": ["building-code-mcp"]
    }
  }
}

Try it

What are the fire separation requirements for a 3-storey residential building in Saskatchewan?
I'm designing a 6-storey office building in Vancouver. What are the fire separation requirements in the BCBC?
What does OBC section 9.10.14.1 say about spatial separation?
Which building code applies in Calgary, Alberta?
Search for 'unprotected openings' in the National Building Code 2025.

Frequently Asked Questions

What are the key features of Canadian Building Code MCP Server?

Indexes 24,000+ sections across NBC, OBC, BCBC, ABC, QCC, and 11 other codes.. Smart search with fuzzy matching, synonyms, and 'Did you mean?' suggestions.. Jurisdiction awareness to identify which code applies to specific Canadian locations.. Copyright-safe BYOD model allowing full-text extraction from user-provided PDFs.. Token-optimized architecture providing an 81% reduction in token usage..

What can I use Canadian Building Code MCP Server for?

Architects verifying fire-resistance ratings for specific building types and heights.. Engineers checking spatial separation requirements between buildings on the same property.. Construction professionals identifying the correct provincial building code for a specific city.. Compliance officers searching for specific regulations across multiple Canadian jurisdictions.. Designers extracting markdown tables from building code documents for project documentation..

How do I install Canadian Building Code MCP Server?

Install Canadian Building Code MCP Server by running: pip install uv

What MCP clients work with Canadian Building Code MCP Server?

Canadian Building Code MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Canadian Building Code MCP Server with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free