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 (10 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.txtPara Ubuntu/Debian:
sudo apt-get install poppler-utils(requerido por pdf2image)
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 (10 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).
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 |
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.
Latest Blog Posts
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