legislation.gov.uk

live GovernmentData

legislation.gov.uk MCP — the UK's official legislation database.

2 tools
0ms auth
free tier 50 calls/day

Tools

search_legislation

Search UK legislation by title words (and optional year), returning matching Acts/instruments with their full-text URLs.

No parameters required.

Try it
get_legislation

Get metadata for one specific piece of UK legislation by type + year + number (e.g. ukpga/2010/15 = Equality Act 2010).

No parameters required.

Try it

Test with curl

The gateway speaks JSON-RPC 2.0 over HTTP POST. You can test any pack directly from the terminal.

List available tools
bash
curl -X POST https://gateway.pipeworx.io/legislation-uk/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Call a tool
bash
curl -X POST https://gateway.pipeworx.io/legislation-uk/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_legislation","arguments":{}}}'

Use with the SDK

Install @pipeworx/sdk to call tools from any TypeScript/Node project.

TypeScript
import { Pipeworx } from '@pipeworx/sdk';
const px = new Pipeworx();
const result = await px.call("search_legislation", {});
ask_pipeworx
// Or ask in plain English:
const answer = await px.ask("legislation");