Openecon Dataのロゴ

Openecon Data

コミュニティ
hanlulong

Give your AI agent accurate economic data. 330K indicators from FRED, World Bank, IMF, Eurostat & more. MCP server + web UI.

公開者hanlulong
リポジトリopenecon-data
言語Python
フォーク
15
スター
78
利用可能なツール
0
通信方式stdio
リンク
  • ツールをAIワークフローに接続

    Openecon Dataは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには78件のスターと15件のフォークがあります。


Install (One Line, Then Just Talk)

bash
curl -fsSL https://raw.githubusercontent.com/hanlulong/openecon-data/main/scripts/install.sh | bash

That's it. The script auto-detects Claude Code and Codex, configures everything. Then just ask:

You: "What's the US GDP growth rate?"         → your agent fetches real data from FRED
You: "Compare inflation across G7 countries"   → World Bank data for 7 countries
You: "Bitcoin price last 30 days"              → CoinGecko live data

No special syntax. No "use query_data". Just ask naturally — your agent handles the rest.

Claude Code:

bash
claude mcp add --transport sse openecon-data https://data.openecon.ai/mcp --scope user

Codex:

bash
codex mcp add openecon-data --url https://data.openecon.ai/mcp

Any MCP agent: Endpoint https://data.openecon.ai/mcp (SSE transport)

See skills/README.md for slash commands and auto-trigger options.


Why Your Agent Needs This

AI agents hallucinate economic data. When you ask an LLM "What is US GDP?", you get a plausible-sounding number that may be outdated or wrong. OpenEcon solves this:

Without OpenEconWith OpenEcon
Data sourceLLM's training data (stale)Official APIs (FRED, World Bank, IMF)
AccuracyApproximate, often wrongVerified, with source attribution
CoverageWhatever the LLM remembers330K+ indicators, 200+ countries
RecencyMonths or years behindUp to real-time (FRED, ExchangeRate)
VerifiableNo source linkEvery result includes source URL

How It Compares

FeatureOpenEconfredapipandas-datareaderfred-mcp-server
Natural language queriesYesNoNoNo
Data sources10+1 (FRED)51 (FRED)
MCP server for AI agentsYesNoNoYes
Web UI with chartsYesNoNoNo
Conversational follow-upsYesNoNoNo
Smart indicator discovery330K indexedManual codesManual codesManual codes
Self-hostableYesN/AN/AYes
No code requiredYesNoNoNo

What You Can Ask

"US GDP growth last 10 years"                    → FRED, quarterly chart
"Compare China, India, Brazil GDP 2018-2024"     → World Bank, multi-country comparison
"Inflation rate BRICS countries 2019-2023"        → World Bank, 5 countries auto-expanded
"EUR/USD exchange rate last 24 months"            → ExchangeRate-API, currency pair chart
"US unemployment and CPI together since 2010"     → FRED, dual-axis overlay
"China exports to the US 2020-2024"               → UN Comtrade, bilateral trade flow
"China manufacturing PMI this year"               → ChinaMacro, fresh official NBS data
"中国社会融资规模最近一年"                          → ChinaMacro, PBoC social financing
"Credit to GDP ratio US, UK, Japan from BIS"      → BIS, financial stability data
"Bitcoin price last year"                         → CoinGecko, crypto chart
"What inflation indicators does FRED have?"       → Indicator discovery, text response

Conversational follow-ups work naturally:

You: "US GDP last 5 years"          → chart with US GDP
You: "add Germany and Japan"         → updates to 3 countries
You: "what about per capita?"        → switches to GDP per capita
You: "show only 2020-2023"           → narrows time range

Quick Start

Use the web app (no setup)

data.openecon.ai/chat — try instantly in your browser, no install. Your first 20 queries need no signup. Create a free account (email or Google) to keep going, save your history, and unlock Pro Mode.

Self-host

bash
git clone https://github.com/hanlulong/openecon-data.git
cd openecon-data
./scripts/setup.sh            # Installs npm + Python deps, creates backend/.venv, copies .env.example → .env

Then edit .env and set the two values the backend needs to start:

bash
OPENROUTER_API_KEY=sk-or-...                  # required (LLM parsing) — https://openrouter.ai/keys
JWT_SECRET=...                                # required — generate with: openssl rand -hex 32

Start both servers:

bash
python3 scripts/restart_dev.py
# Backend: http://localhost:3001  |  Frontend: http://localhost:5173

Then ask your first question — plain English in, sourced data out:

bash
curl -X POST http://localhost:3001/api/query \
  -H "Content-Type: application/json" \
  -d '{"query": "US unemployment rate since 2023"}'
jsonc
{
  "data": [{
    "metadata": {
      "source": "FRED",
      "indicator": "Unemployment Rate",
      "unit": "Percent",
      "sourceUrl": "https://fred.stlouisfed.org/series/UNRATE"  // every result links to its source
    },
    "data": [{ "date": "2023-01", "value": 3.4 }, /* ... */]
  }]
}
bash
npm install
python3 -m venv backend/.venv
source backend/.venv/bin/activate            # Windows: backend\.venv\Scripts\activate
pip install --upgrade pip
pip install -r backend/requirements.txt
cp .env.example .env                         # then set OPENROUTER_API_KEY and JWT_SECRET
python3 scripts/restart_dev.py
  • Python 3.10+
  • Node.js 18+
  • Required to start the backend:
    • OPENROUTER_API_KEY — OpenRouter API key for LLM parsing (required unless you set LLM_PROVIDER to a local model like vllm/ollama/lm-studio)
    • JWT_SECRET — any random secret; generate with openssl rand -hex 32
  • Optional: FRED API key, Comtrade API key, CoinGecko API key
  • Optional: Supabase credentials (enables real auth, Google sign-in, and persistent history; mock auth is used in development when omitted)

See Getting Started Guide for full setup instructions.

Use the HTTP API

Prefer to call the service directly? The same natural-language queries work over HTTP. Base URL: https://data.openecon.ai.

bash
curl -X POST https://data.openecon.ai/api/query \
  -H "Content-Type: application/json" \
  -d '{"query": "US unemployment rate"}'

There's also a streaming endpoint — POST /api/query/stream returns Server-Sent Events for real-time progress.

See the API Reference for the full endpoint list and request/response schemas.

How It Works

  "Compare US and           ┌──────────────┐        ┌────────────────┐
   Japan inflation"    ───▶ │  LLM Parser  │  ───▶  │  LLM Router    │
                            │  (intent,    │        │  (semantic      │
                            │   countries, │        │   routing +     │
                            │   dates)     │        │   330K index)   │
                            └──────────────┘        └───────┬────────┘
                                                            │
                            ┌────────────┐          ┌───────▼────────┐
                            │ Chart +    │  ◀────── │  Fetch from    │
                            │ CSV/JSON/  │          │  best provider │
                            │ DTA/Python │          │  (FRED, WB,    │
                            └────────────┘          │   IMF, ...)    │
                                                    └────────────────┘
  1. Parse — An LLM extracts intent, countries, indicators, and date range from plain English
  2. Route — Semantic routing picks the best provider and series from 330K+ indicators
  3. Fetch — Data retrieved from official APIs with automatic fallback if a source is down
  4. Return — Interactive chart, or structured data via MCP for your agent

Features

MCP Server — First-class Model Context Protocol support. Give Claude Code, Codex, or any MCP-compatible agent access to verified economic data.

Natural Language — No API docs, no country codes, no series IDs. Just describe what you want.

Ask in Your Language — Query in English, 中文, Español, Français, and more. The parser detects your language, finds the right indicator, and (for key messages) replies in kind. Try "北京的GDP" or "PIB de México".

330K Indicator Discovery — Full-text search across FRED, World Bank, IMF, Eurostat, BIS, and more. Ask "What trade data does Comtrade have?" and get a browsable list.

Multi-Round Conversations — Follow up naturally: add countries, change time ranges, switch indicators. Context is preserved across turns, so "now add Germany" just works.

Smart Routing — The system understands what you mean, not just what you type. It picks the right provider (FRED for US data, World Bank for global comparisons, Comtrade for trade flows) based on the meaning of your query.

Multi-Country Comparisons — Say "G7", "BRICS", "EU", "ASEAN", "Nordic" or list specific countries. Auto-expands to all members.

Fast — Repeat queries return in ~0.1 seconds. First-time queries typically take a few seconds; the first uncached query can take longer.

Resilient — If one provider is down, the system automatically falls back to the next-best source. No manual retries needed.

Clarifies Ambiguity — When a query could mean multiple things ("inflation" could be CPI, PCE, or GDP deflator), the system asks you to pick rather than guessing wrong.

Multi-Format Export — CSV, JSON, DTA (Stata), and Python code. Every export includes source attribution.

Pro Mode — AI-generated Python for advanced analysis: custom transformations, derived indicators, bespoke charts. Available to registered users on the hosted app. Disabled by default when self-hosting; set PROMODE_ENABLED=true only with proper sandboxing, since it executes generated code.

Streaming — Real-time progress via Server-Sent Events.

Accounts & Auth — Try the first 20 queries with no signup. Sign in with email + password or Google to save history and unlock Pro Mode. Includes email verification, password reset, and JWT-based sessions. Authentication is backed by Supabase (with a local mock-auth fallback for development).

Self-Hostable — AGPL-3.0 licensed. Add new providers by implementing a single base class.

Performance

MetricValue
First querytypically a few seconds (first uncached query can take longer)
Repeat query (cached)~0.1s
Indicator database330,000+ indexed series across 11 providers

Data Sources

11 providers, 330K+ indexed indicators:

ProviderCoverageIndicatorsAPI Key
FREDUS macroeconomic data (GDP, CPI, employment, rates)90,000+ seriesFree
World BankGlobal development (200+ countries, poverty, health)16,000+ indicatorsNone
IMFBalance of payments, exchange rates, fiscal dataExtensiveNone
EurostatEU member states (HICP, labor, trade)ExtensiveNone
UN ComtradeBilateral trade flows by HS commodity codeAll HS codesFree
BISCredit-to-GDP, property prices, debt securitiesCuratedNone
Statistics CanadaCanadian economic tables (labor, trade, prices)40,000+ tablesNone
OECDOECD member country statisticsExtensiveNone
ExchangeRate-API160+ currency pairs, live and historicalLive & historicalFree
CoinGeckoCryptocurrency prices and market data10,000+ coinsFree
ChinaMacroFresh Chinese headline macro (PMI, M2, social financing, CPI/PPI, 10Y yield)14 curated seriesNone

Who Is This For?

RoleHow they use it
AI Agent BuildersAdd economic data capabilities to any MCP-compatible agent — verified data, not hallucinations
Economists & ResearchersQuick data pulls for papers without writing API code
Policy AnalystsCross-country comparisons (G7, BRICS, EU) with one query
StudentsLearn by exploring — ask questions, see data, export for assignments
JournalistsFact-check economic claims against official sources in seconds

Architecture

┌─────────────────┐     ┌──────────────────┐     ┌──────────────────────────┐
│  User / Agent   │────▶│  FastAPI Backend  │────▶│  Data Providers          │
│                 │     │                  │     │                          │
│  "US inflation" │     │  LLM Parser      │     │  FRED · World Bank · IMF │
│                 │◀────│  LLM Router      │◀────│  Eurostat · BIS · ...    │
│  Chart + Data   │     │  330K Index      │     │                          │
└─────────────────┘     └──────────────────┘     └──────────────────────────┘
        │                        │
   React Frontend          MCP Endpoint
   (Vite + Recharts)     (SSE Transport)

Stack: Python · FastAPI · React · TypeScript · Vite · Recharts · Redis · OpenRouter

Contributing

Contributions welcome! See the Developer & Contributor Guide.

If you find this useful, a star helps others discover the project.

License

AGPL-3.0 — Free to use, modify, and self-host. If you run a modified version as a service, you must share your changes. For commercial licensing, contact us.

Openecon DataのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Openecon Dataに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Openecon Dataをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Openecon DataのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "openecon-data": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてOpenecon DataのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Openecon DataのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Openecon Dataを使ってこのタスクを手伝ってもらえますか?
Openecon Data
はい、読みました。
Openecon Dataで調べた結果をお伝えします。

よくある質問

Openecon Data MCPサーバーは何に使いますか?

Openecon Dataは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでOpenecon Data MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでOpenecon Dataを利用できます。

TypingMindでOpenecon Data MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Openecon Dataを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Openecon Data MCPをTypingMindに接続するにはどうすればよいですか?

Openecon DataはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでOpenecon Data MCPのどのようなツールを利用できますか?

Openecon DataはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Openecon Data MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Openecon Dataで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇