MCP BCRP Server

Provides access to BCRP macroeconomic indicators via MCP for Python and AI agents.
  • python

0

GitHub Stars

python

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "maykolmedrano-mcp_bcrp": {
      "command": "python",
      "args": [
        "C:/absolute/path/to/mcp_bcrp/run.py"
      ],
      "env": {
        "BCRP_TIMEOUT": "120",
        "BCRP_CACHE_DIR": "PATH_TO_CACHE_DIRECTORY"
      }
    }
  }
}

You can access and work with Banco Central de Reserva del Peru (BCRP) macroeconomic indicators through a unified MCP server and Python library. This enables you to search, retrieve, and chart more than 5,000 indicators directly from Python or AI agents, with fast local caching, deterministic search, and automatic frequency handling.

How to use

Set up the MCP server to run locally and then connect your Python code or AI agent to it. You can use the server to search for indicators by keyword, retrieve time series data, format results in tables, and generate publication-ready charts. The workflow is: start the MCP server, perform a search to identify the desired indicator, fetch data for your requested period, and optionally render a chart for reporting.

How to install

Prerequisites: ensure you have Python 3.10 or higher installed on your system. You also need an active internet connection to access the BCRP API during first-use and for updates.

Install the package from PyPI or install from source.

Additional content

Configuration and runtime details are provided below to help you run the MCP server and integrate it with your Python environment.

Note: You will find a concrete server configuration example for running the MCP server using Python as the runtime. You can also run the server using an alternative approach if you install the package with the appropriate entry points.

If you need offline search performance, the system caches metadata locally to speed up the lookup of indicators.

Configuration

MCP server configuration enables you to launch the BCRP MCP endpoint as a standalone service that your AI agents can query.

Below is a ready-to-use example showing how to configure the MCP server to run with Python and an explicit path to the server script. You can adapt the path to your environment.

Usage details

{
  "mcpServers": {
    "bcrp-api": {
      "command": "python",
      "args": ["C:/absolute/path/to/mcp_bcrp/run.py"]
    }
  }
}

If you installed the package via pip, you can use the alternative startup argument set to launch the server: -m mcp_bcrp.

Available tools and core actions

The MCP server exposes a set of tools to interact with the BCRP data: search for indicators, retrieve data, generate formatted tables, and plot charts.

Examples of typical tasks

  • Search for an indicator by keyword to find the exact series code.
  • Retrieve a time range for one or more series codes.
  • Produce a table with selected indicator names and periods.
  • Create a chart suitable for publication with automatic Spanish date handling.

Troubleshooting

If you run into data gaps, be aware that some series may not be available for all time ranges. Metadata caching helps speed repeated searches, but if you suspect outdated information, you can refresh the cache by restarting the server or removing the local metadata file to force a refresh.

Available tools

search_series

Search BCRP indicators by keyword. Returns deterministic match or ambiguity error.

get_data

Fetch raw time series data for given series codes and period.

get_table

Get a formatted table with optional custom column names for the requested series and period.

plot_chart

Generate a publication-ready PNG chart with automatic date parsing.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational