UK Parliament MCP server

Integrates with UK Parliament's API and Hansard debates to provide constituency searches, member information, election results, government post listings, and semantic search through parliamentary debates and written questions using Azure OpenAI embeddings for political research and policy analysis.
Back to servers
Setup instructions
Provider
i.AI
Release date
Jul 05, 2025
Stats
10 stars

Parliament MCP Server provides access to UK parliamentary data through an MCP server interface. It offers tools to search constituencies, members, debates, and parliamentary questions, along with semantic search capabilities powered by Qdrant vector database.

Quick Start

Prerequisites

You'll need:

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

One-Step Setup

  1. Create a .env file by copying the .env.example file and fill in the required variables, including your Azure OpenAI credentials.

  2. Run the automated setup:

make dev_setup_from_scratch
  1. Configure Claude Desktop by adding this to your configuration file:
{
  "mcpServers": {
    "parliament-mcp": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:8080/mcp/", "--allow-http", "--debug"]
    }
  }
}

Manual Setup

1. Clone and Configure

# Clone the repo
git clone [email protected]:i-dot-ai/parliament-mcp.git
cd parliament-mcp

# Set up environment file
cp .env.example .env
nano .env  # Edit to add your configuration

2. Start Services

# Start Qdrant and MCP server
docker-compose up --build

The services will be available at:

  • MCP Server: http://localhost:8080/mcp/
  • Qdrant: http://localhost:6333

3. Initialize and Load Data

# Initialize Qdrant
docker compose exec mcp-server uv run parliament-mcp --log-level INFO init-qdrant

# Load Hansard data
docker compose exec mcp-server uv run parliament-mcp load-data hansard --from-date 2025-06-23 --to-date 2025-06-27

# Load Parliamentary Questions
docker compose exec mcp-server uv run parliament-mcp --log-level WARNING load-data parliamentary-questions --from-date 2025-06-23 --to-date 2025-06-27

4. Install mcp-remote

npm install -g mcp-remote

5. Configure Claude Desktop

Add the server configuration to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "parliament-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8080/mcp/",
        "--allow-http",
        "--debug"
      ]
    }
  }
}

You can also generate this configuration automatically:

make mcp_claude_config

6. Restart Claude Desktop

Claude should now have access to the Parliament MCP tools.

Available MCP Tools

The MCP Server provides 11 tools for parliamentary research:

  1. search_constituency - Search constituencies by name or get details by ID
  2. get_election_results - Get election results for constituencies or specific members
  3. search_members - Search Commons or Lords members by various criteria
  4. get_detailed_member_information - Get comprehensive member information
  5. get_state_of_the_parties - Get party makeup for a house on a specific date
  6. get_government_posts - Get all government posts and current holders
  7. get_opposition_posts - Get all opposition posts and current holders
  8. get_departments - Get reference data for government departments
  9. search_parliamentary_questions - Search Parliamentary Written Questions
  10. search_debates - Search debate titles for relevant discussions
  11. search_contributions - Search Hansard for actual spoken contributions

Usage Examples

You can use natural language queries with Claude, such as:

Parliamentary Questions

  • "Search for parliamentary questions about climate change policy"
  • "Find questions asked by Conservative MPs about healthcare funding"

Hansard Contributions

  • "Search for contributions about the budget debate"
  • "Find speeches by Keir Starmer about economic policy"

Member Information

  • "Get detailed information about the MP for Birmingham Edgbaston"
  • "Search for Labour MPs elected in 2024"

Parliamentary Structure

  • "Show me the current government ministers"
  • "Get the state of the parties in the House of Commons"

Troubleshooting

Common Issues

MCP Connection Issues

  • Ensure MCP server is running on port 8080
  • Verify Claude Desktop configuration is correct

Data Loading Failures

  • Check Azure OpenAI credentials in .env file
  • Ensure Qdrant is running and accessible
  • Use --ll DEBUG flag for detailed logging

Qdrant Issues

Logs and Debugging

View server logs:

docker-compose logs mcp-server

Check Qdrant status:

curl http://localhost:6333/healthz
# Or use the make command:
make qdrant_health

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "parliament-mcp" '{"command":"npx","args":["mcp-remote","http://localhost:8080/mcp/","--allow-http","--debug"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "parliament-mcp": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "http://localhost:8080/mcp/",
                "--allow-http",
                "--debug"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "parliament-mcp": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "http://localhost:8080/mcp/",
                "--allow-http",
                "--debug"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later