Skip to main content
Glama
Jaldekoa
by Jaldekoa

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-dotenv

Clonar este repositorio:

git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapi

Mé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.

  1. Primero, instala uv si aún no lo tienes:

pip install uv
  1. Clonar este repositorio:

git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapi
  1. Utilice uv para ejecutar el servidor (no es necesario instalar dependencias por separado):

uv run --with mcp --with httpx mcp run server.py

Configuració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_here

Configuració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_observations

Pará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 , and output_type.

  • ❌ Parámetros que no funcionan : realtime_start , realtime_end , limit , offset , observation_start , observation_end y vintage_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:

  1. Bifurcar el repositorio

  2. Crear una rama de características ( git checkout -b feature/amazing-feature )

  3. Realiza tus cambios

  4. Confirme sus cambios ( git commit -m 'Add an amazing feature' )

  5. Empujar a la rama ( git push origin feature/amazing-feature )

  6. 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

Available Tools

1 tool
get_fred_series_observationsC

Get series observations from the Fred API.

ParametersJSON Schema
NameRequiredDescriptionDefault
series_idYesThe id for a series.
realtime_startNoThe start of the real-time period. Format: YYYY-MM-DD. Defaults to today's date.
realtime_endNoThe end of the real-time period. Format: YYYY-MM-DD. Defaults to today's date.
limitNoMaximum number of observations to return. Defaults to 10.
offsetNoNumber of observations to offset from first. Defaults to 0.
sort_orderNoSort order of observations. Options: 'asc' or 'desc'. Defaults to 'asc'.asc
observation_startNoStart date of observations. Format: YYYY-MM-DD.
observation_endNoEnd date of observations. Format: YYYY-MM-DD.
unitsNoData value transformation. Options: 'lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log'. Defaults to 'lin'.lin
frequencyNoFrequency 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_methodNoAggregation method for frequency. Options: 'avg', 'sum', 'eop'. Defaults to 'avg'.avg
output_typeNoOutput type of observations. Options: 1, 2, 3, 4. Defaults to 1.
vintage_datesNoComma-separated list of vintage dates.

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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. 1 tool update
    • First observedget_fred_series_observations

TDQS

C2.9/5.0

Scored across 1 tool

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness1/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides 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
    -
  • 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
    B
    quality
    D
    maintenance
    Integrates 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.
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables users to search, retrieve, and explore economic data series from the Federal Reserve Economic Data (FRED) API using natural language.
    11
    MIT