Skip to main content
Glama
MCP-FREDAPI
by Jaldekoa

MCP-FREDAPI

FRED (連邦準備制度経済データ) API とモデルコンテキストプロトコル (MCP) の統合

目次

Related MCP server: FRED MCP Server

導入

MCP-FREDAPIは、モデルコンテキストプロトコルを介してセントルイス連邦準備銀行(FRED)の経済データへのアクセスを提供します。この統合により、Cursorやその他のMCP互換環境と併用することで、ClaudeのようなAIアシスタントが経済時系列データを直接取得できるようになります。

このパッケージは公式の FRED APIと統合され、特に経済指標の時系列データを提供するseries_observations エンドポイントに重点を置いています。

インストール

インストール方法は 2 つあります。

方法1: pipを使用する

必要な依存関係をインストールします。

pip install "mcp[cli]" httpx python-dotenv

このリポジトリをクローンします:

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

方法2: uvを使用する(推奨)

この方法は、mcp.json に示されている構成と一致するため、推奨されます。

  1. まず、まだインストールしていない場合は uv をインストールします。

pip install uv
  1. このリポジトリをクローンします:

git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapi
  1. uv を使用してサーバーを実行します (依存関係を個別にインストールする必要はありません)。

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

構成

FRED APIキー

FRED API キーが必要になります。これはFRED APIから取得できます。

プロジェクト ルートに.envファイルを作成します。

FRED_API_KEY=your_api_key_here

クロード/カーソル設定

この MCP サーバーを使用するように Cursor を構成するには、 ~/.cursor/mcp.jsonファイルに次のコードを追加します。

{
  "mcpServers": {
    "mcp-fredapi": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-fredapi", "run", "--with", "mcp", "--with", "httpx", "mcp", "run", "server.py"]
    }
  }
}

/path/to/mcp-fredapiを、システム上のリポジトリへの実際のパスに置き換えてください。例:

{
  "mcpServers": {
    "mcp-fredapi": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-fredapi", "run", "--with", "mcp", "--with", "httpx", "mcp", "run", "server.py"]
    }
  }
}

注: Windows では、パスにスラッシュ/または二重のバックスラッシュ\\のいずれかを使用できます。

利用可能なツール

get_fred_series_observations

FRED から経済時系列観測を取得します。

Cursor で Claude を使用する場合、次の方法でこのツールに直接アクセスできます。

@mcp-fredapi:get_fred_series_observations

パラメータ

get_fred_series_observationsツールは以下のパラメータを受け入れます。各パラメータの詳細な技術的詳細については、公式の FRED API ドキュメントを参照してください。

パラメータ

タイプ

説明

許容値

デフォルト値

状態

シリーズID

str

経済シリーズのID

-

(必須)

✅ 動作します

並べ替え順序

str

観測値の並び替え順

「昇順」、「降順」

'昇順'

✅ 動作します

ユニット

str

データ値の変換

「lin」、「chg」、「ch1」、「pch」、「pc1」、「pca」、「cch」、「cca」、「log」

「リン」

✅ 動作します

頻度

str

観察頻度

'd'、'w'、'bw'、'm'、'q'、'sa'、'a'、'wef'、'weth'、'wew'、'wetu'、'wem'、'wesu'、'wesa'、'bwew'、'bwem'

なし

✅ 動作します

集計方法

str

頻度の集計方法

「平均」、「合計」、「eop」

'平均'

✅ 動作します

出力タイプ

整数

観測の出力タイプ

1、2、3、4

1

✅ 動作します

リアルタイム開始

str

リアルタイム期間の開始 (YYYY-MM-DD)

-

なし

❌ 動作しない

リアルタイム終了

str

リアルタイム期間の終了日(YYYY-MM-DD)

-

なし

❌ 動作しない

制限

整数/文字列

返される観測の最大数

1から100000の間

10

❌ 動作しない

オフセット

整数/文字列

最初からスキップする観測数

-

0

❌ 動作しない

観察開始

str

観察開始日(YYYY-MM-DD)

-

なし

❌ 動作しない

観察終了

str

観察終了日(YYYY-MM-DD)

-

なし

❌ 動作しない

ヴィンテージ日付

str

ヴィンテージ日付のカンマ区切りリスト

-

なし

❌ 動作しない

[!WARNING]パラメータの互換性に関する注意

MCP 実装の現在の制限により、特定のパラメータのみが正しく機能します。

  • ✅動作パラメータ: series_id 、 sort_order 、 units 、 frequency 、 aggregation_method , and output_type`。

  • ❌非稼働パラメータ: realtime_start 、 realtime_end 、 limit 、 offset 、 observation_start 、 observation_end 、およびvintage_dates 。

最良の結果を得るには、クエリで有効なパラメータを使用してください。今後のアップデートでこれらの制限が解消される可能性があります。

例

米国のGDPデータの入手

Cursor で Claude を使用する場合、次のように GDP データを要求できます。

Can you get the latest GDP data from FRED?

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "GDP"
}

GDPデータを降順で取得する

Can you get the GDP data in descending order (newest first)?

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "GDP",
  "sort_order": "desc"
}

年間GDPデータの取得

Can you get annual GDP data?

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "GDP",
  "frequency": "a"
}

インフレ率の取得

消費者物価指数データをパーセント変化付きで取得するには:

What's the recent inflation rate in the US?

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "CPIAUCSL",
  "units": "pch",
  "frequency": "m"
}

異なる出力形式

Show me GDP data in a different format.

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "GDP",
  "output_type": 2
}

貢献

ご協力をお待ちしております。以下の手順に従ってください。

  1. リポジトリをフォークする

  2. 機能ブランチを作成する ( git checkout -b feature/amazing-feature )

  3. 変更を加える

  4. 変更をコミットします( git commit -m 'Add an amazing feature' )

  5. ブランチにプッシュする ( git push origin feature/amazing-feature )

  6. プルリクエストを開く

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

参考文献

Available Tools

1 tool
get_fred_series_observationsC

Get series observations from the Fred API.

Inputs: series_id (required), realtime_start, realtime_end, limit, +9 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    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 recent community 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