mcp-bcrp 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/.github/workflows/ci.yml +1 -1
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/PKG-INFO +9 -10
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/README.md +6 -8
- mcp_bcrp-0.1.2/examples/Guia_Usuario_BCRP.ipynb +207 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/__init__.py +1 -1
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/_version.py +3 -3
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/PKG-INFO +9 -10
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/SOURCES.txt +1 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/pyproject.toml +2 -1
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/.github/workflows/publish.yml +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/.gitignore +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/CONTRIBUTING.md +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/LICENSE +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/examples/basic_usage.py +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/__main__.py +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/client.py +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/search_engine.py +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp/server.py +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/dependency_links.txt +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/entry_points.txt +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/requires.txt +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/mcp_bcrp.egg-info/top_level.txt +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/run.py +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/setup.cfg +0 -0
- {mcp_bcrp-0.1.1 → mcp_bcrp-0.1.2}/tests/test_basic.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-bcrp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: MCP Server for Banco Central de Reserva del Perú (BCRP) Statistical API
|
|
5
5
|
Author-email: Maykol Medrano <mmedrano2@uc.cl>
|
|
6
6
|
License: MIT
|
|
@@ -14,13 +14,14 @@ Classifier: Intended Audience :: Financial and Insurance Industry
|
|
|
14
14
|
Classifier: Intended Audience :: Science/Research
|
|
15
15
|
Classifier: License :: OSI Approved :: MIT License
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
22
|
Classifier: Topic :: Office/Business :: Financial
|
|
22
23
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
23
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.9
|
|
24
25
|
Description-Content-Type: text/markdown
|
|
25
26
|
License-File: LICENSE
|
|
26
27
|
Requires-Dist: fastmcp>=0.1.0
|
|
@@ -36,16 +37,14 @@ Dynamic: license-file
|
|
|
36
37
|
# mcp-bcrp
|
|
37
38
|
|
|
38
39
|
[](https://www.python.org/downloads/)
|
|
39
|
-
[](https://github.com/psf/black)
|
|
40
|
+
[](https://github.com/MaykolMedrano/mcp_bcrp)
|
|
41
|
+
[](https://pypi.org/project/mcp-bcrp/)
|
|
42
|
+
[](https://opensource.org/licenses/MIT)
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
**MCP Server for Banco Central de Reserva del Peru (BCRP) Statistical API**
|
|
44
|
+
[-green?style=for-the-badge&logo=jupyter)](https://github.com/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
|
|
45
|
+
[](https://colab.research.google.com/github/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
MCP Server and Python library for the **Banco Central de Reserva del Perú (BCRP)** Statistical API. Access over 5,000 macroeconomic indicators directly from your AI agent or Python environment.
|
|
49
48
|
|
|
50
49
|
---
|
|
51
50
|
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
# mcp-bcrp
|
|
2
2
|
|
|
3
3
|
[](https://www.python.org/downloads/)
|
|
4
|
-
[](https://github.com/psf/black)
|
|
4
|
+
[](https://github.com/MaykolMedrano/mcp_bcrp)
|
|
5
|
+
[](https://pypi.org/project/mcp-bcrp/)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**MCP Server for Banco Central de Reserva del Peru (BCRP) Statistical API**
|
|
8
|
+
[-green?style=for-the-badge&logo=jupyter)](https://github.com/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
|
|
9
|
+
[](https://colab.research.google.com/github/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
MCP Server and Python library for the **Banco Central de Reserva del Perú (BCRP)** Statistical API. Access over 5,000 macroeconomic indicators directly from your AI agent or Python environment.
|
|
14
12
|
|
|
15
13
|
---
|
|
16
14
|
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"metadata": {},
|
|
6
|
+
"source": [
|
|
7
|
+
"# 📊 Guía de Usuario: mcp-bcrp\n",
|
|
8
|
+
"\n",
|
|
9
|
+
"Bienvenido a la guía oficial de **mcp-bcrp**, la librería y servidor MCP para acceder a las estadísticas del **Banco Central de Reserva del Perú (BCRP)** de manera profesional y eficiente.\n",
|
|
10
|
+
"\n",
|
|
11
|
+
"[](https://github.com/MaykolMedrano/mcp_bcrp)\n",
|
|
12
|
+
"[](https://pypi.org/project/mcp-bcrp/)\n",
|
|
13
|
+
"\n",
|
|
14
|
+
"Esta guía te llevará desde la instalación básica hasta la generación de gráficos avanzados y análisis de datos."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"cell_type": "markdown",
|
|
19
|
+
"metadata": {},
|
|
20
|
+
"source": [
|
|
21
|
+
"## 1. Instalación\n",
|
|
22
|
+
"\n",
|
|
23
|
+
"Primero, instalamos la librería desde PyPI. Recomendamos incluir `[charts]` para poder generar visualizaciones."
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"cell_type": "code",
|
|
28
|
+
"execution_count": null,
|
|
29
|
+
"metadata": {},
|
|
30
|
+
"outputs": [],
|
|
31
|
+
"source": [
|
|
32
|
+
"!pip install mcp-bcrp[charts] -U"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"cell_type": "markdown",
|
|
37
|
+
"metadata": {},
|
|
38
|
+
"source": [
|
|
39
|
+
"## 2. Configuración y Metadatos\n",
|
|
40
|
+
"\n",
|
|
41
|
+
"La librería utiliza un motor de búsqueda determinista que requiere un catálogo de metadatos (~17MB). La primera vez que lo uses, se descargará automáticamente y se guardará en tu cache local."
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"cell_type": "code",
|
|
46
|
+
"execution_count": null,
|
|
47
|
+
"metadata": {},
|
|
48
|
+
"outputs": [],
|
|
49
|
+
"source": [
|
|
50
|
+
"import asyncio\n",
|
|
51
|
+
"from mcp_bcrp.client import AsyncBCRPClient, BCRPMetadata\n",
|
|
52
|
+
"import pandas as pd\n",
|
|
53
|
+
"\n",
|
|
54
|
+
"# Inicializamos el cliente de metadatos\n",
|
|
55
|
+
"metadata = BCRPMetadata()\n",
|
|
56
|
+
"\n",
|
|
57
|
+
"# Cargamos los metadatos (descarga automática si no existe)\n",
|
|
58
|
+
"await metadata.load()\n",
|
|
59
|
+
"\n",
|
|
60
|
+
"print(f\"Metadatos cargados: {len(metadata.df)} series disponibles.\")"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"cell_type": "markdown",
|
|
65
|
+
"metadata": {},
|
|
66
|
+
"source": [
|
|
67
|
+
"## 3. Búsqueda de Indicadores\n",
|
|
68
|
+
"\n",
|
|
69
|
+
"El motor de búsqueda es **determinista**. Puede encontrar series específicas basándose en atributos como moneda, horizonte y tipo de componente."
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"cell_type": "code",
|
|
74
|
+
"execution_count": null,
|
|
75
|
+
"metadata": {},
|
|
76
|
+
"outputs": [],
|
|
77
|
+
"source": [
|
|
78
|
+
"# Ejemplo: Buscar la tasa de interés de política monetaria\n",
|
|
79
|
+
"query = \"tasa interes politica monetaria\"\n",
|
|
80
|
+
"resultado = metadata.solve(query)\n",
|
|
81
|
+
"\n",
|
|
82
|
+
"print(\"Resultado de búsqueda:\")\n",
|
|
83
|
+
"print(f\"Código: {resultado['codigo_serie']}\")\n",
|
|
84
|
+
"print(f\"Nombre: {resultado['name_original']}\")\n",
|
|
85
|
+
"print(f\"Confianza: {resultado['confidence']}\")"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"cell_type": "markdown",
|
|
90
|
+
"metadata": {},
|
|
91
|
+
"source": [
|
|
92
|
+
"## 4. Obtención de Datos (Series Temporales)\n",
|
|
93
|
+
"\n",
|
|
94
|
+
"Usamos `AsyncBCRPClient` para descargar los datos. El cliente detecta automáticamente la frecuencia (diaria, mensual, trimestral, anual)."
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"cell_type": "code",
|
|
99
|
+
"execution_count": null,
|
|
100
|
+
"metadata": {},
|
|
101
|
+
"outputs": [],
|
|
102
|
+
"source": [
|
|
103
|
+
"client = AsyncBCRPClient()\n",
|
|
104
|
+
"\n",
|
|
105
|
+
"# Descargamos datos de Inflación y Tipo de Cambio\n",
|
|
106
|
+
"series_a_pedir = [\"PN01271PM\", \"PD04637PD\"] # IPC Variación % y T.C. Venta\n",
|
|
107
|
+
"\n",
|
|
108
|
+
"df = await client.get_series(\n",
|
|
109
|
+
" codes=series_a_pedir,\n",
|
|
110
|
+
" start_date=\"2023-01-01\",\n",
|
|
111
|
+
" end_date=\"2024-12-31\"\n",
|
|
112
|
+
")\n",
|
|
113
|
+
"\n",
|
|
114
|
+
"print(\"Primeras filas de los datos descargados:\")\n",
|
|
115
|
+
"print(df.head())"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"cell_type": "markdown",
|
|
120
|
+
"metadata": {},
|
|
121
|
+
"source": [
|
|
122
|
+
"## 5. Visualización Profesional\n",
|
|
123
|
+
"\n",
|
|
124
|
+
"La librería incluye herramientas para generar gráficos listos para reportes, manejando automáticamente el formato de fechas del BCRP."
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"cell_type": "code",
|
|
129
|
+
"execution_count": null,
|
|
130
|
+
"metadata": {},
|
|
131
|
+
"outputs": [],
|
|
132
|
+
"source": [
|
|
133
|
+
"from mcp_bcrp.server import _plot_chart # Usamos la lógica interna para el ejemplo\n",
|
|
134
|
+
"\n",
|
|
135
|
+
"# Generamos un gráfico de Expectativas de PBI\n",
|
|
136
|
+
"img_path = \"expectativas_pbi.png\"\n",
|
|
137
|
+
"\n",
|
|
138
|
+
"await _plot_chart(\n",
|
|
139
|
+
" series_codes=[\"PD38048AM\"],\n",
|
|
140
|
+
" period=\"2020-01/2024-12\",\n",
|
|
141
|
+
" title=\"Expectativas del PBI a 12 meses\",\n",
|
|
142
|
+
" names=[\"Expectativa PBI (%)\"],\n",
|
|
143
|
+
" output_path=img_path\n",
|
|
144
|
+
")\n",
|
|
145
|
+
"\n",
|
|
146
|
+
"from IPython.display import Image\n",
|
|
147
|
+
"Image(img_path)"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"cell_type": "markdown",
|
|
152
|
+
"metadata": {},
|
|
153
|
+
"source": [
|
|
154
|
+
"## 6. Análisis Estadístico Rápido\n",
|
|
155
|
+
"\n",
|
|
156
|
+
"Al obtener un `pandas.DataFrame`, podemos realizar análisis técnicos de inmediato."
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"cell_type": "code",
|
|
161
|
+
"execution_count": null,
|
|
162
|
+
"metadata": {},
|
|
163
|
+
"outputs": [],
|
|
164
|
+
"source": [
|
|
165
|
+
"import matplotlib.pyplot as plt\n",
|
|
166
|
+
"\n",
|
|
167
|
+
"# Correlación móvil entre Inflación y Expectativas (si tuviéramos ambos)\n",
|
|
168
|
+
"print(\"Resumen estadístico de las series descargadas:\")\n",
|
|
169
|
+
"print(df.describe())"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"cell_type": "markdown",
|
|
174
|
+
"metadata": {},
|
|
175
|
+
"source": [
|
|
176
|
+
"---\n",
|
|
177
|
+
"### ¿Necesitas más ayuda?\n",
|
|
178
|
+
"\n",
|
|
179
|
+
"- **Documentación completa**: [README.md](https://github.com/MaykolMedrano/mcp_bcrp/blob/main/README.md)\n",
|
|
180
|
+
"- **Reportar problemas**: [GitHub Issues](https://github.com/MaykolMedrano/mcp_bcrp/issues)\n",
|
|
181
|
+
"\n",
|
|
182
|
+
"Desarrollado con ❤️ para la comunidad de analistas económicos de Perú."
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"metadata": {
|
|
187
|
+
"kernelspec": {
|
|
188
|
+
"display_name": "Python 3",
|
|
189
|
+
"language": "python",
|
|
190
|
+
"name": "python3"
|
|
191
|
+
},
|
|
192
|
+
"language_info": {
|
|
193
|
+
"codemirror_mode": {
|
|
194
|
+
"name": "ipython",
|
|
195
|
+
"version": 3
|
|
196
|
+
},
|
|
197
|
+
"file_extension": ".py",
|
|
198
|
+
"mimetype": "text/x-python",
|
|
199
|
+
"name": "python",
|
|
200
|
+
"nbconvert_exporter": "python",
|
|
201
|
+
"pygments_lexer": "ipython3",
|
|
202
|
+
"version": "3.11.1"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"nbformat": 4,
|
|
206
|
+
"nbformat_minor": 5
|
|
207
|
+
}
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.1.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
31
|
+
__version__ = version = '0.1.2'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 2)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g2f2c0f637'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-bcrp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: MCP Server for Banco Central de Reserva del Perú (BCRP) Statistical API
|
|
5
5
|
Author-email: Maykol Medrano <mmedrano2@uc.cl>
|
|
6
6
|
License: MIT
|
|
@@ -14,13 +14,14 @@ Classifier: Intended Audience :: Financial and Insurance Industry
|
|
|
14
14
|
Classifier: Intended Audience :: Science/Research
|
|
15
15
|
Classifier: License :: OSI Approved :: MIT License
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
22
|
Classifier: Topic :: Office/Business :: Financial
|
|
22
23
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
23
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.9
|
|
24
25
|
Description-Content-Type: text/markdown
|
|
25
26
|
License-File: LICENSE
|
|
26
27
|
Requires-Dist: fastmcp>=0.1.0
|
|
@@ -36,16 +37,14 @@ Dynamic: license-file
|
|
|
36
37
|
# mcp-bcrp
|
|
37
38
|
|
|
38
39
|
[](https://www.python.org/downloads/)
|
|
39
|
-
[](https://github.com/psf/black)
|
|
40
|
+
[](https://github.com/MaykolMedrano/mcp_bcrp)
|
|
41
|
+
[](https://pypi.org/project/mcp-bcrp/)
|
|
42
|
+
[](https://opensource.org/licenses/MIT)
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
**MCP Server for Banco Central de Reserva del Peru (BCRP) Statistical API**
|
|
44
|
+
[-green?style=for-the-badge&logo=jupyter)](https://github.com/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
|
|
45
|
+
[](https://colab.research.google.com/github/MaykolMedrano/mcp_bcrp/blob/main/examples/Guia_Usuario_BCRP.ipynb)
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
MCP Server and Python library for the **Banco Central de Reserva del Perú (BCRP)** Statistical API. Access over 5,000 macroeconomic indicators directly from your AI agent or Python environment.
|
|
49
48
|
|
|
50
49
|
---
|
|
51
50
|
|
|
@@ -7,7 +7,7 @@ name = "mcp-bcrp"
|
|
|
7
7
|
dynamic = ["version"]
|
|
8
8
|
description = "MCP Server for Banco Central de Reserva del Perú (BCRP) Statistical API"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
11
|
license = {text = "MIT"}
|
|
12
12
|
authors = [
|
|
13
13
|
{name = "Maykol Medrano", email = "mmedrano2@uc.cl"}
|
|
@@ -29,6 +29,7 @@ classifiers = [
|
|
|
29
29
|
"Intended Audience :: Science/Research",
|
|
30
30
|
"License :: OSI Approved :: MIT License",
|
|
31
31
|
"Programming Language :: Python :: 3",
|
|
32
|
+
"Programming Language :: Python :: 3.9",
|
|
32
33
|
"Programming Language :: Python :: 3.10",
|
|
33
34
|
"Programming Language :: Python :: 3.11",
|
|
34
35
|
"Programming Language :: Python :: 3.12",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|