MCP server for Italian open data (municipalities, provinces, regions, postal codes, coordinates, geographic data)
Project description
italy-opendata-mcp
MCP server exposing Italian open data (municipalities, provinces, regions, postal codes, coordinates, geographic data) through simple, developer-friendly tools.
Features
- 7 MCP tools to navigate the Italian administrative hierarchy
- Official sources: ISTAT and ANPR where available
- Lazy download: data is fetched on first use and cached locally (~1.8 MB SQLite)
- Offline after first use: all queries are local
- No Docker: installable via
uvxorpip, starts and stops with Claude
Data sources
| Data | Source | Type |
|---|---|---|
| Municipalities, provinces, regions, ISTAT codes | ISTAT | Official |
| Resident population | ANPR | Official (daily updates) |
| Surface area, altitude, altimetric zone | ISTAT | Official |
| Postal codes (CAP) | comuni-json | Community (no official source available) |
| Centroid coordinates | opendatasicilia | Community (no official source available) |
Installation
uvx italy-opendata-mcp
Usage in .mcp.json
{
"mcpServers": {
"italy-opendata": {
"command": "uvx",
"args": ["italy-opendata-mcp"]
}
}
}
From source
git clone https://github.com/stucchi/italy-opendata-mcp.git
cd italy-opendata-mcp
uv venv && uv pip install -e .
Tools
Hierarchical navigation
list_regioni() → list_province(regione="Lombardia") → list_comuni(provincia="MI")
| Tool | Parameters | Description |
|---|---|---|
list_regioni |
— | All 20 regions with municipality count and population |
list_province |
regione? |
Provinces with optional region filter |
list_comuni |
regione?, provincia?, limit? |
Municipalities with optional filters (default 400 results) |
Search
| Tool | Parameters | Description |
|---|---|---|
get_comune |
nome_o_codice |
Full details of a municipality by name or ISTAT code |
get_by_cap |
cap |
Find municipalities associated with a postal code |
Data management
| Tool | Parameters | Description |
|---|---|---|
refresh_dataset |
force? |
Re-download data from sources |
datasets_status |
— | Local cache status |
Available fields per municipality
Each municipality includes:
- Registry: name, ISTAT code, cadastral code, province abbreviation, province, region
- Demographics: population (ANPR, daily updates)
- Geography: latitude, longitude, surface area (km²), altitude (m), altimetric zone
- Classification: coastal, island, urbanization degree
- Postal: list of associated CAP codes
Example output
> get_comune("Roma")
{
"codice_istat": "058091",
"nome": "Roma",
"codice_catastale": "H501",
"popolazione": 2802399,
"superficie_kmq": 1288.19,
"altitudine": 20,
"zona_altimetrica": "Pianura",
"litoraneo": 1,
"latitudine": 41.89332,
"longitudine": 12.482932,
"sigla_provincia": "RM",
"provincia": "Roma",
"regione": "Lazio",
"cap": ["00118", "00119", "00120", ...]
}
Cache
Data is saved locally on first use:
| OS | Path |
|---|---|
| macOS / Linux | ~/.cache/italy-opendata-mcp/italia.db |
| Windows | %LOCALAPPDATA%\italy-opendata-mcp\italia.db |
To refresh data, use refresh_dataset(force=True).
Data coverage
| Count | |
|---|---|
| Regions | 20 |
| Provinces | 107 |
| Municipalities | 7,896 |
| With population | 7,896 |
| With coordinates | 7,889 |
| With geographic data | 7,519 |
| With postal codes | 7,887 |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file italy_opendata_mcp-1.0.1.tar.gz.
File metadata
- Download URL: italy_opendata_mcp-1.0.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a85b08ce4a7473ee9003ecd0bd9159a076b5c83fb1b56479f15ddc9d812b8266
|
|
| MD5 |
f61bbd3e1f1844af02bb1c9a2d9e1f20
|
|
| BLAKE2b-256 |
49f597f2015e93d7ac1529f799c7b425742124e3ce40a2ad632cf233d0530f48
|
File details
Details for the file italy_opendata_mcp-1.0.1-py3-none-any.whl.
File metadata
- Download URL: italy_opendata_mcp-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ba3a39dec47e106ebb4696e36ed5e3d225d5e47b31ff75d8ce712aa11eac854
|
|
| MD5 |
0405ca1207247df6344a4b202b325f0c
|
|
| BLAKE2b-256 |
502772add6e81cf487b6e9e769a30ff8c23544523059e44f54a49fedc111ffbd
|