uk-parliament-mcp-server
Public Hosted Server: https://uk-parliament.caseyjhand.com/mcp
Overview
Westminster records from the official UK Parliament Bills, Members, Commons and Lords Votes, Hansard, Written Questions and Statements, and Committees APIs. Search parliamentary business, retrieve selected records and source links, and trace members, bills, votes, answers, statements, and committee publications across their distinct identifiers. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above; no API key is required.
Tools
Tool | Description |
| Resolve filter IDs, identifier namespaces, and historical coverage guidance |
| Search and order bill summaries by title, House, session, sponsor, department, stage, type, and status |
| Retrieve bill details, stages, publications, amendments, and ping-pong motions |
| Find current and former MPs and peers, including dated membership searches |
| Retrieve profiles, roles, committee seats, official contacts, interests, and voting history |
| Search House-scoped divisions and member votes; inspect metadata, voters, and party totals |
| Search spoken contributions with complete source text where supplied |
| Search question and answer previews or retrieve complete question details |
| Search written ministerial statement previews or retrieve complete statement details |
| Discover committees and business; retrieve memberships, publications, written/oral evidence metadata, and the evidence Html rendition |
Related MCP server: UK Parliament MCP Server
Capability reference
ukparl_lookup_reference tool
topic:identifiers,coverage,bill_stages,bill_types,parties,departments, oranswering_bodies; live directories default to 10 rows, capped at 20, with optionalnameContainsAND-token filteringhouseis required only forparties; that directory covers active parties in the selected House, not every historical party. Static guides accept neither House nor name filtersIdentifier guidance distinguishes reference
stageIdfrom bill-specificbillStageId, House-scoped division IDs, Questions API IDs from UINs, and committee person IDs from Members API IDsdepartmentsIDs feedukparl_search_bills.departmentId; they are distinct from the answering-body IDs that filter written questions and statements
ukparl_search_bills tool
Optional
query, currenthouse,originatingHouse,sessionId,memberId,departmentId,stageIds, andbillTypeIds; each ID array accepts up to 20 entries. Defaults to 10 bills, capped at 100sortOrder:TitleAscending,TitleDescending,DateUpdatedAscending, orDateUpdatedDescending; omission preserves source ordering. OptionalisDefeatedandisWithdrawnaccept true or false.inAmendableStage: truerestricts to amendable stages; false is the same as omitting itResults are
detailLevel: "summary"withbillId; one payloadsourcecovers the request, andpagecarries collection continuation. No current-session scope is inferred. Resolve reference filters withukparl_lookup_reference
ukparl_get_bill tool
Required
billId;sectiondefaults tooverview, or selectsstages,stage,publications,amendments,amendment,motions, ormotion. Collections default to 20 records, capped at 100Stage, amendment, and motion selections require the bill-specific
billStageIdfromstages; singular amendment/motion retrieval also needsitemIdfrom the parent collection (amendmentIdfor amendments,motion.idfor motions). Amendment/motion lists are summaries; singular selectors retrieve complete textOnly
section: "amendments"acceptsamendmentNumber(a string retaining letter suffixes), officialdecision, and sponsoringmemberIdfilters. Filters apply before source pagination; singular retrieval still usesitemIdMissing entities return
found: falsewithguidance.section: "publications"deriveslegislationHandoff(authoritative_link,not_enacted, orunavailable) from the bill's published documents; only supplied legislation.gov.uk links establish a statute handoffOverview reads metadata only. Unless
isActis explicitly false, itsunavailablehandoff explains that publications remain unchecked; repeat with the samebillIdandsection: "publications"to discover statute links
ukparl_search_members tool
Optional
name,constituency(source location text: constituency name or postcode),partyId, andhouse;currentOnlydefaults tofalse, including current and former members. Defaults to 10 rows, capped at 20asOfselects membership on a realYYYY-MM-DDdate and acceptsname, pagination, andcurrentOnly: falsealongside it; the source returnslatestParty,latestHouseMembershipand the display name as they stood on that date, not the member's current valuesSummary hits carry
memberIdforukparl_get_member; the payload carries onesourceand thepage. Unknown source fields remain absent or null
ukparl_get_member tool
Required
memberId;section:profile(default),roles,committee_seats,contact,interests, orvoting. Roles withoutcategoryreturns an availability outline; select a returned category for whole role periodshouseis required for interests and voting, and omitted elsewhere. Local histories default to 20 rows, capped at 50; voting uses native 20-row pages regardless oflimitfoundandguidancedistinguish missing members and unavailable source collections. Interest trees and committee relationships retain source pointers; voting preserves recorded lobby and teller facts without inferring abstention or lifetime participation
ukparl_search_divisions tool
Required
house:commonsorlords;mode:search(default),detail,voters, orparty_totals. Search acceptsquery,memberId, and inclusivestartDate/endDate; defaults to 5 divisions, capped at 24 for Commons and 10 for LordsOther modes require a
divisionIdfrom the same House. Voters default to 20 rows, capped at 50, with exact sourcepartylabels andlobby: Commonsaye,no,not_recorded; Lordscontent,not_contentDetail preserves headline counts and teller identities;
partyTotalscounts listed non-tellers and tellers separately.not_recordedis the source list, never an abstention claim; member searches include teller participationSearch with
memberIdreturnsmemberVote: { memberId, lobby, wasTeller }on each result, using the House's recorded lobby. A missing result does not imply abstention
ukparl_search_hansard tool
Optional
query,memberId,house, inclusivestartDate/endDate, and numericdebateSectionId; defaults to 5 contributions, capped at 100. Dates areYYYY-MM-DD, with no inferred windowsortOrder:SittingDateDesc(newest sitting first, the source default) orSittingDateAsc. Results follow sitting date, notrank; within one sitting, including adebateSectionIdsearch, the source order is highestorderInDebateSectionfirst under either valuedetailLevel: "complete"carries full source contribution text, including HTML;summarymeans the source supplied only a preview. Section filtering does not establish a complete debate transcriptcoveragereports historical limitations, including the 2004–2006 website warning; empty results do not prove no debate occurred. Narrow date windows after timeouts; useukparl_lookup_referencewithtopic: "coverage"for archive guidance
ukparl_search_questions tool
mode: "search"(default) acceptsquery,uin, asking-membermemberId,answeringMemberId,house, up to 20answeringBodyIds,answered, and inclusivetabledFrom/tabledTo/answeredFrom/answeredTodates (YYYY-MM-DD). Defaults to 10 previews, capped at 100Search includes all sessions and withdrawn questions; omitted
answeredincludes either state.mode: "detail"takes a returnedquestionIdalone for complete question/answer HTML, corrections, and attachment metadata; a UIN is not aquestionIduinretains leading zeros and normalizes theHLprefix. Without dates, reused UINs can return candidates across sessions; combinetabledFrom/tabledToand House filters to narrow them, then retrieve a returnedquestionIdResults distinguish
detailLevel: "summary"from"complete"; detail misses returnfound: falsewithguidance. Attachments are links and metadata, not downloaded files
ukparl_search_statements tool
mode: "search"(default) acceptsquery,uin, making-ministermemberId,house, up to 20answeringBodyIds, and inclusivemadeFrom/madeTodates (YYYY-MM-DD). Defaults to 10 previews, capped at 100; search covers all sessionsmode: "detail"takes a returnedstatementIdalone for the complete HTML, attachment metadata, and linked statements; a UIN is not astatementId. UINs such asHLWS419are reused across sessions, so combineuinwithmadeFrom/madeToA
linkedStatementsentry withlinkType: "CorrectedAnswer"carries aquestionIdforukparl_search_questionsmode: "detail", not astatementId.noticeNumberis present for Commons statements onlyResults distinguish
detailLevel: "summary"(plain-text preview) from"complete"; detail misses returnfound: falsewithguidance. Attachments are links and metadata, not downloaded files
ukparl_get_committee tool
mode: "search"(default) acceptsquery,house(commons,lords,joint), andstatus: Current|Former|All.detail,members, andpublicationsrequirecommitteeId;inquiriesaccepts it optionally for committee-specific or cross-committee discovery. Every collection mode defaults to 10 records, capped at 100inquiryrequiresbusinessId;publicationrequirespublicationId.businessIdcan also filter publications.membershipselectsall(default),current, orformerin members mode;queryin inquiries/publications requires at least two charactersinquiriesacceptsstatus: Open|Closed,acceptingEvidence, inclusiveopenedFrom/openedTodates, andsortOrder: DateOpenedNewest|DateOpenedOldest|PublicationDateAscending|PublicationDateDescending.acceptingEvidence: truerestricts to accepting businesses; false is the same as omitting it. All business types remain labelled byisInquirypublicationsaccepts repeatedpublicationTypeIds, inclusivepublishedFrom/publishedTodates, andsortOrder: PublicationDateAscending|PublicationDateDescending|ResponseDateAscending|ResponseDateDescending. Omitted filters preserve source defaultsevidencerequiresbusinessIdandevidenceType: written|oral;evidence_detailandevidence_documentrequireevidenceIdand the sameevidenceType. These IDs occupy separate written/oral namespaces. Records retain typed entities andsourcePathrelationships, witnesses, organisations, dates, source state, and supplied document links. Publications remain separate reports, responses, and correspondenceevidence_documentreturns the evidence record plusdocumentHtml, the published Html rendition decoded verbatim (no text extraction), anddocumentSourcefor that request. A record with no Html rendition, or a document 404, staysfound: truewith a notice. No other mode downloads a fileEvery file entity with a
fileDataFormatcarriesapiRoute, a relative Committees API route that returns base64 JSON, not a public page;urlstays as supplied, null when the source gives none. List items omit what every row repeats: publication items omitcommittee, and written-evidence items omitcommitteesandcommitteeBusiness. The detail modes return them
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
UK Parliament-specific:
Keyless, read-only access to seven official Westminster API origins; devolved legislatures are outside scope
Separate identifier namespaces and explicit source selections, with no inferred current session or date window
Shared per-origin backpressure and a 45-second call deadline across related requests. An attempt may use all of the remaining budget; a transient failure retries at most twice, and only while the budget left after the wait covers an attempt as long as the one that failed
Hansard coverage is source-specific: the archive starts on 22 November 1803, the Spoken API minimum date is unknown, and there is no automatic historical-archive fallback
Agent-friendly output:
Provenance — source API, request URL, retrieval timestamp, and licence link accompany source records;
appliedreports effective selections and limitsWhole-record pagination —
page.returned,hasMore, andnextCursordescribe actually emitted records, withtotalonly when known. The caller'slimitsets the page size; a collection cursor resumes at its offset under anylimit, while member voting's native-page cursors keep their 20-row pageLossless large records —
delivery: "full" | "outline" | "fragment"; a record whose own JSON passes 24,000 UTF-8 bytes returnscontentPagedescriptors in replies that fit 24,000 bytes across both output surfaces, and repeating the original inputs plus eachcontentCursorreconstructs it exactlyCompact JSON — content renders complete values as reversible JSON blocks with clickable source links. An outline entry's optional
jsonValueis complete JSON text you can decode directly; itscontentCursorstill retrieves the same value. Fragment sizes adapt to the response budget; concatenate their JSON text before decodingExplicit recovery —
invalid_cursorrestarts a selection;source_changedrestarts content retrieval after an upstream revision. An upstream 5xx ishttp_server_errorand a spent call budget iscall_deadline_exceeded; each tool's hint names its next step, including the narrower inputs that reduce upstream work where the tool has them. Search previews, missing records, and unavailable collections remain distinctSelector errors name each missing or incompatible field and its repair in deterministic order, before network requests; existing error reasons and recovery hints remain stable
The
uk-parliament-guideskill carries the identifier chains across Members, Bills, Votes, Hansard, Questions, Statements and Committees IDs, plus the gates for choosing a House, a member's past party, unrecorded votes, official counts, and written versus spoken records; MCP clients read it as the resourceskill://uk-parliament-guide/SKILL.md, and it ships in the npm package underskills/
Getting started
Connect to the hosted instance, no install:
claude mcp add --transport http uk-parliament-mcp-server https://uk-parliament.caseyjhand.com/mcpOr run it locally:
claude mcp add uk-parliament-mcp-server -- npx -y @cyanheads/uk-parliament-mcp-serverFor other clients, add this to the MCP config file:
{
"mcpServers": {
"uk-parliament-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/uk-parliament-mcp-server"]
}
}
}No API key is required. For Docker or a source build, see Running the server.
Configuration
Variable | Description | Default |
| Transport: |
|
| Initial HTTP server port; startup logs report the bound port after collision retries. |
|
| HTTP bind address. |
|
| HTTP MCP endpoint. |
|
| HTTP session mode: |
|
| Authentication: |
|
| Log level ( |
|
| Directory for log files (Node.js only). |
|
| Storage backend: |
|
| Enable OpenTelemetry. |
|
See .env.example for the common framework overrides. There are no server-specific environment variables.
Running the server
Local development
Requires Bun v1.4.4 or higher (or Node.js v24+) and internet access to the official Parliament APIs.
Clone and install:
git clone https://github.com/cyanheads/uk-parliament-mcp-server.git cd uk-parliament-mcp-server && bun install cp .env.example .env # edit .env for transport, logging, or authentication overrides as neededBuild and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Docker
docker run --rm -p 3010:3010 ghcr.io/cyanheads/uk-parliament-mcp-server:latestThe image defaults to HTTP transport, stateless sessions, and logs to /var/log/uk-parliament-mcp-server. For an MCP client using stdio, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/uk-parliament-mcp-server:latest"]. Build locally with docker build -t uk-parliament-mcp-server .; --build-arg OTEL_ENABLED=false omits the optional OpenTelemetry peers.
Project structure
Directory | Purpose |
| Ten tool definitions ( |
| Fixed-origin transport, provenance, cursors, answering-body filter check, and lossless content delivery. |
| Bill search, scrutiny records, publications, and reference directories. |
| Member discovery, profiles, biographies, interests, and voting history. |
| Commons/Lords division metadata and recorded voter collections. |
| Spoken contribution search and historical coverage metadata. |
| Written question previews and complete question/answer records. |
| Written ministerial statement previews and complete statement records. |
| Committee business, memberships, publications, evidence metadata, and typed relationships. |
| Unit and integration tests, mirroring the |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging,ctx.statefor storageRegister new tools and resources in the
createApp()arrays insrc/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
Contains Parliamentary information licensed under the Open Parliament Licence v3.0 where applicable. Personal data, parliamentary marks, and third-party rights are excluded; preserve the source's notices and check rights before reusing excluded material. This software is independent and does not imply parliamentary endorsement.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search MPs and Lords, fetch profiles, synopses, and Westminster constituencies
UK Parliament MCP — Members, Bills, Hansard APIs
Search Parliamentary questions and motions from UK House of Commons
Query UK Parliament, elections, crime stats, ONS census data, and national archives
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides access to live UK Parliament data including bills, votes, MP profiles, and financial interests without requiring an API key. It enables users to track parliamentary rebellions, search petitions, and cross-reference voting records with declared financial interests.59MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying UK Parliament data including MPs, Lords, bills, Hansard debates, and divisions.72 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables tracking of Canadian federal parliamentary records by searching bills, members, House divisions, and indexed Hansard speeches, then retrieving detailed dossiers, profiles, tallies, and full speech text from official public sources. Runs over STDIO or Streamable HTTP with no API key required.95 npm1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables discovery and retrieval of European Parliament procedures, MEPs, plenary votes, documents, speeches, and questions from the Open Data API over STDIO or Streamable HTTP.136 npm1Apache 2.0