fd-open-data-mcp
Officialfd-open-data-mcp
一个开放数据本体 MCP:在多数据源的金融/经济数据之上构建语义概念层。你用概念 + 实体来请求数据(例如“茅台的 price.close”、“中国的 GDP”);系统将概念解析为各数据源中的物理列,按质量 + 可达性对候选数据源排序,从最佳数据源抓取(带故障转移),按概念缓存,并按每个概念的频率刷新。
它消费 finddata 的 fd-* 数据源注册表和 fd-entities-indicators 只读,并在其上添加统一层:概念绑定、每个源的实体标识符、源排名、直读值缓存,以及(在此之上)用于关系和语义查询的实体图 + 向量搜索层。
English | 中文
一个开放数据本体 MCP:在多数据源的金融/经济数据之上构建语义概念层。你用概念 + 实体来请求数据(例如“茅台的 price.close”、“中国的 GDP”);系统将概念解析为各数据源中的物理列,按质量 + 可达性对候选数据源排序,从最佳数据源抓取(带故障转移),按概念缓存,并按每个概念的频率刷新。
一键安装
一个自包含的块,用于引导整个 finddata 开放数据栈(中心 + 每个数据源包 + 本体数据库)。可安全重跑;在第一个错误处停止。
# 1) Install the full stack from PyPI.
# fd-open-data-protocol is pulled in transitively; fd-polygon and
# fd-cn-report auto-register via entry-points. Drop "[data]" for a lighter
# install (MCP server + CLI only, without the akshare/yfinance/playwright SDKs).
pip install "fd-open-data-mcp[data]" fd-polygon fd-cn-report
# 2) Initialize the ontology DB and wire every layer: catalogs -> concepts ->
# column bindings -> per-source entity ids -> refresh schedules -> manifests.
fd-open-data-mcp migrate \
&& fd-open-data-mcp import-catalog \
&& fd-open-data-mcp consume-concepts \
&& fd-open-data-mcp propose-bindings \
&& fd-open-data-mcp seed-entities \
&& fd-open-data-mcp generate-schedules \
&& fd-open-data-mcp register-discovered
# 3) Start the MCP server (stdio transport, for any MCP client).
fd-open-data-mcp serve实时数据获取需要环境中的源密钥(切勿提交):POLYGON_API_KEY、EDGAR_IDENTITY,以及 fd-cn-report 的 LLM_* / ES_* 集合。请参阅每个包的配置部分。
Related MCP server: Sugra API MCP
架构
CONSUMED (read-only) ADDED by fd-open-data-mcp
fd-akshare / yfinance / edgar / concept_bindings (column -> concept)
wbgapi / cn-report / cn-gov / entity_source_identifiers (per-source id)
datacommons / polygon registries source_rankings (quality × access × freshness)
fd-entities-indicators semantic_observations (read-through cache)
indicator_defs (concepts) fetch_log / schedules / executions / policies
countries/cities/symbols/sw_industries entities / relationships (graph)
│
TRANSFORMERS: import_catalog, consume_concepts, propose_bindings,
seed_entity_identifiers, generate_refresh_schedules, ingest_entities
│
RUNTIME: read() -> cache hit? : dispatch (ranked, failover) -> cache -> log
SEARCH : semantic_search (concepts) + graph_search (entity relationships) + ai_search八个能力领域(参见 openspec/changes/add-fd-open-data-mcp/specs/):open-data-catalog、semantic-layer、entity-identity、source-ranking、concept-fetch、scheduled-refresh、entity-graph、vector-search。
安装
cd fd-open-data-mcp
uv sync # base install
# For full data source support (akshare, yfinance, edgar, world bank, etc.)
uv sync --extra data数据库路径默认为 fd_open_data_mcp/metadata/daas.db;可通过 FD_OPEN_DATA_MCP_DATABASE_URL 覆盖。FINDDATA_ROOT(默认:父级 finddata/ 目录)定位 fd-* 提供者。
SEC EDGAR 使用前需要在环境中设置
EDGAR_IDENTITY="your_email@example.com"(SEC 要求匿名访问时提供 User-Agent)。
快速开始
# 1. create the ontology tables
fd-open-data-mcp migrate
# 2. import the catalogs (akshare, yfinance, cn-gov, cn-report, edgar, ...)
fd-open-data-mcp import-catalog
# or one provider: fd-open-data-mcp import-catalog akshare
# 3. consume indicator_defs as concepts + propose column->concept bindings
fd-open-data-mcp consume-concepts
fd-open-data-mcp propose-bindings
# 4. seed per-source entity identifiers (akshare/yfinance for stocks, worldbank for countries)
fd-open-data-mcp seed-entities
# 5. generate per-concept refresh schedules from indicator_defs.frequency
fd-open-data-mcp generate-schedules
# 6. read data by concept + entity (read-through cache + ranked dispatch + failover)
fd-open-data-mcp read --concept-id 234 --entity-type stock --entity-id 1 --date 2024-07-26MCP 服务器
fd-open-data-mcp serve # FastMCP, stdio transportMCP 工具面按八个能力领域组织(请使用 MCP 客户端中的工具列表获取权威集合):
领域 | 代表性工具 |
目录 / 导入 |
|
实体身份 |
|
语义层 |
|
实体图 |
|
向量搜索 |
|
获取 |
|
定时刷新 |
|
爬取策略 |
|
cn-report 规则 |
|
ai_search 是端到端入口:语义搜索 → 图遍历 → 值查询,一次调用完成。
数据源
源在 fd_open_data_mcp/fetch/runner.py::run_upstream() 中接线,这是一个硬编码的源→运行器链。下表反映每个适配器的实际状态,而非理想状态。
生产(网络支持)
源 | 适配器 | 覆盖范围 |
|
| A股股票、基金、财务报表(eastmoney/tencent/sina 故障转移) |
|
| Yahoo Finance 全球股票 |
|
| SEC EDGAR 文件(需要 |
|
| 日本 EDINET 披露 |
|
| 韩国 DART 公司文件 |
|
| 世界银行 WDI |
|
| 中国 NBS GDP 宏观序列 |
|
| China Iron & Steel Association |
|
| CKAN 目录摄取 |
|
| 中国 NBS 统计 |
|
| 中国财务报告提取(委托给 |
| 外部 | 美国股票 OHLCV + 公司参考(需要 |
| 外部 | Google Data Commons(需要 |
外部数据源包(polygon、datacommons)在获取时惰性导入,因此 fd-open-data-mcp 不依赖其 SDK,除非实际进行获取。
存根 / 占位
这些适配器存在且可调度,但返回占位数据——它们是未来爬取工作的脚手架,不是可用的数据源:
amac-fund, shfe-metal-futures, agriculture (DCE), cme-agricultural-futures, chemicals, electronics, nonferrous, flowers-kifc, fin_platforms, sac-securities.
注意:
fd-open-data-mcp list-sourcesCLI 将每个适配器标记为“✅ 完全支持”。该标签不是集成保证——它仅检查适配器文件是否存在。请将上述存根列表视为权威。
只读注册表
源 | 状态 |
| 只读注册表(基于清单;11 个中国部委) |
| 只读目录(CKAN + 中国 NBS) |
爬取控制中心(面板 + 协调器)
策略描述要爬取的内容:概念 × 实体范围 × 日期范围 × 频率 × 模式。CrawlPolicy 从面板创建,由协调器编译为 CrawlPlan,并由 scraw-fd-open-data-mcp 执行到 semantic_observations。
# Serve the control panel (default http://0.0.0.0:8000)
FD_OPEN_DATA_MCP_DATABASE_URL=<db url> fd-open-data-mcp panel
# Run the reconciler once (due policies -> launch; closes stale runs)
python -m fd_open_data_mcp.refresh.reconciler环境变量:
PANEL_TOKEN— 如果设置,/panel/*需要它(请求头X-Panel-Token、?token=或 cookie)。POLICY_MAX_FETCHES(默认50000)— 计划大小护栏;如果到期策略的获取估计超过此值,则拒绝(记录为失败运行),除非策略设置了force。RECONCILER_LAUNCHER—scrapyd(默认)或k8s(K8sJobLauncher)。SCRAPYD_URL/SCRAW_PLAN_DIR(scrapyd 启动器),SCRAW_K8S_NAMESPACE/SCRAW_K8S_IMAGE/SCRAW_K8S_DATABASE_URL/SCRAW_K8S_REDIS_URL(k8s 启动器)。FD_PROXY_FORWARDER— 本地开发时未设置(注入垫片返回直接哨兵 → 直接出口;独立的fd-proxy-service转发器在集群爬取中拥有代理选择权)。旧版FD_PROXY_POOL/FD_EGRESS_MODE变量不再读取。
策略示例(通过面板或 MCP policy_create):
name: fund-nav-daily
entity_type: fund
concepts: nav.unit, nav.accumulated
mode: per_date # or "series" (one bulk fetch per entity)
date_policy: since_last # start = observation watermarks
frequency: daily
source: akshare
cron: 45 6 * * * UTC两个节奏说明:series 模式在每个实体的单次批量获取中回填历史(显式范围),而 since_last per_date 是稳态增量模式(仅自每个概念的水印以来的新日期;没有水印的实体不会回填——先运行显式范围回填)。参见 openspec/changes/add-fund-crawl-control-center/docs/phase7-validation.md 了解已验证的试点(实时数据库上的 76k nav 观测)。
命令行
fd-open-data-mcp migrate # create ontology tables
fd-open-data-mcp import-catalog [src] # import fd-* catalogs
fd-open-data-mcp consume-concepts # indicator_defs -> concepts
fd-open-data-mcp propose-bindings # column -> concept bindings
fd-open-data-mcp seed-entities # per-source entity identifiers
fd-open-data-mcp generate-schedules # per-concept refresh schedules
fd-open-data-mcp plan-crawl ... # compile a CrawlPlan
fd-open-data-mcp read --concept-id N --entity-type stock --entity-id 1 --date YYYY-MM-DD
fd-open-data-mcp rank-sources --concept-id N
fd-open-data-mcp register-datasource <path>
fd-open-data-mcp register-discovered # auto-discover entry-point manifests
fd-open-data-mcp list-sources # adapter inventory (see caveat above)
fd-open-data-mcp serve # MCP server (stdio)
fd-open-data-mcp panel # crawl control panel代理池操作(集群):seed-proxy-health、probe-cycle、proxy-health。
测试
uv run --with pytest pytest -qLLM 配置(用于 PDF 报告提取)
fd-cn-report 使用 LLM 从年报 PDF 中提取财务指标。它与 fd-open-data-mcp 在同一环境中运行,并通过 .env / .env.local 中的 LLM_* 环境变量进行配置:
LLM_BASE_URL=https://api.plan/v1 # Ark endpoint
LLM_API_KEY=<your-ark-key> # Ark API key
LLM_MODEL=deepseek-v4-flash # default model默认提供商是 DeepSeek on Ark。任何兼容 OpenAI 的 LLM_BASE_URL(OpenAI、Azure OpenAI、OpenRouter、本地 Ollama)也可用——将 LLM_BASE_URL / LLM_API_KEY / LLM_MODEL 指向它。如果同时设置了 LLM_API_KEY 和 OPENAI_API_KEY,则 LLM_API_KEY 优先。
设计说明 / 限制
提出并确认:列->概念绑定携带
confidence+provenance;低于阈值的绑定不会进入调度(审查队列)。实际获取会将绑定提升为sample-confirmed。排名 按
(source × concept)进行,从fetch_log自调整(有界,因此一次失败不会移除源)。冲突策略:每个
(concept, entity, date)缓存一个值,并附带source_used;值永远不会跨源合并。向量搜索 使用 JSONB + numpy(目标 Postgres 上不可用 pgvector);概念 + 实体嵌入为
semantic_search*和ai_search提供支持。真实源故障转移:函数声明
real_sources(例如stock_zh_a_hist→[eastmoney, tencent, sina]);当eastmoney被禁用时,调度器故障转移到tencent/sina。熔断器键按真实源而非按库。获取运行器中的
_build_params/_extract_value是尽力而为;生产运行器会细化每个函数的日期格式 / 负载形状怪癖。
参见 openspec/changes/add-fd-open-data-mcp/ 获取完整规范,以及 openspec/changes/add-source-proxy-health/ 获取代理/熔断器设计。
贡献
要添加新数据源:
根据
fd-open-data-protocol编写清单(YAML/JSON 或CATALOG字典)。通过包中的
pyproject.toml中的fd_open_data_mcp.datasources入口点暴露它,或使用fd-open-data-mcp register-datasource <path>。如果获取逻辑无法用内置运行器表达,则在适配器(或外部包)中提供
run_<source>(command, params),并在run_upstream()中分支处理。然后
fd-open-data-mcp register-discovered摄取它;propose-bindings将其列绑定到概念。
许可证
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceProvides access to a comprehensive financial intelligence platform featuring real-time market data, quantitative models, and alternative data sources. It enables users to perform advanced financial analysis including options analytics, portfolio modeling, and SEC filing research.

Sugra API MCPofficial
AlicenseAqualityAmaintenanceGateway connector between LLM agents and world data, providing access to financial market prices, macroeconomic indicators, and news through a bundled endpoint catalog.682MIT- FlicenseNot gradedqualityDmaintenanceUnified financial data access for US, A-share, HK stocks, and FX rates with automatic fallback across multiple data sources.1
- AlicenseAqualityBmaintenanceProvides financial agents access to the Financial Industry Business Ontology (FIBO) for querying financial concepts, terms, and relationships through natural language.223MIT
Related MCP Connectors
Macro indicators from World Bank, FRED, IMF, and OECD via unified query surface.
The financial MCP for AI agents - 90+ financial tables, SEC filings, signals, alt-data.
Live financial data MCP: FX, crypto, stocks, news, URL reader. x402 on Base: $0.001/call.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/FindDataTechnology/fd-open-data-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server