Ask a question in plain English about any MP, debate, or vote and have an agent answer it with structured data direct from official Parliamentary sources.
UK Parliament does an amazing job of publishing data: every vote, debate, bill, MP's declared interests, and more is available to the public. But this is scattered across a dozen separate APIs.
That means answering a question as ordinary as "how has my MP voted on climate?" means stitching several endpoints and schemas together by hand, or worse, relying on third-party data sources which are often opinionated or out of date.
mp-mcp gives your agent an efficient way to navigate Parliament's data, and ensures responses are returned as structured JSON so they can be presented clearly, or direclty consumed by your application.
The aim is to lower the barrier to engage with Westminster for the civically-curious public, by providing clear, officially cited answers to questions about Parliament.
| Path | What it is |
|---|---|
[packages/mp-mcp](packages/mp-mcp) |
An npm-publishable Model Context Protocol server that exposes UK Parliament data to agents through a small set of intent-led tools. |
[apps/agent-of-parliament](apps/agent-of-parliament) |
A single-page browser demo: ask in plain English, watch cited cards — MPs, votes, debates, topic dossiers — assemble beside the chat. |
[apps/mcp-host](apps/mcp-host) |
A thin HTTP host that wraps mp-mcp behind a stateless /mcp endpoint, so the demo can reach it over the Anthropic MCP connector. |
An agent is only as credible as its sources and as usable as its tool surface. Three deliberate choices carry that weight:
- A small set of intent-led tools, not dozens of thin endpoints. Tools are shaped around what a person actually wants to know ("give me an overview of this MP", "what is Parliament doing about X") rather than mirroring the raw API surface. A focused toolset keeps an agent accurate; the default answer to "should we add a tool?" is no.
- A citation contract. Every tool response carries a
sourcesarray ofparliament.uk/hansard.parliament.ukURLs, and the server instructs the agent to cite them inline for every factual claim. This is what separates a grounded answer from a chatbot guessing over Wikipedia. - Response-format toggles and an eval suite. Tools return concise output by default and detail on request, to keep agent context lean; an eval suite holds the tool descriptions and behaviour to account so the surface doesn't quietly drift.
Add the server to Claude Code:
claude mcp add mp-mcp -- npx -y @jamesmccomish/mp-mcpOr add it to Codex:
codex mcp add mp-mcp -- npx -y @jamesmccomish/mp-mcpThen ask, in your client: "Who's my MP?" — see packages/mp-mcp for the full tool list, configuration, and local-development setup.
mp-mcp is a client of UK Parliament's official, openly-licensed public APIs — no scraping, no third-party data layer:
- Members API — MPs and Lords: biography, party, constituency, contact, history
- Commons Votes and Lords Votes — divisions (recorded votes)
- Hansard — the searchable official report of debates and statements
- Bills API — legislation, sponsors, stages
- Committees API — committee structure, membership, inquiries
- Questions & Statements API — written questions and answers
- Interests API — the Register of Members' Financial Interests
- postcodes.io — postcode to constituency lookup (Open Government Licence)
Some great projects that were used as inspiration and reference points:
This project queries the UK Parliament public APIs. The data is licensed under the Open Parliament Licence v3.0. When you surface this project's output to end users, you must attribute it:
Contains Parliamentary information licensed under the Open Parliament Licence v3.0.
The code is MIT licensed — see LICENSE.
See CONTRIBUTING.md and CODE_OF_CONDUCT.md. Project conventions live in .agents/project.md, with assistant entry points in AGENTS.md and CLAUDE.md. Design rationale and architecture decisions are in docs/ — start with docs/initial-implementation-plan.md and the ADRs.
