npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

republic-mcp

v0.3.3

Published

MCP Server for Italian Parliament Open Data (Camera, Senato e OpenPolis) — SPARQL tools over the official Camera dei Deputati and Senato della Repubblica endpoints, plus curated OpenPolis/Openparlamento data (indice di forza, presenze, votazioni, decreti)

Downloads

237

Readme

RepublicMCP — Italian Parliament Data MCP Server

npm version License: Apache-2.0 Listed in italia-mcp-servers

MCP (Model Context Protocol) server for Italian Parliament open data — Camera dei Deputati and Senato della Repubblica via their official SPARQL endpoints, plus curated OpenPolis data. 53 tools, hand-mapped ontologies, gotchas documented so you don't have to rediscover them.

Overview

RepublicMCP lets AI assistants (Claude, or any MCP client) query Italian Parliament data — deputies, senators, bills, votes, groups, commissions, governments, floor speeches — through 53 specialized tools, built directly on the official SPARQL endpoints and ontologies of both chambers.

Key Features

  • 53 MCP tools across Camera (20), Senato (26), and OpenPolis (7)
  • SPARQL-based, type-safe TypeScript implementations
  • Dual institution support — Camera dei Deputati and Senato della Repubblica, each with its own query builder because the two ontologies disagree in ways that will break your queries if you assume they're compatible
  • Rich type system based on the official ontologies (OCD for Camera, OSR for Senato)
  • Published on npm as republic-mcp

Why RepublicMCP exists (and what makes it different)

Camera and Senato publish their data as two separate, independently modeled SPARQL ontologies (OCD and OSR) that look similar on the surface and diverge in ways that are easy to get wrong. Mapping both by hand — and documenting exactly where they diverge — is most of the actual work behind this project:

| | Camera (OCD) | Senato (OSR) | |---|---|---| | Surname property | foaf:surname | foaf:lastName | | Legislature | full URI | plain integer | | Mandate start/end | ocd:startDate / ocd:endDate | osr:inizio / osr:fine | | Active-mandate pattern | MINUS { ?m ocd:endDate ?e } | FILTER(!bound(?fine)) | | Parliamentary groups | ocd:gruppoParlamentare | reuses Camera's class, but with OSR properties |

This is a small sample — the full comparison (with query-by-query examples) is in docs/senato/03-differenze-camera-senato.md, and the TypeScript type diagrams for each ontology are in docs/camera/ontology-diagram.md and docs/senato/ontology-diagram.md. If you're building anything else against these endpoints, that document will likely save you the hours it took to work out the hard way.

Known limitations

  • Data isn't real-time — the SPARQL endpoints lag behind official publication.
  • Many older votes only have aggregate counts, not individual favorevole/contrario/astenuto per member.
  • Full act/bill text isn't in the SPARQL endpoint (only metadata + iter) — for full text see documenti.camera.it / the Senato equivalent.
  • No local caching yet — every query hits the live endpoint.

Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • npm or yarn
  • Claude Desktop (for MCP integration) or any other MCP-compatible client

Installation

npm install -g republic-mcp
# or, from source:
npm install && npm run build

Configuration with Claude Desktop

Add to your claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "republican": {
      "command": "npx",
      "args": ["-y", "republic-mcp"]
    }
  }
}

See INSTALLATION.md for detailed setup instructions, including running from a local clone.

Example: what you can actually ask it

  • "Cerca Giorgia Meloni tra i deputati e dammi il suo indice di forza" → search_deputati + openpolis_indice_di_forza
  • "Che iter ha fatto il DDL sull'autonomia differenziata al Senato?" → get_ddl_con_iter
  • "Chi ha votato contro l'ultimo decreto-legge sulla giustizia?" → get_votazioni + get_espressioni_voto
  • "Quali sono i decreti-legge in scadenza di conversione?" → openpolis_decreti_legge

Available MCP Tools

Camera dei Deputati (20 tools)

Deputies & Members

  • camera_search_deputati - Search deputies by name, group, or legislature
  • camera_get_deputati_con_mandati - Deputies in office with mandate counts (current + past legislatures)
  • get_deputato_info - Detailed deputy information by URI (bio, mandates, group, commissions, roles)

Parliamentary Acts

  • search_atti - Search parliamentary acts by title, type, or legislature
  • get_atto_info - Detailed act information, including iter phases, sponsors and votes
  • get_atti_con_fasi - Acts with full iter phases and approval dates
  • get_atti_deputato - Acts by deputy (first signer/co-signer)

Voting

  • get_votazioni - Recent/filtered votations
  • get_espressioni_voto - Detailed per-deputy vote expressions for a specific votation
  • get_statistiche_voto_deputato - Deputy voting statistics (favorevoli/contrari/astenuti)

Organizations

  • get_gruppi_parlamentari - Parliamentary groups for a given legislature
  • get_commissioni - Commissions and parliamentary organs
  • get_incarichi_gruppi_parlamentari - Group leadership roles with start/end dates
  • get_incarichi_organi_parlamentari - Commission/organ roles with dates

Government

  • get_governi - Governments of the Republic
  • get_governo_membri - Members of a specific government
  • get_incarichi_governo_deputati - Ministerial positions held by deputies

Debates

  • search_interventi - Search floor speeches by topic (returns deputies + sittings)
  • get_interventi_per_argomento - Interventions filtered by argument, optionally by deputy

Advanced

  • execute_sparql - Run a custom SPARQL query against the Camera endpoint (power users)

Senato della Repubblica (26 tools)

Senators

  • senato_get_senatori_correnti - Senators currently in office
  • senato_cerca_senatori - Search senators (name, surname, legislature, mandate type, region)
  • senato_get_senatore_dettagli - Detailed senator information (bio, photo, birth, residence)
  • senato_get_senatore_mandati - Full mandate history across legislatures
  • senato_get_senatori_a_vita - Life senators (appointed by/former Presidents)
  • senato_get_senatori_per_legislatura - All senators of a given legislature
  • senato_get_senatori_per_regione - Senators elected in a given region

Bills (DDL)

  • senato_get_ddl_recenti - Recent bills presented at the Senate
  • senato_get_ddl_senatore - Bills presented or signed by a senator
  • senato_get_ddl_per_stato - Bills filtered by status (in progress, approved, rejected, etc.)
  • senato_get_ddl_iter - Full bill details including the complete legislative iter
  • senato_get_ddl_firmatari - All signers/sponsors of a specific bill
  • senato_get_ddl_dettagli - Full bill details (title, nature, dates, texts, status)
  • senato_cerca_ddl_per_titolo - Search bills by keyword in the title

Voting

  • senato_get_votazioni_recenti - Recent Senate votations with counts and outcomes
  • senato_get_votazione_dettagli - Full details of a specific votation
  • senato_get_voti_senatore - Votes cast by a senator (favorevole/contrario/astenuto)
  • senato_get_statistiche_voto_senatore - Voting statistics for a senator
  • senato_get_votazioni_per_esito - Votations filtered by outcome
  • senato_get_voti_individuali - Individual votes of all senators for a specific votation

Organizations

  • senato_get_commissioni_attive - Active Senate commissions
  • senato_get_composizione_commissione - Membership of a commission
  • senato_get_commissioni_senatore - Commissions a senator is/was part of
  • senato_get_gruppi_attivi - Active parliamentary groups
  • senato_get_composizione_gruppo - Membership of a parliamentary group
  • senato_get_gruppi_senatore - Groups a senator is/was part of

OpenPolis · Openparlamento (7 tools)

Curated, enriched data via the OpenPolis OPDM REST API (not SPARQL). Adds metrics the raw chamber endpoints lack: indice di forza (power ranking), attendance stats, voting cohesion, decree-law conversion status. Anonymous access (10k req/day); set OPENPOLIS_TOKEN (JWT) to lift the limit. License: CC-BY-NC — attribute "Fonte: Openpolis".

  • openpolis_cerca_parlamentari - Search deputies/senators (by name/role), ranked by power index
  • openpolis_indice_di_forza - Power-index (pp) ranking of parliamentarians
  • openpolis_profilo_parlamentare - Member profile: group, constituency, attendance stats
  • openpolis_cerca_votazioni - Votes by topic, with outcome, confidence/key votes, cohesion
  • openpolis_decreti_legge - Decree-laws with conversion status + Normattiva link
  • openpolis_attivita_legislativa - Bills/acts with type, iter phase, signers and rapporteurs
  • openpolis_organi_parlamentari - Groups (with power weights), presidency, commissions

Project Structure

republicMCP/
├── src/
│   ├── core/                    # Shared infrastructure
│   │   ├── mcp/                 # MCP tool registry
│   │   ├── sparql/              # SPARQL client & query builder
│   │   ├── types/               # Common types
│   │   └── index.ts
│   ├── institutions/            # Institution-specific modules
│   │   ├── camera/              # Camera dei Deputati
│   │   │   ├── ontology/        # OCD types & prefixes
│   │   │   ├── queries/         # SPARQL query builders
│   │   │   ├── tools/           # MCP tools
│   │   │   ├── client.ts        # Camera SPARQL client
│   │   │   └── index.ts
│   │   └── senato/              # Senato della Repubblica
│   │       ├── ontology/        # OSR types & prefixes
│   │       ├── queries/         # SPARQL query builders
│   │       ├── tools/           # MCP tools
│   │       ├── client.ts        # Senato SPARQL client
│   │       └── index.ts
│   ├── config/                  # Configuration
│   └── index.ts                 # Main MCP server
├── docs/                        # Documentation
│   ├── camera/                  # Camera documentation
│   │   ├── README.md            # Full Camera workflow guide
│   │   ├── ontology-diagram.md  # TypeScript type diagram
│   │   └── *.md                 # Ontology & query docs
│   └── senato/                  # Senato documentation
│       ├── README.md            # Full Senato workflow guide
│       ├── ontology-diagram.md  # TypeScript type diagram
│       ├── 03-differenze-camera-senato.md  # Camera ↔ Senato ontology diff
│       └── *.md                 # Ontology & query docs
├── README.md                    # This file
├── INSTALLATION.md              # Setup guide
└── CHANGELOG.md                 # Version history

Ontologies & Endpoints

Camera dei Deputati

  • SPARQL Endpoint: https://dati.camera.it/sparql
  • Ontology: OCD (Ontologia Camera dei Deputati)
  • Documentation: https://dati.camera.it/ocd-rappresentazione-semantica-e-documentazione
  • Key Features:
    • Uses foaf:surname (not lastName)
    • Legislature as full URI
    • Date format: YYYYMMDD

Full Camera Documentation →

Senato della Repubblica

  • SPARQL Endpoint: https://dati.senato.it/sparql
  • Ontology: OSR (Ontologia Senato Repubblica)
  • Documentation: https://dati.senato.it/DatiSenato/browse/21
  • Key Features:
    • Uses foaf:lastName (not surname)
    • Legislature as integer
    • Shares OCD parliamentary group classes

Full Senato Documentation →

Documentation

Key Documentation Sections

Each institution guide includes:

  • 📚 Ontology overview and TypeScript type diagram
  • 🚀 Quick start with example queries
  • 🔍 Real-world examples (Meloni, Salvini case studies)
  • 🛠️ SPARQL patterns and best practices
  • ⚠️ Institution-specific features and gotchas
  • 🧪 Testing guide
  • 🐛 Troubleshooting

Architecture

RepublicMCP uses a modular architecture:

  1. Core Layer (src/core/)

    • Shared SPARQL client and query builder
    • MCP tool registry system
    • Common TypeScript types
  2. Institution Layer (src/institutions/)

    • Camera module with 20 tools
    • Senato module with 26 tools
    • Each with dedicated ontology types, query builders, and tools
  3. Configuration (src/config/)

    • Centralized endpoint management
    • Query limits and pagination
    • Current legislature tracking

This design enables:

  • Easy addition of new institutions
  • Consistent query patterns
  • Reusable SPARQL components
  • Type-safe data handling

Integration Context

RepublicMCP is developed as part of Open Parlament, an agent that answers questions about the Italian state by joining the law (Constitution, codes, EU legislation, verbatim citations) with public data (budgets, procurement, statistics) — RepublicMCP is the connector that supplies the parliamentary side of that data (acts, votes, deputies, senators, groups) to the agent.

It also works entirely standalone as a general-purpose MCP server for Camera/Senato data, independent of Open Parlament:

  • republicMCP (this module): MCP server for parliamentary data access
  • backend (separate, part of Open Parlament): Authentication, memory, model management
  • frontend (separate, part of Open Parlament): User interface

Technology Stack

  • TypeScript - Type-safe implementation
  • Model Context Protocol - AI integration standard
  • SPARQL - Semantic web query language
  • Node.js - Runtime environment

Related projects

Part of a growing ecosystem of Italian open-data MCP servers (see the italia-mcp-servers catalog). A few worth knowing about if you're working in this space:

  • Italian Parliament MCP — another MCP over the same Camera/Senato SPARQL endpoints, with a different tool surface (career/Wikidata cross-referencing, historical data back to 1848).
  • DoveVannoINostriSoldi — public spending/budget data (SIOPE, ANAC, OpenBDAP), including Camera's own administrative budget — complements RepublicMCP's institutional data.
  • mcp-legal-it / BetterCallClaude Italia — Normattiva, EU law, and case-law citation tools for the legislative side.

Contributing

Contributions are welcome! Areas for contribution:

  • Additional MCP tools for specific use cases
  • Query optimization
  • Enhanced type definitions
  • Documentation improvements
  • Bug fixes and testing

License

Apache-2.0

Resources

Official Data Sources

Standards & Specifications


Maintained by: Giulio Garofalo — part of Open Parlament Version: 0.3.0 (see CHANGELOG.md)