使用说明
mcp_bcrp
BCRP data tools for Python/MCP and native Stata workflows.
Overview
This repository provides two independent interfaces to the public statistical source of the Banco Central de Reserva del Perú (BCRP):
mcp-bcrp— Python client, metadata search and optional FastMCP server;usebcrp— native Stata package for data retrieval, search and transformations.
Both interfaces query the same BCRP source, but they have separate runtimes, tests, documentation and release processes. Installing one does not install the other.
Python implementation
The Python package provides asynchronous data access and catalog search. The FastMCP server is an optional interface for MCP-compatible AI applications.
Install or update from PyPI:
pip install --upgrade mcp-bcrp
Help: Python guide · examples and notebooks
Replication: Python test suite
From a checkout, run the tests from the repository root:
python -m pytest python/tests -q
Stata implementation
The native Stata package preserves the usebcrp command syntax and adds
catalog search, caching, transformations and metadata output.
Install or update from GitHub:
net install usebcrp, ///
from("https://raw.githubusercontent.com/MaykolMedrano/mcp_bcrp/main/stata") replace
Requirements: Stata 16 or later and HTTPS access. The package uses the public BCRP API and does not require Python, FastMCP or an LLM provider.
Help: user guide · Stata help file · distribution guide
Replication: Stata test suite
From a checkout, run the deterministic suite with the configured StataNow executable:
powershell -ExecutionPolicy Bypass -File stata/scripts/run-tests.ps1
Repository structure
mcp_bcrp/
├── python/
│ ├── mcp_bcrp/ Python client, search and MCP server
│ ├── tests/ Python tests
│ ├── examples/ Python examples and notebooks
│ └── README.md Python documentation
├── stata/
│ ├── *.ado, *.sthlp Native Stata runtime
│ ├── tests/ Stata tests and fixtures
│ ├── docs/ Stata documentation
│ ├── scripts/ Test and release scripts
│ ├── catalog/ Catalog provenance and build scripts
│ └── README.md Stata documentation
├── docs/ Shared architecture documentation
├── pyproject.toml Python/PyPI build configuration
└── README.md Project overview
The stata/ directory is also the exact net install site: stata.toc and
usebcrp.pkg remain directly inside it.
Data source and references
- Banco Central de Reserva del Perú
- BCRPData statistical series
- FastMCP, used by the optional Python MCP layer
- Catalog provenance and reproduction
- Repository architecture
Author
Maykol Medrano
Pontificia Universidad Católica de Chile
Email: mmedrano2@uc.cl
GitHub: MaykolMedrano
License and disclaimer
This project is released under the MIT License. It is an independent open-source project and is not an official product of the Banco Central de Reserva del Perú. Data availability and accuracy depend on the upstream BCRP service.
