Skip to main content

MCP server for Uruguay's open government data (national catalog, BCU, INE, Montevideo, gub.uy)

Project description

Bandera de Uruguay

๐Ÿ‡บ๐Ÿ‡พ 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

PyPI Python MCP Tests Coverage License

๐ŸŒŽ 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, 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 + 31 data tools across 6 modules, plus 17 prompts and 11 resources.

๐Ÿ“š Data sources (modules)

Module Source Protocol Tools
๐Ÿ›๏ธ catalogodatos catalogodatos.gub.uy โ€” national CKAN catalog (~2680 datasets, 72 orgs) CKAN REST 5
๐Ÿ’ต bcu Banco Central del Uruguay โ€” exchange rates SOAP (zeep) 4
๐Ÿ“Š ine Instituto Nacional de Estadรญstica โ€” ANDA / microdata REST 3
๐ŸŒ 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

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.

  • 17 prompts โ€” e.g. bcu_cotizacion_dolar_hoy, catalogo_buscar_por_tema, ine_buscar_estudios, montevideo_proximo_bus, datastore_unir_dos_fuentes.
  • 11 resources โ€” e.g. uru://bcu/codigos-moneda, uru://catalogodatos/guia-de-uso, uru://montevideo/credenciales-transporte.

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/

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                  # 69 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

MIT

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

uruguay_mcp-0.1.1.tar.gz (173.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uruguay_mcp-0.1.1-py3-none-any.whl (74.1 kB view details)

Uploaded Python 3

File details

Details for the file uruguay_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: uruguay_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 173.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uruguay_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ebaa6a0fab475b2f9814069bd25c5d6e4ef266a3b110c5a2b8c71de8ff935216
MD5 509762f014e2353cee3a09b71fcfc364
BLAKE2b-256 936e69aa1c8fc4ff1a9e2379bbe3b0e45ff1acfd1e49dc3e5c52a9f5691f9808

See more details on using hashes here.

Provenance

The following attestation bundles were made for uruguay_mcp-0.1.1.tar.gz:

Publisher: publish.yml on Ellweb3/uruguay-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uruguay_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: uruguay_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 74.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uruguay_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 24e70b7a66a32df9bd8c95d9e3192ccbde1dce859b707f1a8780562647d9118c
MD5 c04cc51539758b8e1efa0d213d5f22fd
BLAKE2b-256 a2bdc1ec4d0d12962caf8e1401f7728c80569b8253efd398e6bdc137676e8bd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for uruguay_mcp-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Ellweb3/uruguay-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page