findata-mcp
A financial data MCP server that provides documentation and code examples for agents to write correct API calls to the findata library, covering equity prices, macro data, and more.
README
findata-mcp
A unified financial data library with an MCP server for code-writing agents.
When an agent queries the MCP (e.g. "equity daily prices"), it receives:
- The findata wrapper function signature
- Full parameter and return-type documentation
- A ready-to-paste code example calling our API
The MCP never fetches live data — it is a documentation server so agents can write correct calls to the findata library.
Project structure
data-mcp/
├── findata/ Data library
│ ├── equity_prices.py get_equity_prices() yfinance wrapper
│ ├── sp500_composition.py get_sp500_composition() fja05680/sp500 (local git clone)
│ ├── fama_french.py get_fama_french_factors() Ken French Data Library
│ ├── fred.py get_fred_series() FRED macroeconomic series
│ ├── cboe_volatility.py get_cboe_volatility_indices() VIX / VVIX
│ ├── coingecko.py get_coingecko_ohlcv() CoinGecko public API
│ ├── file_reader.py get_file_data() CSV / Parquet / Excel
│ └── bloomberg.py get_bloomberg_data() blpapi (stub)
├── findata_mcp/
│ └── server.py Tool registry + MCP handlers
├── Dockerfile
├── docker-compose.yml
├── .github/workflows/docker.yml GHCR build + push on every push to main
├── pyproject.toml
└── README.md
Installation
The recommended way to run findata-mcp is via Docker. The image is published to GHCR on every push to main and includes Codex CLI baked in.
Prerequisites
- Docker
- Codex authenticated on your host machine
1. Authenticate Codex (one-time)
codex auth login # opens browser → saves to ~/.codex/auth.json
2. Pull and run
curl -O https://raw.githubusercontent.com/lakshya-aga/data-mcp/main/docker-compose.yml
docker compose up -d
docker-compose.yml mounts ~/.codex read-only so the container inherits your Codex session with no interactive prompts. Named volumes keep generated files and data across restarts.
3. Verify
docker logs data-mcp-findata-mcp-1
# should show: findata-mcp starting on :8000
Connecting to the server
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"findata": {
"url": "http://localhost:8000/sse"
}
}
}
Python (raw MCP client)
import asyncio
from mcp.client.sse import sse_client
from mcp.client.session import ClientSession
async def main():
async with sse_client("http://localhost:8000/sse") as (r, w):
async with ClientSession(r, w) as s:
await s.initialize()
res = await s.call_tool("search_tools", {"query": "equity daily prices", "top_k": 3})
print(res.content[0].text)
asyncio.run(main())
OpenAI Agents SDK
from agents.mcp import MCPServerSse
mcp = MCPServerSse(url="http://localhost:8000/sse")
MCP tools
| Tool | Description |
|---|---|
search_tools |
Natural-language query → matching function docs + code examples |
get_tool_doc |
Full reference for one function by exact name |
list_all_tools |
All wrapper functions with summaries and tags |
request_data_source |
Ask Codex to implement and register a new data wrapper |
search_tools
res = await s.call_tool("search_tools", {"query": "fama french factors", "top_k": 2})
get_tool_doc
res = await s.call_tool("get_tool_doc", {"tool_name": "get_equity_prices"})
request_data_source
res = await s.call_tool("request_data_source", {
"description": "get World Bank GDP per capita using the wbdata library"
})
Codex writes findata/<module>.py, updates server.py, and hot-reloads the new function into the live registry — no restart needed.
Environment variables
| Variable | Description |
|---|---|
OPENAI_API_KEY |
Codex auth — skips OAuth if set (alternative to host auth mount) |
FRED_API_KEY |
Required for get_fred_series. Free at fred.stlouisfed.org |
CODEX_CLI_PATH |
Override Codex binary path (defaults to codex on PATH) |
findata quick reference
get_equity_prices
from findata.equity_prices import get_equity_prices
df = get_equity_prices(
tickers=["AAPL", "MSFT"],
start_date="2024-01-01",
end_date="2024-12-31",
fields=["Close"],
frequency="1d", # 1d 5d 1wk 1mo 3mo
)
get_fama_french_factors
from findata.fama_french import get_fama_french_factors
df = get_fama_french_factors(factor_model="5", start_date="2010-01-01", end_date="2020-12-31")
# columns: Mkt-RF, SMB, HML, RMW, CMA, RF
get_fred_series
from findata.fred import get_fred_series
df = get_fred_series(["CPIAUCSL", "UNRATE"], start_date="2015-01-01", end_date="2024-12-31")
get_coingecko_ohlcv
from findata.coingecko import get_coingecko_ohlcv
df = get_coingecko_ohlcv("bitcoin", vs_currency="usd", days=90)
# columns: open, high, low, close, volume
get_cboe_volatility_indices
from findata.cboe_volatility import get_cboe_volatility_indices
df = get_cboe_volatility_indices(symbols=["^VIX", "^VVIX"], start_date="2020-01-01", end_date="2024-12-31")
get_sp500_composition
from findata.sp500_composition import get_sp500_composition
members = get_sp500_composition("2024-12-31") # list[str], ~503 tickers
get_file_data
from findata.file_reader import get_file_data
df = get_file_data("data/prices.parquet", tickers=["AAPL"], start_date="2023-01-01", end_date="2023-12-31")
Tests
pytest tests/ -v
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。