BCRP MCP Server
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., "@BCRP MCP ServerWhat is today's USD/PEN exchange rate?"
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.
BCRP MCP Server
Connects any MCP-compatible AI agent to BCRPData — the official open-access economic statistics database of the Banco Central de Reserva del Perú (BCRP).
Access real-time and historical data for exchange rates, interest rates, international reserves, monetary liquidity, private sector credit, commodity prices, stock market indicators, and GDP — no API key required.
Works with: Claude Desktop · Claude Code · Cursor · VS Code Copilot · Windsurf · Zed · Continue.dev · any MCP client
What you can ask it
Ask | Tool that answers it |
"How much is the dollar in Peru today?" |
|
"Plot Peru's GDP over the last ten years" |
|
"What's the current state of the Peruvian economy?" |
|
"I need the series code for inflation" |
|
"Export FX, inflation and GDP together as one CSV" |
|
"What period does this series actually cover?" |
|
No API key, no registration, nothing to configure. BCRPData is fully public.
Series are identified by opaque codes like PD04637PD, which mean nothing on
sight — so start from the catalog:
bcrp catalog search "tipo de cambio" # find the code
bcrp series latest PD04637PD --n 5 # then fetch itRelated MCP server: Economía Venezuela MCP
Quickstart — one command
npx bcrp-mcpThat installs all three pieces, which are designed to work together:
Piece | What it is |
| The MCP server, so AI clients can query BCRPData |
| The CLI — same tools, for humans and scripts |
| Teaches agents how to use them correctly |
It also registers the server with Claude Code automatically when the claude CLI is
present, and prints the config snippet for other clients.
npx bcrp-mcp --help # all options
npx bcrp-mcp --skill-only # just the agent skill
npx bcrp-mcp --no-skill # just the server + CLI
npx bcrp-mcp --from . # install the Python side from a local checkoutuv tool install bcrp-mcp # recommended
pipx install bcrp-mcp
pip install bcrp-mcpThe npx installer just wraps this and adds the skill. No API key is needed either way — BCRPData is a fully public API.
Then start using it:
> What is the current BCRP policy rate and exchange rate?
> Use bcrp_get_macro_snapshot to get a snapshot of Peru's key economic indicators.
> Show me the evolution of Peru's international reserves since 2020.Prerequisites
Python 3.11+
python --version # needs 3.11 or higheruv (recommended)
# Windows
winget install astral-sh.uv
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | shInstallation
Option A — uvx (zero configuration)
uvx bcrp-mcp
# Upgrade later
uv tool upgrade bcrp-mcpOption B — pip
pip install bcrp-mcp
bcrp-mcp # starts the serverOption C — From source (development)
git clone https://github.com/JOSETRA44/bcrp-mcp.git
cd bcrp-mcp
uv sync
cp .env.example .env # optional — customize settings
uv run bcrp-mcpCommand-Line Interface
Installing this package also puts a standalone bcrp CLI on your PATH. It calls the
exact same tool-core functions as the MCP server (bcrp_mcp.tools.*), so results
never drift between the two — the CLI is just a second transport on top of one shared
implementation. Useful for scripting, cron jobs, or checking data without an AI client.
bcrp --help # full command tree
bcrp series --help
bcrp series latest PD04637PD PD12301MD --n 3
bcrp series get PN00196MM --start 2020-1 --end 2024-12
bcrp series describe PD04637PD
bcrp catalog search "tipo de cambio"
bcrp catalog categories
bcrp macro snapshot
bcrp serve # run the MCP server over stdio (same as `bcrp-mcp`)Output is formatted as box-drawn tables sized to your terminal, with each value rounded to the precision the BCRP actually publishes it at:
Tipo de cambio
daily · 20.Jul.26 → 22.Jul.26 · 3 periods
Series
PD04637PD Tipo de cambio - TC Interbancario (S/ por US$) - Compra
PD12301MD Tasas de interés - Tasa de Referencia de la Política Monetaria
Data
┌───────────┬───────────┬───────────┐
│ Period │ PD04637PD │ PD12301MD │
├───────────┼───────────┼───────────┤
│ 20.Jul.26 │ 3.402 │ 4.25 │
│ 21.Jul.26 │ 3.397 │ 4.25 │
│ 22.Jul.26 │ — │ 4.25 │
└───────────┴───────────┴───────────┘Output flags available on every data command:
Flag | Effect |
| Raw tool-output dict — identical to what the MCP tool returns |
| Disable ANSI colour (also honours |
| Plain ASCII tables instead of Unicode box characters |
| Language for series names |
Exit codes: 0 success, 2 invalid input, 3 series not found, 4 BCRP API error.
bcrp series latest PD04637PD --json | jq '.data[-1]'Agent Skill
The bcrp skill teaches AI agents how to use these tools correctly — the parts that
otherwise produce confidently wrong answers: values are positional rather than keyed,
mixed-frequency requests are silently dropped rather than rejected, period formats differ
per frequency, and n.d. means "not published" rather than zero.
It installs to ~/.claude/skills/bcrp via npx bcrp-mcp (or --skill-only).
The skill's reference files are generated from the package's own catalog and API guides, so they can't drift from what the server actually serves:
uv run python scripts/gen_skill_refs.pyConfiguration (Optional)
All settings have sensible defaults. Override via environment variables or .env file:
Variable | Default | Description |
|
| Response cache in seconds (0 = disabled) |
|
| HTTP timeout in seconds |
|
| Retries on transient errors |
|
| Default language: |
|
|
|
No API key required — BCRPData is fully open access.
Configuration by Client
Claude Desktop
Config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"bcrp": {
"command": "uvx",
"args": ["bcrp-mcp"]
}
}
}Restart Claude Desktop after saving. You'll see a hammer icon (🔨) confirming the server is loaded.
Claude Code (CLI)
Add to your .mcp.json or .antigravity.json:
{
"mcpServers": {
"bcrp": {
"command": "uvx",
"args": ["bcrp-mcp"]
}
}
}From source:
{
"mcpServers": {
"bcrp": {
"command": "uv",
"args": [
"--directory", "/absolute/path/to/bcrp-mcp",
"run", "bcrp-mcp"
]
}
}
}Run /mcp in the Claude Code prompt to confirm — you should see bcrp with 6 tools.
Cursor
{
"mcpServers": {
"bcrp": {
"command": "uvx",
"args": ["bcrp-mcp"]
}
}
}VS Code + GitHub Copilot
Create .vscode/mcp.json:
{
"servers": {
"bcrp": {
"type": "stdio",
"command": "uvx",
"args": ["bcrp-mcp"]
}
}
}Windsurf
Config: %APPDATA%\Codeium\windsurf\mcp_config.json
{
"mcpServers": {
"bcrp": {
"command": "uvx",
"args": ["bcrp-mcp"]
}
}
}Zed
Edit ~/.config/zed/settings.json:
{
"context_servers": {
"bcrp": {
"command": {
"path": "uvx",
"args": ["bcrp-mcp"]
}
}
}
}Continue.dev
Edit .continue/config.yaml:
mcpServers:
- name: bcrp
command: uvx
args:
- bcrp-mcpGeneric stdio
command: uvx
args: ["bcrp-mcp"]Available Tools (6)
Tool | Description |
| Fetch 1–10 series with optional date range (all same frequency) |
| Get the most recent N data points for 1–10 series |
| Metadata only: series names, frequency, available date range |
| Search built-in catalog of important series by keyword |
| List all catalog categories with series counts |
| Real-time snapshot of Peru's key macroeconomic indicators |
Available Prompts (3)
Prompt | Arguments | Description |
|
| Structured workflow: policy rate, liquidity (M2), credit growth |
|
| Exchange rate dynamics, reserves, dollarization |
|
| GDP growth, monetary multiplier, credit cycle |
Available Resources (3)
Resource URI | Contents |
| Complete API reference: URL structure, period formats, response schema |
| Quick reference table for all period formats by frequency |
| Curated catalog of important series with codes, names, units |
Key Series Codes
Daily (format: DD-MM-YYYY)
Code | Indicator | Unit |
| TC Interbancario Compra (USD/PEN) | S/ por US$ |
| TC Interbancario Venta (USD/PEN) | S/ por US$ |
| Tasa de Referencia BCRP | % anual |
| Tasa Interbancaria, S/ | % anual |
| Reservas Internacionales Netas | Millones US$ |
| Índice General Bursátil BVL | Índice |
| Precio del Cobre | cUS$ por libra |
| Precio del Petróleo WTI | US$ por barril |
| Índice Dow Jones | Índice |
Monthly (format: YYYY-M)
Code | Indicator | Unit |
| Liquidez Total (M2) | Millones S/ |
| Circulante (M0) | Millones S/ |
| Liquidez en Soles | Millones S/ |
| Liquidez var% 12 meses | % anual |
| Crédito Sector Privado | Millones S/ |
| Crédito var% 12 meses | % anual |
Quarterly (format: YYYY-Q)
Code | Indicator | Unit |
| PBI Nominal var% | % trimestral |
| Liquidez MN var% | % trimestral |
| Emisión Primaria var% | % trimestral |
| Multiplicador Monetario var% | % trimestral |
Example Queries
# Get the current exchange rate (last 5 trading days)
bcrp_get_latest(series_codes=["PD04637PD", "PD04638PD"], n_periods=5)
# BCRP policy rate since 2022
bcrp_get_series(
series_codes=["PD12301MD"],
start_period="01-01-2022",
end_period="30-06-2026"
)
# Monthly liquidity (M2) and credit growth last 2 years
bcrp_get_series(
series_codes=["PN00196MM", "PN00496MM", "PN00500MM"],
start_period="2024-1",
end_period="2026-6"
)
# Complete macro snapshot
bcrp_get_macro_snapshot()
# Search for more series
bcrp_search_catalog(query="tipo de cambio", frequency="monthly")
bcrp_search_catalog(query="exportaciones")API Notes
No authentication required — BCRPData is fully public.
Multiple series in one call must be the same frequency (all daily, all monthly, etc.).
Period formats differ by frequency — see
bcrp://period-formatsresource.The BCRP database has 8,000+ monthly, 2,700+ quarterly, and 800+ daily series. Browse the full catalog at estadisticas.bcrp.gob.pe.
Verify It's Working
# Interactive browser UI
npx @modelcontextprotocol/inspector uvx bcrp-mcp
# Quick smoke test
echo "" | uvx bcrp-mcp
# Unit tests (from source)
uv sync --group dev
uv run pytest tests/ -vTroubleshooting
command not found: uvx
Install uv: https://docs.astral.sh/uv/getting-started/installation/
Empty results for a series
The series code may be discontinued or the period range may not have data.
Run bcrp_describe_series first to check available date range.
Series codes with mismatched frequencies All series in a single call must share the same frequency. Daily and monthly series cannot be mixed — make two separate calls.
Slow first start uv downloads and caches the package on first run. Subsequent starts take ~0.2s.
Project Structure
bcrp-mcp/
├── src/bcrp_mcp/
│ ├── server.py # FastMCP entry point
│ ├── config.py # Settings (pydantic-settings, no auth required)
│ ├── client.py # Async HTTP client + TTL cache + retry
│ ├── exceptions.py # Error hierarchy
│ ├── formatters.py # Raw BCRP JSON → clean AI-friendly dicts
│ ├── catalog.py # Curated series catalog + search
│ ├── tools/ # 6 MCP tools (thin wrappers around shared core logic)
│ ├── cli/ # `bcrp` CLI — same tool-core functions, argparse transport
│ ├── prompts/ # 3 MCP prompts (analysis workflows)
│ └── resources/ # 3 MCP resources (guides + catalog)
├── skills/bcrp/ # Agent skill (references/ generated from catalog.py)
├── npm/ # `npx bcrp-mcp` one-command installer
├── scripts/ # gen_skill_refs.py — regenerates skill references
├── tests/ # Unit tests (no network required)
├── .env.example # Optional configuration
└── pyproject.tomlData Source
All data comes from BCRPData — the official open statistics platform of the Banco Central de Reserva del Perú. For terms of use, see: https://estadisticas.bcrp.gob.pe/estadisticas/series/ayuda/condicionesUso
CLI for agents
Peru's central bank series, straight from the source and updated daily.
This CLI follows ARSENAL-SPEC.md, the contract every research
tool in this workspace shares: an agent that can drive one can drive all of them.
Discover it without reading this file
bcrp describe --json # every command, argument, row field and example
bcrp describe <command> --jsonThe manifest is derived from the parser itself, so it cannot drift out of date.
Output
-f, --format accepts table, json, jsonl, csv, md; -o FILE writes to a file; -q silences notes.
Data goes to stdout, notes and progress to stderr — piping to jq always yields
parseable JSON.
--format json returns the standard envelope:
{
"ok": true,
"command": "series get",
"source": "bcrp",
"fetched_at": "2026-08-21T14:03:11Z",
"cached": false,
"count": 10,
"meta": {},
"data": {},
"rows": []
}count always equals len(rows). An empty result is exit 0, not an error. Failures
return an error envelope carrying error.code, error.message and an actionable
error.hint, printed to stdout in machine formats so a pipeline can inspect it.
Exit codes
Code | Meaning |
0 | success (including an empty result set) |
1 | API returned an error or an unexpected response |
2 | usage error (bad flag, bad argument, unknown format) |
3 | resource not found (unknown series code) |
4 | auth or configuration error |
5 | rate limited or quota exhausted |
6 | network failure or timeout |
Cache
Results are cached on disk and survive between invocations, so a repeated query is
instant. --refresh refetches and rewrites; --no-cache skips it entirely; the
envelope reports cached.
bcrp cache stats -f json
bcrp cache clearRecipes
bcrp series get PN01288PM --start 2015-1 --end 2025-1 -f csv -o pbi.csv
bcrp series get PD04637PD PD04638PD --start 01-01-2024 -f jsonl
bcrp series latest PD04637PD --n 10 -f json
bcrp series latest PD04637PD PN01288PM -f md
bcrp series describe PD04637PD -f jsonOr through the workspace-wide entry point: arsenal run bcrp <command> ...,
and arsenal doctor bcrp --live to check this CLI still honours the contract.
Troubleshooting
"I don't know the series code"
That is what the catalog is for: bcrp catalog search <keyword>, or
bcrp catalog categories to browse. Codes are not guessable.
Not found for a code that looks right
BCRP codes encode frequency in their suffix (...PD daily, ...PM monthly).
A code exists only at its own frequency. Confirm with bcrp series describe.
"Cannot mix frequencies"
A single series get call takes series that share one frequency. Split daily and
monthly series into separate calls.
Accented series names look wrong on Windows
Fixed — the CLI forces UTF-8 output. If you still see mojibake, you are on an old
installed copy: uv tool install --force bcrp-mcp.
Documentation
Document | What's in it |
What changed in each release | |
Dev setup, the CLI contract, how to run the tests | |
What this server sends and where; how to report a vulnerability | |
Registry metadata for the official MCP registry | |
The CLI contract shared by every research server here |
Licence
MIT — see LICENSE.
This server cannot be installed
Maintenance
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides real-time Venezuelan economic data, including official and parallel exchange rates, inflation statistics, and basic goods basket prices. It enables AI assistants to query historical economic trends and current market indicators via natural language.
- AlicenseAqualityBmaintenanceProvides 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.41MIT
- AlicenseAqualityDmaintenanceEnables AI agents to access SEC EDGAR filings, US Treasury rates, BLS labor statistics, and economic indicators without API keys.610MIT
Related MCP Connectors
Live & historical FX rates for AI agents, from European Central Bank data. No API keys.
Macro data for AI agents: GDP, inflation, unemployment & trade, any country. No API keys.
Banco Central de Reserva del Perú (BCRP) statistics series API MCP. Keyless.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/JOSETRA44/BCRP-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server