MCP server exposing 6 tools for legislation-uk.
This URL is a JSON-RPC 2.0 endpoint over HTTP. Issue POST requests with a JSON-RPC body. Browsers and search crawlers land here on GET.
POST https://gateway.pipeworx.io/legislation-uk/mcp
Content-Type: application/json
{"jsonrpc":"2.0","id":1,"method":"tools/list"}
search_uk_legislation — Search UK legislation by title words (and optional year), returning matching Acts/instruments with their full-text URLs. UK legislation only. Source: legislation.gov.uk Atom feed. Document types: ukpga (UK Public General Acts), uksi (UK Statutory Instruments), asp (Scottish Parliament Acts), anaw/asc (Wales), nia (Northern Ireland), ukla (UK Local Acts). "type" is optional: give an exact code (e.g. "ukpga"), a plain category ("act", "si", "ssi"), or omit it entirely — omitted defaults to "ukpga" and the response says so.get_legislation — Get metadata for one specific piece of UK legislation by type + year + number (e.g. ukpga/2010/15 = Equality Act 2010). Returns title, type, year, number, status, extent, enactment date, a long-title summary, and the full-text URL. Content is XML; fields are best-effort parsed and a raw excerpt is included.get_legislation_section — Read the actual WORDS of one section of a UK Act or statutory instrument — "what does section 5 of the Data Protection Act 2018 say", "quote section 1 of the Human Rights Act", "text of s.170 DPA 2018". Returns the full text of that section alone, so a specific provision does not cost a whole statute. Identify the legislation by type + year + number (Data Protection Act 2018 = ukpga/2018/12) and give the section number. UK law exists in VERSIONS and they differ in substance: pass version to choose "current" (default — the law as amended and in force today), "enacted" (the original text as passed), or a date YYYY-MM-DD for the text as it stood on that day. as_at is an alias for a date version (e.g. as_at: "2019-01-01") — the same date is also accepted via version. legislation.gov.uk serves the NEAREST EARLIER version for a date with no amendment on it rather than erroring, so every response states the version it actually served (version_valid_from) alongside the date asked for, even when they differ. Source: legislation.gov.uk, the official database. Use search_uk_legislation or get_legislation first if you need the year and number.get_legislation_text — Read the text of a whole UK Act or statutory instrument — the body of the law rather than a catalogue entry. Use for short instruments and for reading an Act end to end; for one provision prefer get_legislation_section, which returns just that section. Large Acts run to megabytes, so this reads a bounded amount and says plainly when it stopped short rather than returning a silently clipped statute. UK law exists in VERSIONS that differ in substance: pass version to choose "current" (default — the law as amended and in force today), "enacted" (the original text as passed), or a date YYYY-MM-DD for the text as it stood on that day. as_at is an alias for a date version (e.g. as_at: "2019-01-01"). legislation.gov.uk serves the NEAREST EARLIER version for a date with no amendment on it rather than erroring, so every response states the version it actually served (version_valid_from) alongside the date asked for, even when they differ. Source: legislation.gov.uk, the official database.legislation_amendments — What has amended this UK Act or instrument, and (in the other direction) what this legislation itself amends — "what has changed the Data Protection Act 2018", "has section 13A been amended", "what does the Victims and Prisoners Act 2024 amend". Each row names the amending/amended instrument, the affected and affecting provisions, the type of change (inserted/substituted/repealed/omitted/amended etc.), whether it has actually been APPLIED (some amendments are made but not yet in force), and the commencement date. PAGED AT 50 — the response states total_results and total_pages; 50 rows is a page, never the whole change history (some Acts have thousands of recorded effects), pass page for more. direction "affected" (default) = changes made TO this legislation by others; "affecting" = changes this legislation makes TO others. Source: legislation.gov.uk /changes/ Atom feed.get_explanatory_notes — Read the Explanatory Notes for a UK Act — plain-language commentary written by the government department responsible, explaining what a section is meant to do and why. NOT part of the law and not endorsed by Parliament — use for context on intent, never as the text of the law itself (use get_legislation_section for that). Pass section to get the commentary for just that section; omit it for an overview plus the notes' own table of contents. Not every Act has notes (Appropriation, Consolidated Fund, Finance and Consolidation Acts never get them) and not every section gets its own paragraph — some are grouped or unremarked. Notes are written for the Act AS ENACTED and are not updated for later amendments. Source: legislation.gov.uk (HTML only — there is no XML/data feed for notes).Code samples (curl / TypeScript / one-click client install), schemas, and the live playground are on the pack page:
https://pipeworx.io/packs/legislation-uk/
Pipeworx is an open MCP gateway connecting AI agents to live data. pipeworx.io