OpenLegis
query the law · real sources · living graph
OpenLegisProjects & libraries
open source · npm · PyPI · GitHub

Projects & libraries

OpenLegis is reuse-first and open source. Here are my projects and published libraries — Apache-2.0 code, data from official and citable sources. Everything is installable and inspectable.

Where it began

It all started with RepublicMCP: an MCP server that exposes the Italian Chamber and Senate as agentic tools over SPARQL. Mapping the OCD (Chamber) and OSR (Senate) ontologies and their relations is what sparked the bigger idea — uniting law and public data into a single queryable graph. OpenLegis is the natural evolution.

The two ontologies look similar and diverge in subtle, dangerous ways: the Chamber uses foaf:surname, the Senate foaf:lastName; the Chamber expresses the legislature as a full URI, the Senate as a plain integer; mandate start/end properties have different names (ocd:startDate/endDate vs osr:inizio/fine). I mapped and documented them one by one, with example queries — the kind of detail you usually only discover after a failed query.

The full Chamber ↔ Senate mapping, with example queries ↗

My projects

ProjectTypeWhat
OpenLegis ↗openlegis.itThe project: a function-calling agent, connectors, knowledge graph and webapp. The layer that makes queryable the sources that, on their own, are not. The monorepo is private — the reusable code lives in the public projects below. active
RepublicMCP ↗GitHub · TypeScriptThe origin. An MCP server exposing the Chamber and Senate (acts, legislative process, votes, signatories) over SPARQL, with the OCD/OSR ontologies documented and diagrammed. origin
republic-mcp ↗npm · TypeScriptThe published RepublicMCP package: «npx -y republic-mcp». Chamber & Senate + Openpolis data (MPs, power index, votes, decrees, organs). published
open-parlamento-mcp ↗GitHub · PythonThe MCP server for law and data: Constitution and codes, Normattiva amendments, legislative process, EU/Constitutional/Cassation/administrative case law, statistics, Official Gazette, CKAN data, OpenPolis, PNRR (incl. contract awards) — 25 tools. On PyPI: «pip install open-parlamento-mcp». published

Open data

DatasetFormatWhat
Relations graph ↗JSONAmendment/repeal/replacement relations between statutes and articles, from Normattiva (Akoma Ntoso), with provenance and confidence. open
Legal corpus ↗HTML · ELIPer-article consolidated text of decrees and laws, with ELI identifiers and static, indexable pages. open

What it stands on

Nothing from scratch where a standard exists:

How to install

Both MCP servers work from Claude Desktop, Cursor and other compatible clients. The full guide is on the MCP server page.

republic-mcp · npm ↗ · open-parlamento-mcp · PyPI ↗ · RepublicMCP · GitHub ↗ · open-parlamento-mcp · GitHub ↗

FAQ

Which project did OpenLegis grow out of?

RepublicMCP: the MCP server that exposes the Chamber and Senate over SPARQL. Mapping the OCD and OSR ontologies sparked the idea of uniting law and data into a single queryable graph.

Are the projects open source?

Yes. The code is published under the Apache-2.0 license on GitHub; packages are on npm (republic-mcp) and PyPI (open-parlamento-mcp). Data comes from public, citable sources.

Can I use the libraries without the webapp?

Yes. The MCP servers are standalone: «npx -y republic-mcp» or «pip install open-parlamento-mcp», then configure them in your MCP client. They work independently of the website.

See also

MCP server · Open data · PNRR contracts · MPs · How it works · Versione italiana

Informational tool — not legal advice. Apache-2.0 code, public and citable sources (ELI/CELEX).