Canadian Building Code MCP Server
The Canadian Building Code MCP Server enables AI assistants to search, navigate, and cite over 24,000 sections across 15+ Canadian building codes (NBC, OBC, BCBC, ABC, QCC, and more) through an MCP-compatible interface.
Core Capabilities:
Search building codes - Find relevant sections using keywords with fuzzy matching, synonym support, and TF-IDF search across all codes
Retrieve section details - Access specific section content, citations, page numbers, and coordinates by section ID (e.g., 9.10.14.1)
Navigate code hierarchy - Explore parent, child, and sibling relationships between sections
Verify sections - Confirm section IDs exist and retrieve formal citations to prevent AI hallucination
Determine applicable codes - Identify which building codes apply to specific Canadian cities, provinces, or territories
List available codes - View all supported codes and their connection status
Connect personal PDFs (BYOD mode) - Set up local PDF paths for full text extraction instead of just coordinates, ensuring copyright compliance
Extract table content - Convert code tables to markdown format
Access via REST API - Use the hosted API for searches without local setup
Key Benefits:
Token-optimized responses (81% reduction compared to naive approaches)
Compatible with MCP clients like Claude Desktop and Cursor
Enables accurate answers about building requirements, compliance documentation, and code navigation across Canadian jurisdictions
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Canadian Building Code MCP Server Find fire separation requirements for garages in the NBC"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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"Related MCP server: PDF RAG MCP Server
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_pathfor full text extraction.
Quick Start (1 minute)
Option 1: uvx (Recommended)
# Install uv (one-time)
pip install uvAdd 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 Code (ABC) 2023.
Primary codes: ABC, AFC (Fire), APC (Plumbing)
Also check: National codes (NBC, NFC) for referenceSupported Codes
National Codes (4)
NBC 2025, NFC 2025, NPC 2025, NECB 2025
Provincial Codes (9)
Ontario: OBC 2024 (Vol 1 & 2), OFC
British Columbia: BCBC 2024
Alberta: ABC 2023
Quebec: QCC, QECB, QPC, QSC (2020)
User's Guides (3)
IUGP9 (Part 9 Housing), UGP4 (Structural), UGNECB (Energy)
Total: 24,000+ indexed sections
Token Efficiency (v1.2.0)
Built-in optimizations reduce token usage:
Optimization | Reduction |
| 81% |
| 61% |
Default | ~50% |
Best practice: Use limit=5-10 and only request verbose=true when needed.
See Token Efficiency Guide for details.
Tools Available
Tool | Purpose |
| Show available codes and connection status |
| Find sections by keywords |
| Get section details (page, citation, text) |
| Get table content as markdown |
| Navigate parent/child sections |
| Check if section ID exists |
| Find codes for a location |
| Connect PDF for text extraction |
API Access
REST API: https://canada-aec-code-mcp.onrender.com
curl https://canada-aec-code-mcp.onrender.com/search/fire+separationNote: Hosted API runs in Map-Only mode. Use local MCP for full text.
Development
git clone https://github.com/DavidCho1999/Canada_building_code_mcp.git
cd Canada_building_code_mcp
pip install -e ".[all]"
python src/mcp_server.pyLicense
MIT License - See LICENSE
Links
Available Tools
7 toolsget_applicable_codeB
Get which building codes apply to a Canadian location (city, province, or territory)
Inputs: location (required).
get_hierarchyC
Get parent, children, siblings of a section
Inputs: id (required), code (required).
get_sectionC
Get details of a specific section
Inputs: id (required), code (required).
list_codesB
List all available Canadian building codes
Inputs: no named parameters.
search_codeC
Search building code sections by keywords
Inputs: query (required), code.
set_pdf_pathC
Connect your PDF for text extraction (BYOD)
Inputs: code (required), path (required).
verify_sectionB
Verify if a section exists and get its formal citation (use this to prevent hallucination)
Inputs: id (required), code (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose with no overlap: get_applicable_code determines location-based applicability, get_hierarchy navigates section relationships, get_section retrieves section details, list_codes enumerates available codes, search_code performs keyword searches, set_pdf_path handles PDF integration, and verify_section validates section existence. The descriptions make it unambiguous which tool to use for each task.
All tool names follow a consistent verb_noun pattern with snake_case: get_applicable_code, get_hierarchy, get_section, list_codes, search_code, set_pdf_path, and verify_section. The verbs (get, list, search, set, verify) are appropriately chosen for their actions, and the nouns clearly indicate the target resources, creating a predictable and readable naming scheme.
With 7 tools, this server is well-scoped for its purpose of accessing and navigating Canadian building codes. The count is sufficient to cover core operations like listing, searching, retrieving details, verifying sections, managing hierarchies, handling location applicability, and integrating PDFs, without being overwhelming or sparse. Each tool earns its place in the workflow.
The toolset provides strong coverage for the domain of building code access and navigation, including listing codes, searching, retrieving section details, verifying existence, and handling hierarchies and location applicability. A minor gap is the lack of update or modification tools, but this is reasonable for a read-only reference server, and the PDF integration via set_pdf_path adds flexibility for text extraction.
Maintenance
Related MCP Connectors
AI plan review for construction drawings: submit plan sets, get code, spec and drawing findings.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Ingest, manage, and retrieve documents for RAG-powered AI applications
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and query PDF documents through a local RAG system with vector embeddings. Provides semantic document search capabilities while keeping all data stored locally without external dependencies.-
- AlicenseNot gradedqualityDmaintenanceEnables intelligent search and question-answering over PDF documents using semantic similarity and keyword search. Supports OCR for scanned PDFs, persistent vector storage with ChromaDB, and maintains source tracking with page numbers.6MIT
- FlicenseNot gradedqualityDmaintenanceTransforms PDF collections into a searchable knowledge base using TF-IDF indexing and proximity matching. It enables users to search documents, retrieve specific page content, and manage document libraries through natural language via MCP clients.5-
- AlicenseCqualityBmaintenanceEnables Claude Code and Codex to retrieve building-code sections from your own licensed corpus via hybrid search, returning section-faithful citations with amendments and cross-references.6MIT