Repository avatar
Monitoring
v2.1.0
active

parliament-poland-mcp-server

io.github.pkolawa/parliament-poland-mcp-server

Polish Parliament data MCP server - proceedings bills votes etc.

Documentation

logo

Parliament of Poland MCP Server

An MCP server for the Polish Parliament public API: the Sejm API (MPs, votings, legislative processes, ...) and the ELI API of legal acts published in Dziennik Ustaw and Monitor Polski.

Usage

This server is designed to be run with npx, allowing you to use it as a tool provider for LLM clients without a global installation. It requires Node.js 22 or newer.

Running with npx

To start the server, run the following command:

npx parliament-poland-mcp-server

Configuration for LLM Clients

To integrate this server with an LLM client (like LM Studio or others that support MCP), you can configure it to spawn the server process. Here is an example configuration:

{
  "mcpServers": {
    "parliament-poland-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "parliament-poland-mcp-server"
      ]
    }
  }
}

This configuration tells the client how to start the tool server.

Tools

Every tool is read-only (readOnlyHint: true) and queries the public Sejm API (openWorldHint: true). term is optional in every Sejm tool and defaults to the current term of the Sejm; the legal act tools do not use it. Tools that return data (all except the text tools get-interpellation-text, get-statement and get-act-text) declare an outputSchema and return the data as structuredContent too; lists come as { "items": [...] }. Lists that the API returns whole (MPs, votings of a sitting, clubs, committees, plenary sittings, terms, keywords of legal acts) are filtered and paginated by the server and come as { "total", "offset", "nextOffset", "items" }, where nextOffset is absent on the last page.

ToolWhat it returns
get-termsTerms (kadencje) of the Sejm with their dates; the current one is the default term
get-membersMPs (posłowie) of a term with their ID, club and district, filtered by club, name, district, voivodeship or active; 100 per page
get-memberDetails of one MP
get-mp-voting-statsAn MP's attendance in votings for each sitting day
get-mp-votingsHow an MP voted in every voting on one sitting day
get-clubsParliamentary clubs and circles (kluby i koła)
get-clubDetails of one club
get-committeesCommittees (komisje) with their codes, without members
get-committeeDetails of one committee, with members
get-committee-sittingsSittings of a committee, filtered by date, with the agenda as text
get-committee-sittingOne committee sitting with its agenda and videos
get-interpellationsInterpellations (interpelacje), filtered by title, MP, recipient, date or delay
get-interpellationDetails of one interpellation, with its replies
get-interpellation-textText of an interpellation or of a reply to it
get-written-questionsWritten questions (zapytania), filtered like interpellations
get-printsPrints (druki: bills, reports and other documents)
get-printDetails of one print
get-proceedingsPlenary sittings (posiedzenia) with their numbers and dates
get-proceedingOne plenary sitting with its agenda as text
get-current-proceedingThe current or next plenary sitting with its agenda as text
get-processesLegislative processes, filtered by title or document type
get-passed-processesLegislative processes that ended with a passed act
get-processOne legislative process with its stages, identified by its print number
get-transcriptsStatements in the transcript of one sitting day
get-statementText of one statement
get-videosVideo transmissions of a term
get-videos-by-dateVideo transmissions of one day (today by default)
get-votingsVotings of one plenary sitting, filtered by day or title; 50 per page
get-votingResult of one voting with a breakdown by club, optionally with each MP's vote
search-votingsVotings found by title, sitting or date range
get-bilateral-groupsBilateral groups (parliamentary friendship groups)
search-actsLegal acts in Dziennik Ustaw and Monitor Polski, by title, type, keywords, status or dates
get-actDetails of one legal act, with references to other acts (amending acts, consolidated texts…)
get-act-textText of a legal act or of one of its articles, in pages
get-act-keywordsKeywords that search-acts accepts

Legal acts come from the ELI API, which works independently of the Sejm API. An act is identified by its ELI: publisher (DU for Dziennik Ustaw, MP for Monitor Polski), year and position, e.g. DU/2024/1. The ELI field of a legislative process from get-process or get-passed-processes leads from a bill passed by the Sejm to the act as published, and the prints of an act lead back to the process.

Upgrading from 1.x

Version 2.0 makes the tools easier for LLMs to use and contains breaking changes:

  • Tool names. Tools are registered under short kebab-case names, e.g. get-members instead of Get-a-list-of-MPs-for-a-given-term. Update any client configuration, allow-lists or prompts that refer to the old names:

    Old and new tool names
    2.01.x
    get-termsGet-a-list-of-Sejm-terms
    get-membersGet-a-list-of-MPs-for-a-given-term
    get-memberGet-information-about-a-member-of-Parliament
    get-mp-voting-statsGet-voting-attendance-statistics-of-an-MP-for-each-sitting-day
    get-mp-votingsGet-how-an-MP-voted-on-a-given-sitting-day
    get-clubsGet-a-list-of-clubs-for-a-given-term
    get-clubGet-detailed-information-about-a-specific-club
    get-committeesGet-a-list-of-committees-for-a-given-term
    get-committeeGet-detailed-information-about-a-specific-committee
    get-committee-sittingsGet-a-list-of-sittings-of-a-committee
    get-committee-sittingGet-details-about-a-single-committee-sitting
    get-interpellationsGet-a-list-of-interpellations-for-a-given-term
    get-interpellationGet-detailed-information-about-a-specific-interpellation
    get-interpellation-textGet-the-text-of-an-interpellation-or-of-a-reply-to-it
    get-printsGet-a-list-of-prints-for-a-given-term
    get-printGet-detailed-information-about-a-specific-print
    get-proceedingsGet-a-list-of-proceedings-for-a-given-term
    get-current-proceedingGet-the-current-or-next-sitting-of-the-Sejm-with-its-agenda
    get-processGet-information-about-a-specific-legislative-process
    get-processesGet-a-list-of-legislative-processes-for-a-given-term
    get-passed-processesGet-a-list-of-passed-legislative-processes-for-a-given-term
    get-transcriptsGet-the-list-of-transcript-statements-for-a-Sejm-sitting-day
    get-statementGet-the-text-of-a-single-statement-from-a-Sejm-sitting-transcript
    get-videosGet-a-list-of-video-recordings-for-a-given-term
    get-videos-by-dateGet-video-transmissions-from-a-given-day
    get-votingsGet-a-list-of-votings-for-a-given-term
    get-votingGet-the-results-of-a-single-voting-with-a-breakdown-by-club
    search-votingsSearch-for-votings-in-a-given-term
    get-written-questionsGet-a-list-of-written-questions-for-a-given-term
    get-bilateral-groupsGet-a-list-of-bilateral-groups-in-the-Sejm
    search-actsSearch-Polish-legal-acts-in-Dziennik-Ustaw-and-Monitor-Polski
    get-actGet-details-of-a-Polish-legal-act
    get-act-textGet-the-text-of-a-Polish-legal-act-or-of-one-of-its-articles
    get-act-keywordsList-keywords-used-to-classify-Polish-legal-acts
  • term is optional everywhere and defaults to the current term.

  • Responses contain compact JSON (no indentation) instead of pretty-printed JSON, and JSON tools also return structuredContent matching their outputSchema. The text messages before the data are unchanged.

  • get-interpellations sends its filters to the API under the names the API supports, so dateFrom, dateTo and mp now actually filter the results. The number, club and status parameters, which the API never supported, are removed; use get-interpellation for a single interpellation and delayed: true for interpellations with an overdue answer. New parameters: recipient, modifiedSince, delayed.

  • get-written-questions accepts only an MP ID in from and gains delayed.

  • get-proceedings no longer returns the agenda and schedules of each sitting as HTML, which made the list about 700 KB; it returns the number, title, dates and current flag. The new get-proceeding tool returns one sitting with its agenda as plain text.

  • get-members returns 100 MPs per page with id, firstLastName, club, districtNum, districtName, voivodeship and active (about 14 KB instead of 240 KB for all 494 MPs of the 10th term). Ask for more fields with fields (e.g. ["profession", "birthDate"]); get-member returns everything about one MP. New filters: club, name (ignores case and Polish diacritics), active, district (number or name) and voivodeship.

  • get-votings returns 50 votings per page (the 147 votings of the first sitting of the 10th term were 87 KB) without the PDF link and the term. New filters: date (a day of the sitting) and title (words in the title, topic or description). search-votings returns the same fields.

  • get-committees no longer returns the members of each committee, which made the list of the 40 committees of the 10th term 173 KB instead of 28 KB; get-committee returns the members of one committee.

  • Pagination of whole lists. offset and limit of get-members, get-votings, get-clubs, get-committees, get-proceedings and get-terms are applied by the server, because the API does not document them for these lists. These tools now return total and nextOffset with the items. get-clubs, get-committees, get-proceedings and get-terms still return the whole list by default. get-prints returns 50 prints by default and paginates the list itself if the API returns more than limit.

  • get-print takes printNumber as a string, so additional prints such as 1070-A can be fetched.

  • get-processes gains the title and documentType filters of get-passed-processes.

  • Parameters with a fixed format are validated: dates (YYYY-MM-DD), club IDs, print numbers and sort fields.

Development

To run the server in a development environment:

  1. Clone the repository.
  2. Install dependencies: npm install
  3. Run unit tests: npm test
  4. Run live API integration tests (requires internet access): npm run test:live-api
  5. Build the project: npm run build
  6. Run the server: npm start

Author

Piotr Kolawa (@pkolawa) / (Linkedin)

License

This project is licensed under the MIT License - see the LICENSE file for details.