mcp-bcrp
This server provides an interface to the Banco Central de Reserva del Perú (BCRP) Statistical API, granting access to over 5,000 economic indicators. It leverages a local cache for fast offline searches and uses Spanish language processing with a deterministic fuzzy-matching engine for query canonicalization and ambiguity detection. Key capabilities:
search_series: Search for indicators by keyword (e.g., "tipo de cambio", "PBI"), returning the best match with a confidence score or an ambiguity error if multiple matches are equally scored.
get_data: Fetch raw time series data for one or more series codes, with optional date range filtering in
YYYY-MM/YYYY-MMformat.get_table: Retrieve formatted tables with custom column names.
plot_chart: Generate professional PNG charts with customizable titles, series names, date ranges, and output paths. Additional features include automatic frequency detection for indicators.
Click on "Deploy 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., "@mcp-bcrp show me a chart of Peru's inflation rate for the last year"
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.
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.
Related MCP server: BCRP MCP Server
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-bcrpHelp: Python guide · examples and notebooks
Replication: Python test suite
From a checkout, run the tests from the repository root:
python -m pytest python/tests -qStata 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") replaceRequirements: 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.ps1Repository 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 overviewThe stata/ directory is also the exact net install site: stata.toc and
usebcrp.pkg remain directly inside it.
Data source and references
FastMCP, used by the optional Python MCP layer
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.
Available Tools
4 toolsget_dataA
Fetch time series data for specific BCRP series codes.
Args: series_codes: List of BCRP series codes (e.g., ["PN01652XM", "PD04638PD"]) period: Date range in format 'YYYY-MM/YYYY-MM' or single 'YYYY-MM'. If None, returns all available data.
Returns: JSON string with array of records containing 'time' and values.
Inputs: series_codes (required), period. Returns: result
get_tableB
Get a formatted table with custom column names.
Args: series_codes: List of BCRP series codes to retrieve names: Optional custom names for columns (must match series_codes length) period: Date range in format 'YYYY-MM/YYYY-MM' or 'YYYY'
Returns: JSON string with formatted table data.
Inputs: series_codes (required), names, period. Returns: result
plot_chartA
Generate a professional chart for BCRP series data. Returns the path to the saved PNG file.
Args: series_codes: List of BCRP series codes to plot period: Date range in format 'YYYY-MM/YYYY-MM' (optional) title: Custom chart title (optional, uses series name if not provided) names: Custom names for each series in legend (optional) output_path: Custom output path for the chart (optional)
Inputs: series_codes (required), period, title, names, +1 more. Returns: result
search_seriesA
Search for BCRP economic indicators by keyword.
Uses deterministic search with fuzzy matching. Returns the best match or an ambiguity error if multiple matches are equally scored.
Args: query: Search term (e.g., "tipo de cambio", "inflacion", "PBI")
Returns: JSON string with match result containing codigo_serie and confidence, or error details if ambiguous or not found.
Inputs: query (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: get_data retrieves raw time series data, get_table provides formatted tabular data, plot_chart generates visual charts, and search_series helps find series codes. There is no functional overlap between these tools, making selection straightforward for an agent.
All tool names follow a consistent verb_noun pattern with snake_case: get_data, get_table, plot_chart, and search_series. The naming convention is predictable and readable throughout the toolset.
With 4 tools, this server is well-scoped for working with BCRP economic data. Each tool serves a distinct purpose in the data workflow (search, retrieve raw data, format tables, visualize), and none feel extraneous or missing for the domain.
The toolset covers the essential workflow for BCRP data analysis: searching for series, retrieving data in different formats, and visualizing results. A minor gap exists in lacking update/delete operations, but these are likely unnecessary for read-only economic data access, and agents can work effectively with the provided tools.
Maintenance
Related MCP Connectors
Banco Central de Reserva del Perú (BCRP) statistics series API MCP. Keyless.
Sourced data about Peru: company registry (RUC), imports/exports, exchange rate, macro.
Macro indicators from World Bank, FRED, IMF, and OECD via unified query surface.
Banco Central do Brasil (BCB): SGS series, Focus expectations, PTAX, stats + provenance. 17 tools.
Related MCP Servers
- FlicenseAqualityDmaintenanceModel Context Protocol server that provides access to economic and financial time series data from Peru's Central Reserve Bank, enabling AI agents to search, explore, and analyze Peru's economic indicators through a standardized interface.34-
- AlicenseAqualityBmaintenanceEnables AI agents to access economic statistics from the Central Reserve Bank of Peru, including exchange rates, interest rates, and GDP, without requiring an API key.7MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that provides real-time access to Peruvian economic indicators from the BCRP API, with persistent memory, knowledge graph, document RAG, and statistical analysis tools.-
- AlicenseAqualityFmaintenanceEnables AI agents to discover, retrieve, compare, and analyze trusted macroeconomic statistics from central banks and international organizations, resolving concepts to official series with provenance and validation.6MIT