MEF Subnational Efficiency MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MEF Subnational Efficiency MCPshow me the top 5 regions with lowest avance_pct in 2025"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MEF Subnational Efficiency MCP 🇵🇪
Sistema de Auditoría de Gasto Público Subnacional — Perú 2025 + Archivo Histórico 1964
Pipeline multi-agente local construido con Claude Code CLI, MCP y PaddleOCR para auditar la ejecución presupuestal de gobiernos regionales y locales del Perú.
Arquitectura General
Claude Code CLI
│
├── executor_skill.json → Orquesta extracción, transformación y composición del dashboard
└── evaluator_skill.json → Audita, optimiza y pule el output del Executor
│
▼
src/mcp_server.py → Servidor MCP local (7 herramientas CKAN + OCR)
│
┌───────┴────────┐
│ │
src/data_pipeline.py src/ocr_engine.py
(Track 2025) (Track 1964 — PaddleOCR)
│ │
└───────┬────────┘
▼
data/processed/ → Parquets micro-footprint + KPIs JSON
│
▼
app.py → Dashboard Streamlit 4 tabsRelated MCP server: mcp-brasil
Quick Start
1. Instalación
git clone <repo-url>
cd mef_subnational_efficiency_mcp
pip install -r requirements.txtPoppler es una dependencia de sistema (no de PyPI) que usa
pdf2imageen el track OCR:
Ubuntu/Debian:
sudo apt-get install poppler-utilsmacOS:
brew install popplerWindows: descargar los binarios de Poppler y añadirlos al
PATHEl dashboard (Tabs 1-4) corre solo con
requirements.txt. El track OCR 1964 además requierepaddleocr/paddlepaddle(ya incluidos) + Poppler; sus resultados ya vienen procesados endata/processed/, así que no es necesario re-ejecutarlo para ver el dashboard.
2. Iniciar el MCP Server
python src/mcp_server.py3. Ejecutar el pipeline vía Claude Code CLI
# Pipeline mensual
claude "run executor_skill for period 2025-12"
# Pipeline trimestral
claude "execute mef_update for 2025-Q4"
# Modo mock (desarrollo sin conexión)
python src/data_pipeline.py --period 2025-12 --mock4. Lanzar el Dashboard
streamlit run app.pyEstructura del Repositorio
mef_subnational_efficiency_mcp/
│
├── app.py # Dashboard Streamlit — 4 tabs
├── README.md # Este archivo
├── requirements.txt
│
├── .claude/
│ └── skills/
│ ├── executor_skill.json # Skill de extracción y composición
│ └── evaluator_skill.json # Skill de auditoría y optimización
│
├── src/
│ ├── mcp_server.py # Servidor MCP local (7 herramientas)
│ ├── data_pipeline.py # Pipeline 2025: snapshot → filter → Parquet
│ ├── ocr_engine.py # PaddleOCR — mínimo 15 páginas del PDF 1964
│ ├── analytical_engine.py # Métricas fiscales y agrupaciones
│ └── utils.py # Logging, parseo de períodos, helpers
│
├── data/
│ ├── raw_pdfs/ # PDF 1964 descargado
│ ├── snapshots/ # schema.json (contrato de columnas)
│ └── processed/ # Parquets 2025 + JSONs KPI + logs de runs
│
└── video/
└── link.txt # URL del video de presentación (5 min)Reglas Anti-Context-Flooding
⚠️ CRÍTICO: Los datasets del portal MEF pueden superar 200MB–1GB. Está estrictamente prohibido cargarlos completos en el contexto del LLM.
Protocolo obligatorio:
inspeccionar_esquema_csv→ captura solo primeras 10 filas para mapear columnasdata_pipeline.pycorre externamente en chunks de 50k filas con pandasSolo el Parquet resultante (< 5MB) es leído por
app.py
Métricas Fiscales (Track 2025)
Métrica | Fórmula |
Avance % |
|
Saldo No Devengado |
|
Clasificación | ≥70% ✅ Aceptable · 40-70% ⚠️ Riesgo · <40% 🔴 Crítico |
Filtros aplicados:
Nivel gobierno: Regional o Local
PIM mínimo: S/ 10,000,000
Track Histórico 1964
El pipeline procesa mínimo 15 páginas del PDF "Ministerio de Hacienda y Comercio — Presupuesto, Balance y Cuenta General de la República 1964" usando PaddleOCR.
Los resultados se presentan de forma completamente independiente en el Tab 1 del dashboard, sin comparaciones directas con cifras 2025 (los marcos contables son incompatibles).
Dashboard (4 tabs)
Tab | Contenido | Datos |
1 · Resumen Ejecutivo | KPIs 2025 ( | 2025 + 1964 (separados) |
2 · Distribución Territorial | Coropleta de avance de ejecución + heatmap de riesgo social (estancamiento del gasto social × pobreza) + cuadrante de auditoría | Solo 2025 |
3 · Hall of Shame | Tabla interactiva de peores unidades (PIM > S/ 10M) + desglose por función | Solo 2025 |
4 · Audit Log & Playground | Reporte del Evaluator Skill + cronología de corridas + playground period-driven | Solo 2025 |
Mapas (Tab 2): se construyen con plotly.express.choropleth a nivel departamental sobre
data/geo/peru_departamentos.geojson (no se requiere geopandas/folium). El join SIAF↔GeoJSON usa
normalización NFKD (tildes → ASCII), cobertura 24/24.
Índice de riesgo social = minmax(% no ejecutado en funciones sociales 2025) × minmax(pobreza 2025):
Estancamiento social: derivado 100% del SIAF 2025 (funciones salud, educación, saneamiento, protección social, vivienda).
Vulnerabilidad: pobreza monetaria 2025 por departamento — INEI, "Perú: Evolución de la Pobreza Monetaria 2016-2025" (publicado 05-may-2026;
data/geo/pobreza_monetaria_2025.csv, valores puntuales por departamento del Gráfico 4.7; LIMA = Lima Metropolitana). Nota: dentro de un mismo grupo robusto del INEI las diferencias entre departamentos no son significativas.
Todas las pestañas 2-4 usan exclusivamente datos modernos (2025); la era 1964 vive solo en el Tab 1. El render de cada pestaña usa
@st.cache_datapara tiempos sub-segundo.
Contrato de Esquema (Para integración P1 ↔ P3)
{
"columns": ["region", "entidad", "nivel_gobierno", "funcion",
"PIM", "devengado", "avance_pct", "saldo_no_devengado"],
"types": {
"region": "str", "entidad": "str",
"nivel_gobierno": "str", "funcion": "str",
"PIM": "float64", "devengado": "float64",
"avance_pct": "float64", "saldo_no_devengado": "float64"
}
}Ver data/snapshots/schema.json para el contrato completo con rutas de archivos.
GitHub Workflow
# Ramas de desarrollo (NUNCA commitear directo a main)
git checkout -b feature/mcp-server-core
git checkout -b feature/data-snapshot-pipeline
git checkout -b feature/historical-1964-paddle-ocr
git checkout -b feature/executor-dashboard-draft
git checkout -b feature/evaluator-qa-refinementMerge exclusivamente vía Pull Requests con descripción del cambio.
Team
Persona | Responsabilidad |
Mayra (P1) | MCP Server + Pipeline 2025 + Skills JSON |
Camila (P2) | OCR Engine 1964 + Tab 1 del Dashboard |
Manuel (P3) | Tabs 2-4 + Evaluator + Video |
Video de Presentación
Ver video/link.txt — máximo 5 minutos, 3-4 slides + demo live del dashboard.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server that connects AI agents to over 200 tools across 27 Brazilian public APIs, covering economic, legislative, transparency, and judicial data. It enables users to query and cross-reference extensive government datasets from sources like IBGE, the Central Bank, and the Brazilian Congress.Last updated1,697MIT
- Alicense-qualityBmaintenanceMCP Server for accessing 36 Brazilian public data sources and 1 agent, enabling AI agents to query government data on economy, legislation, transparency, judiciary, elections, environment, health, and more.Last updatedMIT
- Flicense-qualityBmaintenanceAuditoría del gasto público peruano mediante sistemas multi-agente, Claude Code Skills y un servidor MCP local. Procesa datos fiscales del MEF 2025 desde datosabiertos.gob.pe y digitaliza vía OCR un archivo histórico de 1964, exponiendo los resultados en un dashboard Streamlit de 4 pestañas.Last updated
- Alicense-qualityDmaintenanceMCP server that connects AI agents to 28 Brazilian public APIs, providing tools to query government data on economy, legislation, transparency, judiciary, elections, environment, health, and more.Last updatedMIT
Related MCP Connectors
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Hosted MCP with 91 agent tools: X, domains, SEO, Maps, Trends, Search, YouTube, TikTok, and more.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MayraOA/mef_subnational_efficiency_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server