uk-building-code-mcp

LeoRickayzen/uk-building-code-mcp

3.1

If you are the rightful owner of uk-building-code-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server that provides AI assistants with access to UK Building Regulations documents through semantic search and retrieval capabilities.

buildingcode-mcp

A Model Context Protocol (MCP) server that provides AI assistants with access to UK Building Regulations documents through semantic search and retrieval capabilities.

⚠️ This project is under heavy development - Features may change, break, or be incomplete. Use at your own risk.

What is This?

This is an MCP server that exposes UK Building Regulations data to AI assistants like Claude Desktop, Cline, or other MCP-compatible clients. Instead of generating responses itself, it provides two specialized tools that AI models can use to search and retrieve regulation content from the official UK Building Regulations documents.

Quick Start

Step 1: Download the PDF

Download The Merged Approved Documents (October 2024) and save it as data/documents.pdf

Step 2: Run the Server

./run.sh

Step 3: Install MCP Server in Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "buildingcode-mcp": {
      "command": "uvicorn",
      "args": ["app.main:app", "--host", "0.0.0.0", "--port", "8080"],
      "cwd": "/path/to/buildingcode-mcp/backend"
    }
  }
}

Development Status

⚠️ This project is under heavy development and should be considered experimental.

  • Current state: Basic MCP server functionality working
  • Known issues: May have bugs, incomplete features, or breaking changes
  • Stability: Not recommended for production use
  • Updates: Frequent changes expected as development continues
  • Support: Limited support available during active development

Architecture

This MCP server provides AI assistants with access to UK Building Regulations through a structured protocol:

┌─────────────────────────────────┐
│        AI Assistant             │
│  (Claude Desktop, Cline, etc.)  │
└─────────────┬───────────────────┘
              │ MCP Protocol
              │ (JSON-RPC over stdio)
┌─────────────▼───────────────────┐
│         MCP Server              │
│     (MCP Protocol Handler)      │
└─────────────┬───────────────────┘
              │ HTTP API Calls
┌─────────────▼───────────────────┐
│        FastAPI Server           │
│  ┌─────────────────────────────┐│
│  │ Available Endpoints:        ││
│  │ • /api/v1/search_excerpts   ││
│  │ • /api/v1/get_pages         ││
│  └─────────────────────────────┘│
└─────┬─────────────────┬─────────┘
      │                 │
      │                 └─────────┐
      │                           │
┌─────▼─────┐              ┌──────▼──────┐
│ ChromaDB  │              │ DynamoDB    │
│ (Vector   │              │ (Full Pages │
│  Search)  │              │  Storage)   │
└───────────┘              └─────────────┘

MCP Server Features

Key Capabilities

  • Semantic Search: Find relevant regulation excerpts using natural language queries
  • Page Retrieval: Get full page content for detailed reference
  • UK Building Regulations Focus: Specialized for official UK government building regulations
  • Vector Database: Fast similarity search using ChromaDB embeddings
  • Structured Responses: Consistent JSON responses for AI assistant integration

Use Cases

  • Architects: Quick reference to building regulations during design
  • Contractors: Verify compliance requirements for construction projects
  • Building Inspectors: Cross-reference specific regulation requirements
  • Students: Learn UK building regulations through interactive queries
  • Legal Professionals: Research building regulation compliance

TODO

  • Streamline Installation: Simplify the setup process to reduce complexity
  • Persistent Data Storage: Implement persistent ingestion so data isn't lost when Docker containers stop