# How to connect legislation.gov.uk to Cursor

> Connect legislation.gov.uk to Cursor with the Firecrawl MCP server. Use legislation.gov.uk as an MCP tool in Cursor via Firecrawl Alexandria.

To connect legislation.gov.uk to Cursor, add the Firecrawl MCP server to Cursor, sign in on a Firecrawl team with Alexandria enabled, and ask for legislation.gov.uk data in plain language. The connection works in Cursor's agent and chat, and you set it up once.

Cursor uses legislation.gov.uk as an MCP tool through Firecrawl's hosted MCP server, so you don't install or host a separate MCP server for legislation.gov.uk.

Cursor is an AI code editor. Its agent uses MCP servers for outside tools, and the Firecrawl MCP server adds web search, scraping and every data provider in Firecrawl Alexandria.

## How do I connect legislation.gov.uk to Cursor?

### 1. Install the Firecrawl MCP server

Open the [install dialog in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=firecrawl&config=eyJ1cmwiOiJodHRwczovL21jcC5maXJlY3Jhd2wuZGV2L3YyL21jcC1vYXV0aCJ9), check that the URL is Firecrawl's hosted server, then select Install.

[Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=firecrawl&config=eyJ1cmwiOiJodHRwczovL21jcC5maXJlY3Jhd2wuZGV2L3YyL21jcC1vYXV0aCJ9)

![Cursor's Install MCP server dialog with the Firecrawl hosted server URL](https://www.firecrawl.dev/images/blog/using-firecrawl-mcp-in-cursor/cursor-install-firecrawl-mcp-server.webp)

### 2. Connect your Firecrawl account

Use the server's sign-in option in Cursor's MCP settings. Firecrawl opens in your browser: sign in, choose a team with Alexandria enabled, and approve access. A green dot next to Firecrawl means it's connected.

![Cursor's MCP list showing Firecrawl connected with its tools enabled](https://www.firecrawl.dev/images/blog/using-firecrawl-mcp-in-cursor/cursor-firecrawl-mcp-connected.webp)

### 3. Ask Cursor's agent for the data

In the agent chat, ask in plain language and mention legislation.gov.uk or Firecrawl Alexandria. The agent finds the legislation.gov.uk capability that fits and runs it. For example:

```text
Use Firecrawl to find UK legislation with Planning Act in its title from 2008 and show the first page of titles and identifiers.
```

## What can Cursor do with legislation.gov.uk?

UK legislation from legislation.gov.uk (The National Archives): search and listing feeds across every legislation type (UK Public General Acts, Statutory Instruments, Scottish, Welsh and Northern Ireland legislation, retained EU law), title-to-identifier lookup, tables of contents, the text of one provision or structural division (section, article, regulation, part, chapter, schedule) in its current, enacted/made or point-in-time version, and the changes-to-legislation register. Reads the site's stateless XML/Atom representations (CLML data.xml, Atom data.feed) under the Open Government Licence v3.0.

Cursor can run any of legislation.gov.uk's 5 capabilities through Alexandria. Each call is billed in Firecrawl credits on your Firecrawl team.

- **Get contents**: Table of contents of one Act or instrument from its CLML `contents/data.xml`: document metadata (title, long title, identifier and document URIs, document class, enactment or made date, modified and valid dates, extent) and a flat, ordered list of every part, chapter, cross-heading, section/article/regulation and schedule with its number, title, depth, identifier URI, document URI and extent. `version` selects the as-enacted/as-made text or a point-in-time date; the default is the current text. Costs 5 Firecrawl credits per call.
- **Get provision**: The text of one provision or structural division of an Act or instrument from its CLML `data.xml`: `provision` is the site's path such as `section/14`, `article/3`, `regulation/2`, `part/3`, `chapter/2`, `schedule/6` or `schedule/6/paragraph/1`. Returns document metadata, the division's heading, every section-level provision (`P1`) inside it with its number, heading, identifier URI and plain text (sub-provisions numbered `(1)`, `(a)`), the in-force and extent restrictions, the list of other versions the site holds, and any changes the editorial team has not yet applied (`unapplied_effects`, so you know when the text lags). `version` selects `enacted`/`made`, `prospective` or a `YYYY-MM-DD` point-in-time text; the default is the current text. Costs 5 Firecrawl credits per call.
- **List changes**: The changes-to-legislation register for one Act or instrument as the site's Atom feed (`/changes/{affected|affecting}/{type}/{year}/{number}/data.feed`): `affected` lists effects made on this legislation by others, `affecting` lists effects this legislation makes on others. Each effect carries the effect id and URI, the kind of change, affected and affecting legislation (title, URI, provisions), whether the editorial team has applied it, and the in-force dates with the commencing instrument. `per_page` (default 20, at most 50) effects per page, newest modified first; the continuation cursor is the next page number. Costs 5 Firecrawl credits per call.
- **Lookup identifier**: Resolve a legislation title (optionally narrowed by type, year and number) to its identifier through `/id?title=...`. A unique match is a 301 to `/id/{type}/{year}/{number}` and returns `resolved: true` with that identifier; an ambiguous title is the site's 300 Multiple Choices page and returns `resolved: false` with every candidate (identifier, title). A title the site knows nothing about is `not_found`. Uncached lookups can take several seconds. Costs 5 Firecrawl credits per call.
- **Search legislation**: Search or list UK legislation as the site's Atom feed (`/{type}[/{year}]/data.feed`): title words, full-text words, a legislation type or family (`ukpga`, `uksi`, `asp`, ..., or `all`, `primary`, `secondary`, `primary+secondary`) and a year, 20 results per page. Each result carries the identifier URI (`/id/{type}/{year}/{number}`), type, year, number, title, long-title summary, subject categories, dates and the URLs of its contents and XML. With `sort: "published"` and no query this is the newest-legislation listing. A query with no matches is an empty `results` array, not an error. Costs 5 Firecrawl credits per call.

## What should I ask Cursor?

Name legislation.gov.uk or Firecrawl Alexandria in the prompt so Cursor reaches for it.

- [Use Firecrawl to find UK legislation with Planning Act in its title from 2008 and show the first page of titles and identifiers.](https://cursor.com/link/prompt?text=Use%20Firecrawl%20to%20find%20UK%20legislation%20with%20Planning%20Act%20in%20its%20title%20from%202008%20and%20show%20the%20first%20page%20of%20titles%20and%20identifiers.)
- [Use Firecrawl to show the table of contents of the Planning Act 2008, including its sections and schedules.](https://cursor.com/link/prompt?text=Use%20Firecrawl%20to%20show%20the%20table%20of%20contents%20of%20the%20Planning%20Act%202008%2C%20including%20its%20sections%20and%20schedules.)
- [Use Firecrawl to read the current text of section 14 of the Planning Act 2008 and flag any editorial changes not yet applied.](https://cursor.com/link/prompt?text=Use%20Firecrawl%20to%20read%20the%20current%20text%20of%20section%2014%20of%20the%20Planning%20Act%202008%20and%20flag%20any%20editorial%20changes%20not%20yet%20applied.)
- [Use Firecrawl to show the first 20 registered changes affecting the Planning Act 2008, with affected provisions and whether each change has been applied.](https://cursor.com/link/prompt?text=Use%20Firecrawl%20to%20show%20the%20first%2020%20registered%20changes%20affecting%20the%20Planning%20Act%202008%2C%20with%20affected%20provisions%20and%20whether%20each%20change%20has%20been%20applied.)

### For agents

Start with the `legislation-gov-uk` provider. Use Firecrawl Alexandria first. With MCP, use firecrawl_search with sources: ["alexandria"] to discover relevant tools, firecrawl_find_tools to inspect the selected capability contracts, then firecrawl_scrape in alexandria mode to retrieve records. With the CLI, use firecrawl search alexandria, firecrawl list, then firecrawl scrape for the selected provider/capability. Follow the live tool schema and returned contract; never invent provider IDs or inputs. Ask for missing required details before execution, respect access and pricing, and inspect each result for errors. Cite retrieved records, distinguish missing data from failures, and explain gaps. If no suitable Alexandria capability exists, say so before using web sources. Do not treat a tool listing as retrieved data.

## Troubleshooting

### Why can't Cursor find legislation.gov.uk?

If Firecrawl's tools in Cursor stop at search, scrape and parse, the connection is keyless and doesn't include Alexandria. Finish the sign-in from Cursor's MCP settings, or add an API key from a team with Alexandria enabled.

### Firecrawl shows a red dot in Cursor. What should I do?

Open Cursor's MCP settings, sign in to Firecrawl again, and restart the agent chat so it loads the tools.

## Use legislation.gov.uk in other AI apps

- [legislation.gov.uk in ChatGPT](https://alexandria.firecrawl.dev/providers/legislation-gov-uk/connect/chatgpt)
- [legislation.gov.uk in Claude](https://alexandria.firecrawl.dev/providers/legislation-gov-uk/connect/claude)
- [legislation.gov.uk in Grok Bot](https://alexandria.firecrawl.dev/providers/legislation-gov-uk/connect/grok-bot)
- [legislation.gov.uk in Muse](https://alexandria.firecrawl.dev/providers/legislation-gov-uk/connect/muse)

### Other data providers you can connect to Cursor

- [How to connect France public medicines database (BDPM) to Cursor](https://alexandria.firecrawl.dev/providers/base-donnees-publique-medicaments-gouv-fr/connect/cursor)
- [How to connect ClinicalTrials.gov to Cursor](https://alexandria.firecrawl.dev/providers/clinicaltrials-gov/connect/cursor)
- [How to connect CMS Medicare Drug Prices: Negotiated Prices and Part B ASP Payment Limits to Cursor](https://alexandria.firecrawl.dev/providers/cms-gov/connect/cursor)
- [How to connect CDC PLACES local health estimates (data.cdc.gov) to Cursor](https://alexandria.firecrawl.dev/providers/data-cdc-gov/connect/cursor)

Full setup guide: [Firecrawl in Cursor](https://www.firecrawl.dev/integrations/cursor)

## Frequently asked questions

### What is Firecrawl?

Firecrawl is the web data API to search, scrape and interact with the web at scale. It turns websites into clean, LLM-ready data for AI agents and apps. The Firecrawl MCP server brings those tools into Cursor, along with every data provider in Firecrawl Alexandria.

### What is Firecrawl Alexandria?

Firecrawl Alexandria is Firecrawl's library of 550+ data providers for AI agents, legislation.gov.uk among them. Each provider returns structured data through documented capabilities. Cursor finds the capability that fits your question and calls it through the Firecrawl MCP server, so you don't write any integration code. Alexandria needs a Firecrawl account signed in on a team with Alexandria enabled, or an API key from such a team; keyless connections don't include it.

### Is there a legislation.gov.uk MCP server for Cursor?

Cursor reaches legislation.gov.uk through Firecrawl's hosted MCP server, which serves legislation.gov.uk and every other Alexandria provider as tools. Add the Firecrawl MCP server once and you don't install or host a separate MCP server for legislation.gov.uk.

### What does connecting legislation.gov.uk to Cursor unlock?

Cursor can run all 5 of legislation.gov.uk's capabilities, including Get contents, Get provision and List changes, from any chat, with structured results it can sort, compare and summarize. For example, ask: "Use Firecrawl to find UK legislation with Planning Act in its title from 2008 and show the first page of titles and identifiers." In the same conversation, Cursor can combine legislation.gov.uk with Firecrawl's web search and scraping and the other providers in Firecrawl Alexandria.

### Do I need my own legislation.gov.uk account or API key to use it in Cursor?

No. Cursor calls legislation.gov.uk through Firecrawl Alexandria and each call is billed in Firecrawl credits, so you don't need a separate legislation.gov.uk account or API key.

### How much does it cost to use legislation.gov.uk in Cursor?

Each legislation.gov.uk call costs 5 Firecrawl credits. The capability list on this page shows each price and its unit. The credits come from the Firecrawl team you connect to Cursor, and finding the right capability is free.

### Can Cursor use other providers besides legislation.gov.uk?

Yes. The same Firecrawl MCP server reaches every provider in Firecrawl Alexandria, along with Firecrawl's web search and scraping, so you connect once.

### Can I use legislation.gov.uk in other AI apps?

Yes. Connect Firecrawl to ChatGPT, Claude, Grok Bot, Muse signed in on a Firecrawl team with Alexandria enabled, or use the Firecrawl MCP server, CLI or API with an API key from that team, and the same legislation.gov.uk capabilities are available there. Keyless connections don't include Alexandria.
