SocialHousing.ai

OpenHousing.AI

UK housing data for AI assistants. An open source MCP server that provides structured access to Energy Performance Certificates, social housing stock, house prices, rental statistics, and more — all from official government sources.

BETA v0.1.0 MCP Protocol

Available Tools

10 tools across 3 official UK government data sources

search_epc
Search Energy Performance Certificates by postcode, address, local authority, or rating band
EPC Open Data
get_epc_by_uprn
Retrieve full EPC history for a specific property using its UPRN
EPC Open Data
get_epc_statistics
Aggregated EPC statistics for a local authority — band distribution, averages, compliance metrics
EPC Open Data
search_rsh_stock
Search social housing stock by registered provider or local authority area
RSH SDR
get_provider_profile
Full profile of a registered housing provider — stock, rents, vacancies, geographic spread
RSH SDR
compare_providers
Side-by-side comparison of 2–5 housing providers across key metrics
RSH SDR
get_house_prices
House price indices, average prices, and annual change for any UK location
ONS
get_rental_data
Private rental market statistics — monthly rents, percentiles, bedroom breakdown
ONS
get_affordability
Housing affordability ratios — house price to earnings, median and lower quartile
ONS
get_housing_supply
New build starts, completions, and net additional dwellings by tenure type
ONS

Documentation

Everything you need to connect, query, and integrate OpenHousing.AI

1. Prerequisites

You need Python 3.11+ and uv package manager installed. For EPC tools, register for a free API key at EPC Open Data. RSH and ONS tools require no authentication.

2. Install & Run

git clone https://github.com/yantraworks/openhousing-ai.git
cd openhousing-ai
cp .env.example .env
# Add your EPC API credentials to .env
uv sync
uv run openhousing

3. Docker

docker build -t openhousing-ai .
docker run -i --rm --env-file .env openhousing-ai

4. Remote HTTP Mode

For remote MCP clients, run in HTTP transport mode:

uv run openhousing --transport http --port 8080

search_epc

Search for Energy Performance Certificates in England and Wales. Accepts postcodes in any format, fuzzy local authority name matching.

ParameterTypeDescription
postcodestringoptionalUK postcode (e.g. "SW1A 1AA")
addressstringoptionalStreet address or partial match
local_authoritystringoptionalLocal authority name or ONS code
energy_bandstringoptionalEPC rating band (A–G)
property_typestringoptionalhouse, flat, bungalow, maisonette
from_datestringoptionalLodgement date from (YYYY-MM-DD)
to_datestringoptionalLodgement date to (YYYY-MM-DD)
max_resultsintegeroptionalResults to return (default 25, max 5000)

get_epc_by_uprn

Retrieve full EPC history for a specific property by its Unique Property Reference Number.

ParameterTypeDescription
uprnstringrequiredUPRN (up to 12 digits)

get_epc_statistics

Aggregated EPC statistics for a local authority. Computes band distribution, property type breakdown, average efficiency scores, and MEES compliance metrics.

ParameterTypeDescription
local_authoritystringrequiredLocal authority name or code
tenurestringoptionalsocial, private-rented, owner-occupied
group_bystringoptionalenergy_band, property_type, construction_age

search_rsh_stock

Search social housing stock data from the RSH Statistical Data Return.

ParameterTypeDescription
provider_namestringoptionalRegistered provider name (partial match)
local_authoritystringoptionalLocal authority name or code
yearintegeroptionalReporting year (default latest)

get_provider_profile

Comprehensive profile of a registered social housing provider including stock breakdown, rents, vacancies, RTB sales, and geographic spread.

ParameterTypeDescription
provider_namestringrequiredProvider name (fuzzy match)

compare_providers

Compare key metrics across 2–5 registered providers side by side.

ParameterTypeDescription
providerslist[string]requiredList of 2–5 provider names
metricslist[string]optionalstock, rents, vacancies, rtb_sales

get_house_prices

ParameterTypeDescription
locationstringrequiredLocal authority, region, or country
from_datestringoptionalStart date (YYYY-MM)
to_datestringoptionalEnd date (YYYY-MM)
property_typestringoptionaldetached, semi-detached, terraced, flat

get_rental_data

ParameterTypeDescription
locationstringrequiredLocal authority, region, or country
bedroomsintegeroptionalNumber of bedrooms (1–4+)

get_affordability

ParameterTypeDescription
locationstringrequiredLocal authority name
measurestringoptionalmedian or lower_quartile (default median)

get_housing_supply

ParameterTypeDescription
locationstringrequiredLocal authority, region, or country
tenurestringoptionalmarket, affordable_rent, social_rent, shared_ownership

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "openhousing": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/openhousing-ai", "openhousing"],
      "env": {
        "EPC_API_EMAIL": "your-email",
        "EPC_API_KEY": "your-key"
      }
    }
  }
}

Claude Code

Add to .mcp.json in your project root:

{
  "mcpServers": {
    "openhousing": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/openhousing-ai", "openhousing"],
      "env": {
        "EPC_API_EMAIL": "your-email",
        "EPC_API_KEY": "your-key"
      }
    }
  }
}

Remote HTTP (Cloud Run)

Connect to the hosted instance via Streamable HTTP:

MCP Endpoint: https://openhousing-ai-447203134530.us-west1.run.app/mcp/
SSE Endpoint: https://openhousing-ai-447203134530.us-west1.run.app/sse/

Environment Variables

VariableRequiredDefaultDescription
EPC_API_EMAILEPC toolsEmail registered with EPC Open Data
EPC_API_KEYEPC toolsAPI key from EPC Open Data
OPENHOUSING_CACHE_TTLno3600Cache TTL in seconds
OPENHOUSING_LOG_LEVELnoINFOLogging level
OPENHOUSING_RATE_LIMITno10Max requests/sec to upstream APIs
OPENHOUSING_PORTno8080HTTP transport port

UK Housing Sector Glossary

EPCEnergy Performance Certificate — rates building energy efficiency A (best) to G (worst). Required for sale/rental.
RSHRegulator of Social Housing — government body regulating social housing providers in England.
COREContinuous Recording of Lettings and Sales — national data collection for social housing lettings.
PRPPrivate Registered Provider — housing association registered with the RSH.
UPRNUnique Property Reference Number — unique identifier for every addressable location in GB.
MEESMinimum Energy Efficiency Standards — currently EPC E for rentals, proposed EPC C by 2030.
RTBRight to Buy — policy allowing eligible social tenants to purchase their home at a discount.
Social RentRent calculated using government formula based on local earnings and property values. Lower than affordable rent.
Affordable RentRent set at up to 80% of local market rent, including service charges.
LCHOLow Cost Home Ownership — includes shared ownership, rent to buy, and intermediate tenure.
SDRStatistical Data Return — annual data collection from registered providers by the RSH.
UKHPIUK House Price Index — monthly index from ONS measuring house price changes.
LHALocal Housing Allowance — rate for Housing Benefit/UC housing element for private renters.
Awaab's LawSocial Housing (Regulation) Act 2023 provisions requiring landlords to fix hazards within set timeframes.
DHSDecent Homes Standard — minimum standard covering fitness, repair, facilities, and thermal comfort.
S106Section 106 agreements — legal agreements requiring affordable housing in new developments.
HMOHouse in Multiple Occupation — property rented by 3+ people not from one household.
ONSOffice for National Statistics — UK national statistical institute.

Data Sources

All data from official UK government APIs under the Open Government Licence v3.0

EPC

EPC Open Data

Energy Performance Certificates for domestic buildings in England and Wales. Ratings, property details, insulation, heating, CO2 emissions, improvement recommendations.

epc.opendatacommunities.org
RSH

RSH Statistical Data Return

Social housing stock from private registered providers. Stock by area, property type, bedroom count, tenure, rents, lettings, Right to Buy sales, vacancies.

gov.uk/rsh
ONS

ONS Housing Statistics

House price indices, private rental market statistics, housing affordability ratios, new build starts and completions. Monthly, quarterly, and annual data.

ons.gov.uk/housing