MCP server for Uruguay's open government data (national catalog, BCU, INE, Montevideo, gub.uy)
Project description
๐บ๐พ uruguay-mcp
Structured AI-agent access to Uruguay's open government data
Acceso estructurado de agentes de IA a los datos abiertos del Estado uruguayo
๐ Espaรฑol ยท English
An MCP server that gives AI agents structured access to Uruguay's open government data โ the national data catalog, the Central Bank, the statistics institute, Montevideo's city data & realtime transport, spatial data (IDE), education, health, social programs, government social-security statistics (BPS), tax reference values (DGI), news, and the gub.uy service catalog โ behind a single meta-discovery layer.
โจ Why a meta-discovery layer?
Instead of flooding the model with hundreds of tool definitions, the server exposes five meta-tools. The model searches for what it needs, then invokes the matching data tool by name. The prompt-visible surface stays constant no matter how many data sources are added.
| Meta-tool | Purpose |
|---|---|
discover_tools(query, module?, limit?) |
Rank data tools relevant to a natural-language need (returns their argument schemas) |
call_tool(name, arguments) |
Invoke a data tool by name (validates arguments) |
list_modules() |
List data-source modules and their tool counts |
plan_query(goal) |
Surface candidate tools for a multi-step goal |
execute_batch(calls) |
Run several calls concurrently with per-call error isolation |
Every tool returns a unified envelope: { "_meta": { source, cached, lang, timestamp }, "data": ... }.
At a glance: 5 meta-tools + 84 data tools across 17 modules, plus 54 prompts and 36 resources.
๐ Data sources (modules)
| Module | Source | Protocol | Tools | |
|---|---|---|---|---|
| ๐๏ธ | catalogodatos |
catalogodatos.gub.uy โ national CKAN catalog (~2680 datasets, 72 orgs) + DataStore SQL | CKAN REST | 9 |
| ๐ต | bcu |
Banco Central del Uruguay โ exchange rates | SOAP (zeep) |
4 |
| ๐ | ine |
Instituto Nacional de Estadรญstica โ ANDA studies + national CKAN DataStore queries | REST | 7 |
| ๐ | gubuy |
gub.uy public API / service catalog | CKAN REST | 4 |
| ๐ | montevideo |
Intendencia de Montevideo โ city CKAN + realtime transport | CKAN + REST | 11 |
| ๐๏ธ | datastore |
Cross-source SQLite workspace โ load CSV/CKAN data, run read-only SQL JOINs | local SQLite | 4 |
| ๐ | acce |
Agencia de Compras y Contrataciones del Estado โ public procurement (OCDS) | OCDS REST/RSS + CKAN | 4 |
| โ๏ธ | impo |
IMPO โ legislation, normativa & Diario Oficial | REST (JSON) | 6 |
| ๐งพ | dgi |
DGI (tax authority) โ reference values (UI, IPC, ITP & late-payment rates) as .ods + statistical bulletins |
scrape + ODS/PDF | 4 |
| ๐ฆ๏ธ | inumet |
Instituto Uruguayo de Meteorologรญa โ stations, forecast & alerts | REST + HTML | 3 |
| ๐๏ธ | parlamento |
Parlamento del Uruguay โ datasets, attendance & activity (CKAN-backed) | CKAN REST | 4 |
| ๐บ๏ธ | ide |
IDE Uruguay (AGESIC) โ spatial data: WFS layers, cadastral parcels & geocoding | WFS 2.0 + REST | 5 |
| ๐ | educacion |
ANEP / education โ datasets & school directories (national CKAN, org=anep) | CKAN REST | 3 |
| ๐ฅ | salud |
Salud (MSP / FNR) โ health datasets, clinics & medication spending | CKAN REST | 5 |
| ๐ค | mides |
MIDES โ social programs & the Guรญa de Recursos service directory | CKAN + HTML | 4 |
| ๐ง | bps |
Banco de Previsiรณn Social โ "BPS en Cifras" observatory: pensions, benefits & contributors (live indicators) | REST (JSON) | 5 |
| ๐ฐ | noticias |
gub.uy government news โ latest releases & full-text search | HTML scrape | 2 |
The transport surface of montevideo needs OAuth2 credentials
(URUGUAY_MCP_MVD_CLIENT_ID / URUGUAY_MCP_MVD_CLIENT_SECRET); without them the
transport tools return a typed validation_error while the CKAN tools work
unauthenticated.
๐งฉ Prompts & Resources
Each module also registers reusable prompts (parameterized Spanish
instruction templates) and resources (static reference docs under the
uru://<module>/<path> URI scheme), exposed natively through FastMCP.
- 54 prompts โ e.g.
bcu_cotizacion_dolar_hoy,catalogo_buscar_por_tema,bps_pasividades_actuales,dgi_valor_referencia,ine_buscar_estudios,montevideo_proximo_bus,datastore_unir_dos_fuentes,acce_analizar_compra,impo_consultar_norma,inumet_clima_actual,ide_consultar_catastro,salud_consultar_medicamentos,noticias_ultimas. - 36 resources โ e.g.
uru://bcu/codigos-moneda,uru://bps/catalogo-indicadores,uru://dgi/catalogo-valores,uru://catalogodatos/guia-de-uso,uru://montevideo/credenciales-transporte,uru://acce/glosario-ocds,uru://impo/esquema,uru://inumet/variables,uru://ide/capas-destacadas,uru://salud/fuentes,uru://mides/guia-recursos.
See EXAMPLES.md for end-to-end usage scenarios, including
cross-source ones via plan_query / execute_batch and SQL JOINs through the
datastore module.
๐ Quick start
# Run directly from PyPI (once published)
uvx uruguay-mcp
# โฆor install it
pip install uruguay-mcp # or: uv pip install uruguay-mcp
uruguay-mcp
One-command install into Claude
uruguay-mcp install
Merges the server into Claude Desktop's config (preserving existing
mcpServers and unrelated keys) and prints a ready-to-paste snippet for Claude
Code / Cursor. Restart the client afterwards.
Claude Desktop config (manual)
{
"mcpServers": {
"uruguay-mcp": { "command": "uruguay-mcp" }
}
}
Run options
uruguay-mcp # stdio (default)
uruguay-mcp --transport sse --port 8000
uruguay-mcp --modules catalogodatos,bcu # load only some modules
uruguay-mcp --verbose # INFO logs (--debug for DEBUG)
โ๏ธ Configuration
All via URUGUAY_MCP_* environment variables:
| Variable | Default | Meaning |
|---|---|---|
URUGUAY_MCP_LANG |
es |
Language for human-facing strings (es/en) |
URUGUAY_MCP_HTTP_TIMEOUT |
30 |
HTTP timeout (seconds) |
URUGUAY_MCP_CACHE_TTL |
900 |
Response cache TTL (seconds) |
URUGUAY_MCP_RATE_LIMIT_RPS |
5 |
Max requests/sec per host |
URUGUAY_MCP_MODULES |
(all) | Comma-separated module allowlist |
URUGUAY_MCP_MVD_CLIENT_ID |
(unset) | OAuth2 client id for the Montevideo transport API |
URUGUAY_MCP_MVD_CLIENT_SECRET |
(unset) | OAuth2 client secret for the Montevideo transport API |
๐๏ธ Architecture
src/uruguay_mcp/
โโโ server.py # FastMCP wiring; meta-tools + registered prompts + resources
โโโ cli.py # `uruguay-mcp` / `uruguay-mcp install`; -v/--debug logging
โโโ meta/ # discovery layer
โ โโโ tools.py # the 5 meta-tools
โ โโโ search.py # BM25-lite ranking over the registry
โโโ shared/ # reused by every module
โ โโโ config.py # env-driven settings (URUGUAY_MCP_*)
โ โโโ http.py # async client: retries (tenacity) + per-host rate limit
โ โโโ cache.py # async TTL cache
โ โโโ envelope.py # unified {_meta, data} response (+ UTC timestamp)
โ โโโ i18n.py # es/en messages
โ โโโ errors.py # typed, localized errors
โ โโโ registry.py # tool/prompt/resource registry; @tool/@prompt/@resource
โโโ modules/ # one self-contained package per data source
โโโ catalogodatos/ โโโ bcu/ โโโ ine/
โโโ gubuy/ โโโ montevideo/ โโโ datastore/
โโโ acce/ โโโ impo/ โโโ inumet/
โโโ parlamento/ โโโ ide/ โโโ educacion/
โโโ salud/ โโโ mides/ โโโ noticias/
โโโ bps/ โโโ dgi/
Each module package is independent (constants ยท schemas ยท client ยท
tools ยท optional prompts/resources). Importing the package self-registers
everything it offers.
๐ ๏ธ Development
uv venv && uv pip install -e ".[dev]"
uv run pytest # 252 unit tests (HTTP mocked, offline) ยท 86% coverage
uv run pytest -m integration # hits live government APIs
uv run ruff check src tests
uv run pyright
๐ Acknowledgements
Built on data published by AGESIC, BCU, INE and the Intendencia de Montevideo under Uruguay's open-data law (Nยบ 18.381). This project is an independent client and is not affiliated with those institutions.
๐ License
Project details
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 uruguay_mcp-0.4.2.tar.gz.
File metadata
- Download URL: uruguay_mcp-0.4.2.tar.gz
- Upload date:
- Size: 282.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1247404fb18b8aa1f83fc9898a782d38ef25757d56d238f2ae58a5698c44030d
|
|
| MD5 |
f1f03bbe86e2f78ee4b47e71e8fe5899
|
|
| BLAKE2b-256 |
dc6e1e58f969a73b26585c01cceaf1fc4466c58123647c9c0213e79c9ab4814d
|
Provenance
The following attestation bundles were made for uruguay_mcp-0.4.2.tar.gz:
Publisher:
publish.yml on Ellweb3/uruguay-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uruguay_mcp-0.4.2.tar.gz -
Subject digest:
1247404fb18b8aa1f83fc9898a782d38ef25757d56d238f2ae58a5698c44030d - Sigstore transparency entry: 1676077280
- Sigstore integration time:
-
Permalink:
Ellweb3/uruguay-mcp@2f905d38fd0c4eb852e8c6b4b9e7094ffaeaa9fb -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/Ellweb3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2f905d38fd0c4eb852e8c6b4b9e7094ffaeaa9fb -
Trigger Event:
push
-
Statement type:
File details
Details for the file uruguay_mcp-0.4.2-py3-none-any.whl.
File metadata
- Download URL: uruguay_mcp-0.4.2-py3-none-any.whl
- Upload date:
- Size: 203.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abedb0859678323feae7b19f876bcbd26d721317c1ce99744a19b00ecde4bd28
|
|
| MD5 |
9979194cfa7ac7b7e3a7300505772765
|
|
| BLAKE2b-256 |
3c960cfce038529b9f700f39dc3134171e551ceeb8fd9d1cdcd9a7a2ebf60a12
|
Provenance
The following attestation bundles were made for uruguay_mcp-0.4.2-py3-none-any.whl:
Publisher:
publish.yml on Ellweb3/uruguay-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uruguay_mcp-0.4.2-py3-none-any.whl -
Subject digest:
abedb0859678323feae7b19f876bcbd26d721317c1ce99744a19b00ecde4bd28 - Sigstore transparency entry: 1676077304
- Sigstore integration time:
-
Permalink:
Ellweb3/uruguay-mcp@2f905d38fd0c4eb852e8c6b4b9e7094ffaeaa9fb -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/Ellweb3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2f905d38fd0c4eb852e8c6b4b9e7094ffaeaa9fb -
Trigger Event:
push
-
Statement type: