Skip to main content
Glama
BCRP-MCP

BCRP-MCP

by rodcar

BCRP-MCP

Model Context Protocol (MCP) Server for BCRP Economic and Financial Time Series Data


👨‍💻 Author

Ivan Yang Rodriguez Carranza

Email LinkedIn GitHub


📋 Table of Contents


Related MCP server: FRED MCP Server

🎯 Overview

BCRP-MCP is a Model Context Protocol (MCP) server that provides seamless access to economic and financial time series data from the BCRP (Banco Central de Reserva del Perú) - Central Reserve Bank of Peru. This server enables AI agents and applications to search, explore, and analyze Peru's economic indicators, financial statistics, and monetary data through a standardized MCP interface.


🎬 Demo

https://github.com/user-attachments/assets/c42eb8c3-4a1c-442d-bd12-cc1fd4ff18ae

Demo (Spanish): https://youtube.com/shorts/gsjC07WR0n0


🔧 Tools

Name

Input

Description

search_time_series_groups

keywords

Search for time series groups using one or multiple keywords

search_time_series_by_group

time_series_group

Find all time series within a specific group, returns code and name pairs

get_time_series_data

time_series_codestartend

Retrieve time series data for a specific code within a date range

Note: When using the remote server, the MCP client may require increased connection timeout settings.


💬 Prompts

Name

Input

Description

search_data

keyword

Guided workflow to find relevant time series using keyword search

ask

question

Financial analysis workflow that extracts keywords, searches data, and answers questions


🚀 How to Use

Claude Desktop (Remote Server)

Note: Requires npx which comes bundled with npm. If you don't have npm installed, install Node.js which includes npm.

Add to Claude Desktop config (Claude > Settings > Developer > Edit Config):

{
  "mcpServers": {
    "bcrp_mcp_remote": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://bcrp-mcp.onrender.com/mcp"
      ]
    }
  }
}

Local Server

Note: Make sure you have uv installed. If not, install it from uv.tool.

Clone and install:

git clone https://github.com/rodcar/bcrp-mcp.git
cd bcrp-mcp
uv sync

Add to Claude Desktop config (Claude > Settings > Developer > Edit Config):

Note: Replace /path/to/bcrp-mcp with the actual path where you cloned the repository.

{
  "mcpServers": {
    "simple_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/bcrp-mcp",
        "run",
        "main.py"
      ]
    }
  }
}

MCP Inspector (Alternative)

Note: Requires npx which comes bundled with npm. If you don't have npm installed, install Node.js which includes npm.

Note: Replace /path/to/bcrp-mcp with the actual path where you cloned the repository.

Run

npx @modelcontextprotocol/inspector \
  uv \
  --directory /path/to/bcrp-mcp \                     
  run \
  main.py

Open MCP Inspector (URL displayed in the console) and configure the MCP client with the following settings:

  • Transport Type: Streamable HTTP

  • URL: http://bcrp-mcp.onrender.com/mcp

  • Request Timeout: Increase from default values

  • Maximum Total Timeout: Increase from default values

  • Proxy Session Token: Use the token generated in the console


💡 Examples

Prompt

Language

Question

Conversation

ask

Spanish

"¿Cómo ha evolucionado la tasa de interés de referencia en el último año?"

https://claude.ai/share/34df5f90-7a35-474d-b4cf-e8f48c3f9772


🏛️ Architecture Diagram

BCRP-MCP follows the Model Context Protocol specification and provides a clean abstraction layer over the BCRP API.

graph LR
    CLIENT[MCP Client<br/>Claude Desktop, IDE, etc.] --> MCP_SERVER[BCRP-MCP Server]
    
    subgraph TOOLS ["🔧 Tools"]
        SEARCH_GROUP[search_time_serie_group]
        SEARCH_SERIES[search_time_series_by_group]
        GET_DATA[get_time_series_data]
    end
    
    subgraph "💬 Prompts"
        SEARCH_PROMPT[search_data]
        ASK_PROMPT[ask]
    end
    
    MCP_SERVER --> SEARCH_GROUP
    MCP_SERVER --> SEARCH_SERIES
    MCP_SERVER --> GET_DATA
    MCP_SERVER --> SEARCH_PROMPT
    MCP_SERVER --> ASK_PROMPT
    
    TOOLS --> BCRP_API[BCRP API<br/>estadisticas.bcrp.gob.pe]
    
    style CLIENT fill:#e3f2fd
    style MCP_SERVER fill:#f3e5f5
    style BCRP_API fill:#fff3e0

📝 License

This project is licensed under the Apache License 2.0.


🙏 Acknowledgments

Note: bcrpy was used in early development, is no longer a dependency. Unfortunately the performance for the remote MCP server led to response timeouts.


Report Bug · Request Feature

Available Tools

3 tools
get_time_series_dataA

Get the data for a specific time series within a date range.

This function retrieves time series data from the BCRP (Banco Central de Reserva del Perú) database for a specific time series code within the specified date range. The data is returned as a list of lists with dates formatted as 'YYYY-MM-DD'.

Args: time_series_code (str): The unique code identifier for the time series. start (str): The start date for the data retrieval. Format should be '2020-1' for monthly data or '2020-1-1' for daily data. end (str): The end date for the data retrieval. Format should be '2020-1' for monthly data or '2020-1-1' for daily data.

Returns: List[List[str]]: A list of lists where each inner list contains: [formatted_date, time_series_value] The date is formatted as 'YYYY-MM-DD' and the value is the corresponding data point for that date.

Inputs: time_series_code (required), start (required), end (required). Returns: result

search_time_series_by_groupA

Search for time series within a specific group from the BCRP database.

This function retrieves time series metadata from the BCRP (Banco Central de Reserva del Perú) database and filters it to find all time series that belong to a specific group. It returns a list of dictionaries containing the code and name of each matching time series.

Args: time_series_group (str): The name of the time series group to search within. This should match or be contained within the "Grupo de serie" field in the BCRP metadata.

Returns: List[Dict[str, str]]: A list of dictionaries where each dictionary contains: - "code": The unique identifier code for the time series - "name": The descriptive name of the time series If an error occurs, returns a list with a single dictionary containing an "error" key with the error message.

Inputs: time_series_group (required).

search_time_series_groupsA

Search for time series groups using one or multiple keywords.

This function searches the BCRP (Banco Central de Reserva del Perú) database for time series groups that match the provided keywords. It returns a list of unique time series group names that contain or relate to the search terms.

Args: keywords (List[str]): A list containing one or more keywords to search for. Each keyword should be a single word without spaces.

Returns: List[str]: A list of unique time series group names that match the search criteria. Returns an empty list if no matches are found.

Inputs: keywords (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    The three tools have clearly distinct purposes with no overlap: get_time_series_data retrieves actual time series data, search_time_series_by_group finds series within a specific group, and search_time_series_groups searches for group names. Each tool serves a different function in the data discovery and retrieval workflow.

    Naming Consistency5/5

    All tools follow a consistent snake_case naming pattern with clear verb_noun structure: get_time_series_data, search_time_series_by_group, and search_time_series_groups. The naming convention is predictable and readable throughout the set.

    Tool Count4/5

    Three tools is reasonable for a specialized BCRP data server, though it feels slightly minimal. The tools cover core discovery and retrieval workflows, but additional utilities like metadata lookup or data transformation might enhance completeness. The count is appropriate but could benefit from slight expansion.

    Completeness4/5

    The toolset provides good coverage for the BCRP time series domain with clear data retrieval and discovery capabilities. Minor gaps exist, such as no direct metadata lookup by code or data transformation tools, but agents can work effectively with the provided search and get operations for most common use cases.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that provides tools to search and retrieve economic data series from the Federal Reserve Economic Data (FRED) API.
      2
      360 npm
      11
      AGPL 3.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that provides access to Federal Reserve Economic Data (FRED), enabling users to retrieve, analyze, and compare economic indicators and time series data through natural language.
      2
      -
    • A
      license
      A
      quality
      D
      maintenance
      Provides access to over 5,000 macroeconomic indicators from the Banco Central de Reserva del Perú (BCRP) statistical database. It enables AI agents to search for indicators, fetch time-series data, and generate professional economic charts.
      4
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      7
      149 PyPI
      MIT