MCP-FREDAPI
MCP-FREDAPI
Integración de la API de FRED (Datos Económicos de la Reserva Federal) con el Protocolo de Contexto de Modelo (MCP)
Tabla de contenido
Related MCP server: FRED MCP Server
Introducción
MCP-FREDAPI proporciona acceso a datos económicos del Banco de la Reserva Federal de San Luis (FRED) mediante el Protocolo de Contexto de Modelo. Esta integración permite a asistentes de IA como Claude recuperar datos de series temporales económicas directamente al usar Cursor u otros entornos compatibles con MCP.
Este paquete se integra con la API oficial de FRED , centrándose específicamente en el punto final series_observations que proporciona datos de series de tiempo para indicadores económicos.
Instalación
Hay dos métodos de instalación:
Método 1: Usar pip
Instale las dependencias necesarias:
pip install "mcp[cli]" httpx python-dotenvClonar este repositorio:
git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapiMétodo 2: Uso de luz ultravioleta (recomendado)
Se recomienda este método ya que coincide con la configuración que se muestra en mcp.json.
Primero, instala uv si aún no lo tienes:
pip install uvClonar este repositorio:
git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapiUtilice uv para ejecutar el servidor (no es necesario instalar dependencias por separado):
uv run --with mcp --with httpx mcp run server.pyConfiguración
Clave API de FRED
Necesitará una clave API de FRED, que puede obtener en FRED API .
Cree un archivo .env en la raíz del proyecto:
FRED_API_KEY=your_api_key_hereConfiguración de Claude/Cursor
Para configurar Cursor para que use este servidor MCP, agregue lo siguiente a su archivo ~/.cursor/mcp.json :
{
"mcpServers": {
"mcp-fredapi": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-fredapi", "run", "--with", "mcp", "--with", "httpx", "mcp", "run", "server.py"]
}
}
}Reemplace /path/to/mcp-fredapi con la ruta real del repositorio en su sistema. Por ejemplo:
{
"mcpServers": {
"mcp-fredapi": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-fredapi", "run", "--with", "mcp", "--with", "httpx", "mcp", "run", "server.py"]
}
}
}Nota: En Windows, puede utilizar barras diagonales / o barras diagonales invertidas dobles \\ en la ruta.
Herramientas disponibles
obtener_observaciones_de_la_serie_fred
Recupera observaciones de series de tiempo económicas de FRED.
Al usar Claude en Cursor, puedes acceder a esta herramienta directamente con:
@mcp-fredapi:get_fred_series_observationsParámetros
La herramienta get_fred_series_observations acepta los siguientes parámetros. Para obtener información técnica completa sobre cada parámetro, consulte la documentación oficial de la API de FRED .
Parámetro | Tipo | Descripción | Valores permitidos | Valor predeterminado | Estado |
id de serie | cadena | El ID de la serie económica | - | (Requerido) | ✅ Obras |
orden de clasificación | cadena | Orden de clasificación de las observaciones | 'ascendente', 'descendente' | 'asc' | ✅ Obras |
unidades | cadena | Transformación del valor de los datos | 'lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log' | 'lin' | ✅ Obras |
frecuencia | cadena | Frecuencia de observaciones | 'd', 'w', 'bw', 'm', 'q', 'sa', 'a', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem' | Ninguno | ✅ Obras |
método de agregación | cadena | Método de agregación para frecuencia | 'promedio', 'suma', 'fin de operación' | 'promedio' | ✅ Obras |
tipo_de_salida | entero | Tipo de salida de las observaciones | 1, 2, 3, 4 | 1 | ✅ Obras |
inicio en tiempo real | cadena | Inicio del período de tiempo real (AAAA-MM-DD) | - | Ninguno | ❌ No funciona |
fin en tiempo real | cadena | Fin del período de tiempo real (AAAA-MM-DD) | - | Ninguno | ❌ No funciona |
límite | entero/cadena | Número máximo de observaciones a devolver | Entre 1 y 100000 | 10 | ❌ No funciona |
compensar | entero/cadena | Número de observaciones a omitir desde el principio | - | 0 | ❌ No funciona |
inicio de observación | cadena | Fecha de inicio de las observaciones (AAAA-MM-DD) | - | Ninguno | ❌ No funciona |
fin de la observación | cadena | Fecha de finalización de las observaciones (AAAA-MM-DD) | - | Ninguno | ❌ No funciona |
fechas de cosecha | cadena | Lista de fechas de cosecha separadas por comas | - | Ninguno | ❌ No funciona |
[!ADVERTENCIA] Nota sobre la compatibilidad de parámetros
Debido a las limitaciones actuales con la implementación de MCP, solo ciertos parámetros funcionan correctamente:
✅ Parámetros de trabajo :
series_id,sort_order,units,frequency, gregation_method, andoutput_type.❌ Parámetros que no funcionan :
realtime_start,realtime_end,limit,offset,observation_start,observation_endyvintage_dates.Para obtener los mejores resultados, mantenga los parámetros de trabajo en sus consultas. Las futuras actualizaciones podrían solucionar estas limitaciones.
Ejemplos
Obtención de datos del PIB de EE. UU.
Al usar Claude en Cursor, puedes solicitar datos del PIB de la siguiente manera:
Can you get the latest GDP data from FRED?
@mcp-fredapi:get_fred_series_observations
{
"series_id": "GDP"
}Obtener datos del PIB en orden descendente
Can you get the GDP data in descending order (newest first)?
@mcp-fredapi:get_fred_series_observations
{
"series_id": "GDP",
"sort_order": "desc"
}Obtención de datos del PIB anual
Can you get annual GDP data?
@mcp-fredapi:get_fred_series_observations
{
"series_id": "GDP",
"frequency": "a"
}Obtener la tasa de inflación
Para obtener datos del índice de precios al consumidor con cambio porcentual:
What's the recent inflation rate in the US?
@mcp-fredapi:get_fred_series_observations
{
"series_id": "CPIAUCSL",
"units": "pch",
"frequency": "m"
}Formato de salida diferente
Show me GDP data in a different format.
@mcp-fredapi:get_fred_series_observations
{
"series_id": "GDP",
"output_type": 2
}Contribuyendo
Se agradecen las contribuciones. Por favor, siga estos pasos:
Bifurcar el repositorio
Crear una rama de características (
git checkout -b feature/amazing-feature)Realiza tus cambios
Confirme sus cambios (
git commit -m 'Add an amazing feature')Empujar a la rama (
git push origin feature/amazing-feature)Abrir una solicitud de extracción
Licencia
Este proyecto está licenciado bajo la licencia MIT: consulte el archivo de LICENCIA para obtener más detalles.
Referencias
Documentación de la API de FRED - Observaciones de la serie : documentación oficial del punto final de la API de FRED utilizado en este proyecto.
API de FRED : información sobre cómo obtener una clave API y documentación general de API.
Protocolo de Contexto Modelo - Documentación para el Protocolo de Contexto Modelo.
Available Tools
1 toolget_fred_series_observationsC
Get series observations from the Fred API.
| Name | Required | Description | Default |
|---|---|---|---|
| series_id | Yes | The id for a series. | |
| realtime_start | No | The start of the real-time period. Format: YYYY-MM-DD. Defaults to today's date. | |
| realtime_end | No | The end of the real-time period. Format: YYYY-MM-DD. Defaults to today's date. | |
| limit | No | Maximum number of observations to return. Defaults to 10. | |
| offset | No | Number of observations to offset from first. Defaults to 0. | |
| sort_order | No | Sort order of observations. Options: 'asc' or 'desc'. Defaults to 'asc'. | asc |
| observation_start | No | Start date of observations. Format: YYYY-MM-DD. | |
| observation_end | No | End date of observations. Format: YYYY-MM-DD. | |
| units | No | Data value transformation. Options: 'lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log'. Defaults to 'lin'. | lin |
| frequency | No | Frequency of observations. Options: 'd', 'w', 'bw', 'm', 'q', 'sa', 'a', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem'. Defaults to no value for no frequency aggregation. | |
| aggregation_method | No | Aggregation method for frequency. Options: 'avg', 'sum', 'eop'. Defaults to 'avg'. | avg |
| output_type | No | Output type of observations. Options: 1, 2, 3, 4. Defaults to 1. | |
| vintage_dates | No | Comma-separated list of vintage dates. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only says 'Get', implying a read operation, but does not describe response format, pagination behavior, real-time period semantics, potential errors, or any side effects. The description is too thin to inform the agent about how the tool behaves beyond the obvious.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with zero wasted words and is front-loaded with the core verb and resource. It is appropriately brief, though given the tool's complexity, a little more structure could have made it more useful without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This is a 13-parameter tool with no output schema and no annotations. The description does not explain what an 'observation' is, what the return payload looks like, or how concepts like vintage dates and real-time periods work. The schema covers parameters, but the overall tool context is under-specified for an agent to use it confidently.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 100% description coverage across all 13 parameters, so the baseline is 3. The description itself contributes nothing to parameter understanding, but the schema adequately documents defaults, formats, and enums, so no deduction beyond baseline is warranted.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb ('Get') and resource ('series observations') with the API ('Fred'), which adequately identifies the operation. However, it does not elaborate on what 'observations' actually are or provide any differentiating detail, and it closely mirrors the tool name.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given about when to use this tool, what conditions favor it, or what alternatives exist. Since there are no sibling tools, there is no differentiation burden, but there is also no scenario or prerequisite context to help an agent decide to invoke it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
- First observed
get_fred_series_observations
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clear and distinct purpose, making disambiguation trivial.
Since there is only one tool, naming consistency is inherently perfect. The tool name follows a clear verb_noun pattern (get_fred_series_observations), which would be consistent if more tools existed.
A single tool is too few for a server named MCP-FREDAPI, which suggests broader functionality related to the Fred API. This minimal toolset likely leaves significant gaps in coverage for typical API interactions.
The server is severely incomplete, offering only one tool to get series observations. It lacks essential operations like listing series, searching, or managing data, which are core to interacting with the Fred API domain.
Maintenance
Related MCP Connectors
Equip AI with tools for researching economic data from Federal Reserve Economic Data (FRED).
FRED macro data, Treasury yields, FX rates & macro indicators for AI agents. Pay-per-query via x402.
Give your agent web search and authoritative datasets: S&P Global, FRED, OECD, SimilarWeb & more.
Macroeconomic and FX time-series data for AI agents: indicators, calendars, COT, forex, commodities.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides access to Federal Reserve Economic Data (FRED) through Claude and other LLM clients, enabling users to search for, retrieve, and visualize economic indicators like GDP, employment, and inflation data.8-
- FlicenseNot gradedqualityDmaintenanceA 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-
- AlicenseBqualityDmaintenanceIntegrates the FRED (Federal Reserve Economic Data) API with MCP, enabling AI assistants to retrieve economic time series data such as GDP, inflation, and interest rates.1MIT
- AlicenseAqualityDmaintenanceEnables users to search, retrieve, and explore economic data series from the Federal Reserve Economic Data (FRED) API using natural language.11MIT
Appeared in Searches
- A server for fetching data or resources
- How to create pie and line charts with MCP
- Understanding and Using Analytics Tools
- A platform for analyzing crypto narratives based on macroeconomic events and cultural trends
- A tool for analyzing Indian stock data for investment decisions using LLMs and news insights