ID

i-dot-ai/parliament-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

31 stars 18 forks 质量 83 趋势 31MIT

议会API的MCP实现,包括Hansard和Members API。

概览

一个MCP服务器,大致映射到https://developer.parliament.uk/,的一个子集,同时提供额外的语义搜索功能。 该项目提供:- : 基于FastMCP的服务器 - : 一个小型Python软件包,用于查询并加载议会数据从https://developer.parliament.uk/到Qdrant- : 向量数据库,用于对Hansard和议会质询数据进行语义搜索。- : 通过mcp-remote proxy连接到Claude Desktop MCP服务器展示了13种辅助议会研究的工具: 1. - 获取选区或特定议员的选举结果 2.- 通过多种标准搜索下议院或上议院议员(包括地点/邮编搜索)3.- 获取全面的成员信息,包括个人简介、联系方式、兴趣、投票记录和委员会成员 4. - 获取某一议院在特定日期的政党状况 5.- 获取所有政府或反对党职位及其现任持有者的详尽名单 6.

概述(AI 翻译)

一个MCP服务器,大致映射到https://developer.parliament.uk/,的一个子集,同时提供额外的语义搜索功能。

建筑

该项目提供:

  • MCP 服务器:基于 FastMCP 的服务器
  • Python 包:一个用于查询和加载议会数据的小型 Python 包,用于从 https://developer.parliament.uk/ 向 Qdrant 发送议会数据
  • Qdrant:用于Hansard和议会质询数据语义搜索的向量数据库。
  • Claude集成:通过mcp-remote代理连接到Claude桌面

特色

MCP工具可用

MCP服务器展示了13种辅助议会研究的工具:

成员与选举
  1. get_election_results - 获取选区或特定成员的选举结果
  2. search_members - 通过多种条件(包括地点/邮编搜索)搜索下议院或上议院成员
  3. get_detailed_member_information - 获取全面的会员信息,包括个人简介、联系方式、兴趣、投票记录和委员会成员

议会结构

  1. get_state_of_the_parties - 获取特定日期房屋当事人的情况

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Parliament MCP Server

An MCP server that roughly maps onto a subset of https://developer.parliament.uk/, as well as offering additional semantic search capabilities.

Architecture

This project provides:

  • MCP Server: FastMCP-based server
  • Python package: A small python package for querying and loading parliamentary data from https://developer.parliament.uk/ into Qdrant
  • Qdrant: Vector database for semantic search over Hansard and Parliamentary Questions data.
  • Claude Integration: Connect to Claude Desktop via mcp-remote proxy

Features

MCP Tools Available

The MCP Server exposes 13 tools to assist in parliamentary research:

Members & Elections

  1. get_election_results - Get election results for constituencies or specific members
  2. search_members - Search for members of the Commons or Lords by various criteria (includes location/postcode search)
  3. get_detailed_member_information - Get comprehensive member information including biography, contact, interests, voting record, and committee membership

Parliamentary Structure

  1. get_state_of_the_parties - Get state of the parties for a house on a specific date
  2. list_ministerial_roles - Get exhaustive list of all government or opposition posts and their current holders
  3. get_departments - Get reference data for government departments

Committees

  1. list_all_committees - List all parliamentary committees by status and house
  2. get_committee_details - Get comprehensive committee information including members, publications, evidence, and upcoming events
  3. get_committee_document - Retrieve committee documents including oral evidence, written evidence, and publications

Parliamentary Business

  1. search_parliamentary_questions - Search Parliamentary Written Questions (PQs) by topic, date, party, or member
  2. search_debate_titles - Search through debate titles to find relevant debates
  3. find_relevant_contributors - Find members who have contributed most on specific topics
  4. search_contributions - Search Hansard parliamentary records for actual spoken contributions during debates

Quick Start (local qdrant)

You will need

  • Docker and Docker Compose
  • Node.js (for mcp-remote)
  • Claude Desktop (or another MCP client)
  • Azure OpenAI account with API access

Create a .env file by copying the .env.example in the project root and replace the necessary variables.

After configuring your .env file, run the following command for a one shot setup of the MCP server and the Qdrant database with some example data from June 2025.

make dev_setup_from_scratch

Once this is run, you can connect to the MCP server using this config

# Add this to your Claude Desktop config, or another MCP client:
# On macOS Claude Desktop config is located at `~/Library/Application\ Support/Claude/claude_desktop_config.json`
{
  "mcpServers": {
    "parliament-mcp": {
在 GitHub 查看完整 README

安装

npx mcp-remote http://localhost:8080/mcp/ --allow-http --debug
新手?先看 mcpskill.org 教程 →

配置

# Add this to your Claude Desktop config, or another MCP client: # On macOS Claude Desktop config is located at `~/Library/Application\ Support/Claude/claude_desktop_config.json` { "mcpServers": { "parliament-mcp": { "command": "npx", "args": ["mcp-remote", "http://localhost:8080/mcp/", "--allow-http", "--debug"] } } }