mcpField
U
UK Parliament - Open Data - Model Context Protocol Server

UK Parliament - Open Data - Model Context Protocol Server

Local
github.comData & Analytics4Updated 3w ago

About UK Parliament - Open Data - Model Context Protocol Server

A legacy .NET MCP server for researching UK Parliament data through official APIs, intended for parliamentary research with MCP-capable assistants. It covers topics from members and bills to Hansard and returns source URLs; active development has moved to a successor repository.

Key features

  1. 01Search members and constituencies
  2. 02Explore bills, votes, and committees
  3. 03Query Hansard and parliamentary activity
  4. 04Retrieve official API source URLs

Use cases

  1. 01Check an MP’s biography or voting record
  2. 02Find a bill’s stages and amendments
  3. 03Review committee meetings and evidence

MCP support

Exposes UK Parliament open-data API operations as stdio MCP tools for clients such as GitHub Copilot and Claude Desktop. It can return the API URLs used as sources.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

UK Parliament Open Data MCP .NET 9

🇬🇧 UK Parliament AI Assistant

Turn any MCP-capable AI into a live parliamentary research desk.
Ask about MPs, Lords, bills, votes, committees, Hansard, and more — answers come from official Parliament APIs, with sources cited every time.

Quick start · What you can ask · Setup · Example prompts · Successor project


Important

Active development has moved. This repository is the original .NET MCP lab.
The maintained project — with a full CLI, richer tooling, and ongoing fixes — is:
👉 ChrisBrooksbank/uk-parliament-data-mcp

CapabilityThis repo (legacy lab)Successor project
MCP server for AI assistants✅ .NET✅ Python (actively maintained)
Command-line interface (CLI)❌ Not here✅ Yes — CLI is only on the new repo
AIS / zero-install optionsLimited✅ Expanded
Ongoing enhancements & fixesArchived / low activity✅ Active

If you want the best experience today (especially terminal workflows), start on the successor repository.


🎬 See it in action

MCP in an AI assistant

Note: Claude Code and MCP servers are not authorised for use on parliamentary PCs. This demo was recorded on a non-parliamentary PC.

Ask natural-language questions; the assistant calls Parliament APIs through MCP and returns cited answers.

MCP demo: an AI assistant answering a parliamentary question using live UK Parliament data via MCP

MCP session — live tools, live data, source URLs included.

CLI on the successor project

Prefer the terminal? The CLI is only available on the new repo — not in this lab.

CLI demo from the successor project: terminal commands querying UK Parliament data

CLI demo from uk-parliament-data-mcp — install and run it there.


✨ Why this exists

Parliamentary data is public — but scattered across many APIs. This project wraps those endpoints as MCP tools so assistants like GitHub Copilot, Claude Desktop, and other MCP clients can:

BenefitWhat it means
🎯 Grounded answersResponses are fetched from official parliament.uk APIs, not model memory alone
🔗 Source transparencyEvery useful answer can list the API URLs used
⚡ Broad coverageMembers, bills, votes, committees, Hansard, questions, calendar, SIs, treaties, interests…
🧩 Works where MCP worksVS Code Copilot Chat (Agent mode), Claude Desktop, and other MCP hosts

Disclaimer: Unofficial, independent project. Not created, endorsed, or supported by UK Parliament. Data comes from public Parliament developer APIs.


🚀 Quick start

1. Prerequisites
2. Clone
git clone https://github.com/chrisbrooksbank-parliament/opendata-mcp-lab.git
cd opendata-mcp-lab
3. Point your MCP host at the server

VS Code — Command Palette → MCP: Add Server → Command (stdio):

dotnet run --project C:\code\opendata-mcp-lab\OpenData.Mcp.Server\OpenData.Mcp.Server.csproj

(Adjust the path to your clone.)

Claude Desktop — edit claude_desktop_config.json (UTF-8), then fully restart Claude:

{
  "mcpServers": {
    "opendata-server": {
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "C:\\code\\opendata-mcp-lab\\OpenData.Mcp.Server\\OpenData.Mcp.Server.csproj"
      ]
    }
  }
}
4. Start a session the right way

For best results, always begin with the session prompt (or say "Hello Parliament").

📋 Required system prompt (click to expand)
You are a helpful assistant that answers questions using only data from UK Parliament MCP servers.

When the session begins, introduce yourself with a brief message such as:

"Hello! I’m a parliamentary data assistant. I can help answer questions using official data from the UK Parliament MCP APIs. Just ask me something, and I’ll fetch what I can — and I’ll always show you which sources I used."

When responding to user queries, you must:

Only retrieve and use data from the MCP API endpoints this server provides.

Avoid using any external sources or inferred knowledge.

After every response, append a list of all MCP API URLs used to generate the answer.

If no relevant data is available via the MCP API, state that clearly and do not attempt to fabricate a response.

Convert raw data into human-readable summaries while preserving accuracy, but always list the raw URLs used.

To disconnect while keeping chat context: "Goodbye Parliament". Or simply start a new chat.

Try:

What is happening now in the House of Commons?

🗺 What you can ask

AreaExample questions
🔴 Live activityWhat's happening in the Commons right now? What's on in the Lords?
👥 MembersWho is the MP for …? Interests, biography, voting record, contributions
📜 Bills & legislationDetails, stages, amendments, publications, news for a bill
🗳 Votes & divisionsCommons/Lords divisions by topic, member, or division ID
🏛 CommitteesMembership, meetings, written/oral evidence, publications
📖 Hansard & procedureDebates, Erskine May, oral questions, calendar / non-sitting days
📍 ConstituenciesSearch seats, election results
📄 Official docsStatutory instruments, treaties, Acts
💎 TransparencyRegisters of interests and categories

🛠 Setup

VS Code + Copilot Chat
  1. Ctrl+Shift+P → MCP: Add Server → Command: Stdio
  2. Enter the dotnet run --project … command above
  3. MCP: List Servers → start the server
  4. Open Copilot Chat → Agent mode → enable this server’s tools
  5. Paste the system prompt (or Hello Parliament), then ask a question
  6. Approve tool/permission prompts when asked
Claude Desktop
  1. Settings → Developer → Edit Config
  2. Add the mcpServers block shown in Quick start
  3. Save as UTF-8, quit Claude completely, relaunch
  4. Confirm the server is running under Developer, then test with the system prompt
Optional: repo .mcp.json

This clone includes a sample .mcp.json pointing at a built server binary. Prefer dotnet run --project … unless you have already built OpenData.Mcp.Server.


💡 Prompting tips

TipWhy it helps
✅ Start with the system prompt / Hello ParliamentKeeps answers on MCP data and forces source URLs
🆕 New chat (+) when stuckClears loops and stale context
🔗 “Show me the API URL you just used.”Re-surfaces citations for verification
🧠 Cross-house questionse.g. “Has Chelmsford been mentioned in Commons or Lords?”
🧾 “Show me the JSON from the last MCP call.”Debug raw payloads

Example citation style you should expect:

https://members-api.parliament.uk/api/Members/Search?Name=…


💬 Example prompts

Live activity
  • What is happening now in both Houses?
  • What's currently happening in the House of Commons / Lords?
Members
  • Show me the interests of Sir Keir Starmer
  • Who is Boris Johnson? / Who is member 1471?
  • Biography, contacts, interests, contributions, voting record for a member ID
  • Portrait / thumbnail for member 172
Bills
  • Recent bills about fishing / environment
  • Details, stages, amendments, publications, news for bill 425
  • Bill types, stages catalogue, RSS feeds
Votes
  • Search Commons divisions for “refugee” / “climate” / “brexit”
  • Commons or Lords division by ID; results grouped by party
Committees
  • Committees on women's issues / healthcare
  • Meetings, members, written & oral evidence for a committee ID
Procedure, Hansard, calendar
  • Search Erskine May for the Mace
  • Oral question times; Hansard on a topic and date range
  • Parties, departments, answering bodies
  • Commons calendar; non-sitting days
Places, docs, transparency
  • Constituencies containing “london”; election results for a constituency ID
  • SIs about harbours; Acts mentioning roads; treaties involving Spain
  • Interest categories and published registers
Power-user
  • Show the full data from this pasted API result: {…}
  • Show JSON / API URL from the last MCP call
  • Bills sponsored by member 172 from the Environment department
  • Committee meetings on climate change between two dates

🏗 What's in this repository

opendata-mcp-lab/
├── OpenData.Mcp.Server/     # .NET MCP server (stdio tools)
│   ├── Tools/               # Members, Bills, Votes, Hansard, …
│   └── Context/             # API shape notes for tools
├── context/                 # Shared API context for LLMs
├── mcp-demo.gif             # MCP assistant demo
├── cli-demo.gif             # CLI demo (successor project only)
└── README.md

Stack: .NET 9 · MCP stdio transport · official Parliament HTTP APIs

Not included here: the full CLI, PyPI packaging, and newer host integrations — those ship only in
uk-parliament-data-mcp.


📌 Active development moved

This repoHistorical .NET lab / reference MCP server
Go here for new workgithub.com/ChrisBrooksbank/uk-parliament-data-mcp
CLIOnly on the successor repo
PackagePyPI: uk-parliament-mcp (successor)

Issues and PRs against this lab may still be useful for .NET-specific notes, but feature momentum is on the new project.


🤝 Contributing & feedback

Ideas, corrections, and API coverage suggestions are welcome. For the actively maintained line (including CLI), please open issues or PRs on the successor repository.


Built for curiosity, scrutiny, and better parliamentary questions — powered by public open data.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.