🔌 Model Context Protocol · Anthropic Standard

Connect your LLM to
Peru's budget.

A public MCP server that exposes 32 million records from the MEF (Peru's Ministry of Economy and Finance) (2013-2026) as callable tools from Claude Desktop, Cursor, Windsurf and any compatible client. No auth, no API keys, no costs.

MCP server URL: https://app.gestionpublicaperu.com.pe/mcp

1 · Configure your client

Copy this block into your MCP client's configuration file and restart the app:

{
  "mcpServers": {
    "gestion-publica-peru": {
      "url": "https://app.gestionpublicaperu.com.pe/mcp"
    }
  }
}
🤖

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows). Restart the app.

Download →
⌨️

Cursor

Settings → MCP → Add Server → paste the URL. Native Streamable HTTP support.

Download →
🌊

Windsurf

Cascade → MCP Servers → Add. Same JSON as Claude Desktop.

Download →
🛠️

Cline / Roo

VS Code extension settings → MCP Servers. Use the URL directly.

Download →

2 · The 6 tools your LLM will see

Your MCP client discovers these tools automatically on connection. The LLM decides when to call each one based on the user's question.

consultar_presupuesto_mef #1

Executes a SELECT-only DuckDB query over the mef_historico table.

Input: { sql: string }
Typical question: "How much did the Education sector grow between 2013 and 2025?"
listar_dimensiones #2

Lists valid values for Level/Source/Function/Department/Sector to build correct queries.

Input: — (no parameters)
Typical question: "What government levels are in the data?"
get_serie_anual #3

Returns the annual series PIM/Accrued/Execution% with simple filters — no SQL required.

Input: { sector?, pliego?, departamento?, nivel?, fuente?, funcion? }
Typical question: "MTC series over the last decade, closed years only"
get_schema #4

Metadata: 137 columns + types, year range, total rows, and sample queries.

Input: — (no parameters)
Typical question: "What columns does the budget table have?"
get_top_sectores #5

Top N sectors by PIM for the given year (default: latest closed year).

Input: { anio?: int, limit?: int=10 }
Typical question: "Which were the 5 sectors with the largest budget in 2024?"
get_top_pliegos_por_depto #6

Top N spending units (pliegos) by PIM in the selected department.

Input: { departamento: "08", limit?: int=10 }
Typical question: "Show me the largest spending units in Cusco"

3 · How it looks in use

Mockup of a Claude Desktop conversation with the MCP server connected. The LLM calls the tools automatically — the user just asks in plain English.

👤

How much did Peru's Health budget grow over the last decade?

🤖
🔧 get_serie_anual
  sector: "11"
⚡ Response in 220ms — 13 rows

The Health sector grew from S/ 5.5 billion in 2013 to S/ 14.5 billion in 2025 → +165% over 12 years. Execution rate stayed consistently above 89% year after year.

Want me to compare it with Education?

👤

Yes, and add Defense too

🤖
🔧 consultar_presupuesto_mef
  sql: SELECT anio, SECTOR, SUM(MTO_PIM)/1e9 AS pim
  FROM mef_historico WHERE SECTOR LIKE '11%' OR
  SECTOR LIKE '22%' OR SECTOR LIKE '26%'
  GROUP BY anio, SECTOR

Comparison 2013 → 2025:

  • Health: S/ 5.5 → 14.5 billion (+165%)
  • Education: S/ 18.8 → 41.1 billion (+118%)
  • Defense: S/ 6.0 → 11.5 billion (+92%)

Health leads the relative growth of the last decade...

Frequently asked questions

What is MCP?

Model Context Protocol is an open standard by Anthropic that lets LLMs (Claude, GPT-4, Gemini, etc.) connect to external tools. Instead of writing a custom integration for each client, an MCP server exposes its tools once and any compatible client discovers them automatically.

Do I need an API key?

No. The server is public, with no auth and no visible rate limit. Only safety caps: 10,000 rows per query and a 30-second timeout.

Is the data up to date?

Yes. The closed historical data (2013-2025) comes from MEF's consolidated annual files. The current year is automatically refreshed at 10:45 AM every day from MEF's open data portal (you can detect it via the es_parcial: true flag).

What if I want to query without an LLM?

Use the REST API documented at /en/api. Same DuckDB engine, same underlying tools, but over HTTP POST and JSON. Includes snippets in curl, Python, JavaScript and Excel Power Query.

Can I trust the data?

The source is datosabiertos.mef.gob.pe (MEF's official publication). The parquet files are generated with Polars without destructive transformations. The ETL pipeline code is transparent — ask for repo access if you want to review it.

Building something with this?

We'd love to see it. Reach out at soporte@gestionpublicaperu.com.pe .

🌐 Related products: Dashboard · REST API · MCP server · Status