Skip to main content
Glama
README.md
# uk-business-mcp

An [MCP](https://modelcontextprotocol.io) server that gives Claude, Cursor, VS Code and other AI assistants UK business data from official sources:

- **Companies House**: search companies by name, or by trade (SIC code), town and age. Get a company's profile, whether its filings are overdue, and its current officers.
- **The GB vehicle operator licence register**: every business licensed to run goods vehicles over 3.5 tonnes, or buses and coaches, with the **number of vehicles it is authorised to run**. No other free UK dataset gives you fleet sizes. You can search it, join it to Companies House, and get statistics by region, fleet size and postcode area.
- **Postcodes**: coordinates, local authority, region, ward and constituency (via [postcodes.io](https://postcodes.io)), plus the distance between two postcodes.
- **HMRC VAT checks**: confirm that a VAT number is registered and get the name and address HMRC holds for it.
- **Offline validation** of postcodes, VAT check digits, company numbers and licence numbers, also published on its own as [`uk-business-validators`](packages/validators).

It was built for logistics and SME software: finding and qualifying courier and haulage firms, checking a new customer before you invoice them, and cleaning up address and company data.

## Install

You need Node 18 or later. Add this to your MCP client's config (Claude Desktop: `claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "uk-business": {
      "command": "npx",
      "args": ["-y", "uk-business-mcp"],
      "env": {
        "COMPANIES_HOUSE_API_KEY": "your-key",
        "UK_OPERATOR_REGISTER": "/path/to/operator-licence-csvs"
      }
    }
  }
}
```

Claude Code:

```sh
claude mcp add uk-business -e COMPANIES_HOUSE_API_KEY=your-key -- npx -y uk-business-mcp
```

Every setting is optional. A tool that needs a missing key explains how to get one.

| Variable | What it enables | How to get it |
| --- | --- | --- |
| `COMPANIES_HOUSE_API_KEY` | Company search, profiles and officers | Free. Register at [developer.company-information.service.gov.uk](https://developer.company-information.service.gov.uk), create a **Live** application, and add a **REST** key. |
| `HMRC_CLIENT_ID`, `HMRC_CLIENT_SECRET` | `check_vat_number` | Free. Register an application on the [HMRC Developer Hub](https://developer.service.hmrc.gov.uk) and subscribe it to *Check a UK VAT number*. Set `HMRC_ENVIRONMENT=sandbox` to test. |
| `UK_OPERATOR_REGISTER` | Operator licence tools, preloaded at start | Download the CSVs (one per traffic area) from [data.gov.uk](https://www.data.gov.uk/dataset/traffic-commissioners-goods-and-public-service-vehicle-operator-licence-records). Give file paths, folders or URLs, separated by commas. |

Postcode lookups and offline validation need nothing.

## Tools

| Tool | What it does |
| --- | --- |
| `validate_uk_identifier` | Check and normalise a postcode, VAT number, company number or operator licence number, offline. |
| `search_companies` | Search Companies House by name or number. |
| `find_companies` | Filtered search by SIC codes, location, status and incorporation dates. |
| `get_company` | Profile, filing health (`up_to_date`, `accounts_overdue`, ...), insolvency and charges flags, plus the company's operator licences if the register is loaded. |
| `get_company_officers` | Current directors and secretaries. Never returns dates of birth. |
| `lookup_postcode` | Coordinates and administrative areas. Falls back to the district for terminated or unknown postcodes. |
| `postcode_distance` | Straight-line distance in km and miles. |
| `check_vat_number` | HMRC registration check, with an optional consultation number as proof. |
| `load_operator_register` | Load register CSVs from files, folders or URLs. |
| `search_operators` | Search by name, company, postcode area/district/sector, traffic area, licence type, status and fleet size. Largest fleets first. |
| `operator_stats` | Counts, total and median fleet size, and breakdowns by fleet band, region, licence type, status and postcode area. |

## Things to ask

- *"Find active courier companies (SIC 53202) in Leeds incorporated since 2020 and tell me which ones are behind on their filings."*
- *"How many standard-licence goods operators in the North West run 2 to 10 vehicles? Break it down by postcode area."*
- *"Does company 04766814 hold an operator licence, and how many vehicles is it authorised for?"*
- *"Is GB220430231 a real VAT number, and whose is it?"*
- *"How far is LS9 0PS from M1 1AE?"*

## Data and privacy

All data comes from public registers published under the [Open Government Licence](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/) (Companies House, the Traffic Commissioners, ONS via postcodes.io) or from HMRC's public API. The server runs on your machine and sends nothing anywhere except requests to those services.

The server deliberately returns less than the registers hold:

- Officers come back without dates of birth or home addresses.
- When the operator licence register is loaded, columns that name people (transport managers, directors and partners) are never read into memory.

If you use this data to contact businesses, UK marketing law still applies to you. In particular, sole traders and partnerships are treated as individuals under PECR.

## Limits

- Companies House allows 600 requests per five minutes per key.
- The operator register covers Great Britain only. Northern Ireland licenses separately. Vans under 3.5 tonnes used only in Britain need no licence, so the smallest courier firms aren't in it. Companies House covers them by SIC code.
- `find_companies` filters on the registered office, which may be an accountant's address.

## Development

```sh
npm install
npm run build
npm test
```

This is a monorepo with two packages: [`packages/mcp`](packages/mcp) (the server) and [`packages/validators`](packages/validators) (the zero-dependency validation library). Tests run against recorded API shapes and need no keys.

Issues and pull requests are welcome. In particular, if the register's CSV headers change, open an issue with the new header row.

## Licence

MIT. Data is subject to the licences of the sources above.