• v1.0.2 4eccf18734

    ric_harvey released this 2026-03-26 18:45:48 +00:00 | 0 commits to main since this release

    Fixed

    • leg_get_section now correctly extracts titles from API responses — Dublin Core dc:title uses lowercase after namespace prefix removal, parser now checks both cases
    • leg_get_section now unwraps Pblock and P1group/P2group/P3group container elements that the real API uses to wrap section content inside <Body>
    • DocumentMainType lookup now navigates into DocumentClassification element where the real API nests it, and extracts the short type code (e.g. ukpga) from the URI instead of relying on the long form value (e.g. UnitedKingdomPublicGeneralAct)
    • extractStructuredText() now handles UnorderedList, OrderedList, ListItem, and Para elements for legislation containing bullet-point lists (e.g. Equality Act 2010 s.4)
    • parseContents() now handles ContentsPblock elements used in table of contents responses
    • Added SecondaryMetadata fallback for parsing statutory instruments

    Tests

    • 176 tests passing (up from 162), 86.43% branch coverage
    Downloads
  • v1.0.1 9989843017

    ric_harvey released this 2026-03-26 18:13:38 +00:00 | 2 commits to main since this release

    Fixed

    • leg_get_section now returns actual legislative prose text instead of just metadata and sourceUrl — the parser was not navigating the <Primary><Body> and <Secondary><Body> wrappers used by the real API
    • leg_get_section now produces structured, readable text output preserving paragraph numbering and hierarchy (P1/P2/P3 nesting with indentation)
    • leg_changes_affecting and leg_changes_by now correctly parse effects from the real API, which wraps <Effect> elements inside a <content> element
    • Effects parser now handles the real API's attribute-based format (AffectedURI, AffectingURI, AffectedTitle, AffectingTitle on the Effect element)
    • Inline markup content (<Strong>, <Emphasis>, etc.) is no longer silently dropped during text extraction
    • Added P3 (sub-sub-paragraph) support to the XML parser array configuration
    Downloads
  • v1.0.0 0986b45fc8

    ric_harvey released this 2026-03-26 17:46:36 +00:00 | 3 commits to main since this release

    Initial Release

    13 MCP tools across 6 resource areas for searching, retrieving, and summarising UK legislation via the legislation.gov.uk API.

    Tools

    • Search: leg_search, leg_search_advanced, leg_search_new
    • Legislation: leg_get, leg_get_section, leg_get_version, leg_get_contents
    • Changes: leg_changes_affecting, leg_changes_by
    • Metadata: leg_status, leg_types
    • Publication Log: leg_updates
    • SPARQL: leg_sparql

    Highlights

    • Every response includes jurisdiction, enforcement status, and a source URL for verification
    • Generates standard legal citations (e.g. "Equality Act 2010 (c.15)")
    • Warns when there are unapplied amendments outstanding
    • Point-in-time retrieval lets you see legislation as it stood on any date
    • Server passes citation and referencing instructions to AI agents on connection
    • 4 built-in workflow prompts for getting started, searching, checking status, and comparing versions
    • No API key required
    • 156 tests with 85%+ coverage

    Install

    npm install -g legislation-gov-uk-mcp
    
    Downloads