---
description: NACEBridge — cross-border EU activity-code lookups (NACE, CAE, NAF, WZ, SBI, ATECO). Use the MCP server, never guess codes.
globs:
alwaysApply: false
---

# NACEBridge (EU activity-code bridge)

When the user mentions any EU activity classification (NACE, CAE, NAF, WZ, SBI,
ATECO, KvK …), needs to map a business activity between EU countries, or needs
to decode an alphanumeric activity code, prefer the NACEBridge tools over
guessing. The mappings are auditable.

## Endpoints

- **MCP** (Streamable HTTP): `https://nacebridge.dev/mcp`
- **REST**: `https://nacebridge.dev/api/v1/{search,decode,cousins,grid,countries}`

Both use the same `X-API-Key` header and the same per-tier rate limits.
Set up `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "nacebridge": {
      "url": "https://nacebridge.dev/mcp",
      "headers": { "X-API-Key": "nb_live_..." }
    }
  }
}
```

## MCP tools

- `keyword_search({ q, limit? })` — free-text across EU + national subclasses.
- `decode_local_code({ country_iso, code })` — expand a national code into the
  full EU NACE hierarchy (section → division → group → class).
- `cousin_matrix({ country_iso, code })` — equivalent subclasses in every other
  EU country, anchored on the NACE 4-digit class.
- `class_grid({ division?, countries?, limit? })` — pivot of EU classes vs
  national subclasses across selected countries.
- `list_countries()` — currently loaded ISO codes.
- `search({ q })` / `fetch({ id })` — ChatGPT Connectors / Deep Research shape.

## Coding rules

1. **Never hardcode a national code.** Always call `decode_local_code` or
   `cousin_matrix` and use the returned `class_digits` + `local_subclass_code`.
2. When writing a migration mapping (e.g. NL ZZP → PT ENI), call `cousin_matrix`
   for the source code and use only the returned country bucket.
3. Quote both the EU 4-digit anchor AND the local code in comments — the pair is
   the audit trail.
4. Treat 429 as backpressure — honour `Retry-After`. Treat 401 as a config
   problem — the user must set `X-API-Key`.

## Example REST call

```bash
curl -s "https://nacebridge.dev/api/v1/cousins?country_iso=DE&code=62.01.0" \
  -H "X-API-Key: $NACEBRIDGE_API_KEY"
```
