stockdata-mcp
stockdata-mcp
주식 리서치를 위한 MCP 서버입니다. 두 개의 백엔드, 하나의 도구 인터페이스.
FMP ( | 원시 데이터 — 재무제표, 시세, 비율, 추정치, 가격, 배당금. 문서화된 공개 API. 항상 사용 가능. |
Qualtrim ( | Qualtrim이 FMP 위에서 파생해내는 것만 — 자체 DCF, 엄선된 KPI 차트, AI 해설, 낙폭 찾기, 그리고 사용자 자신의 포트폴리오와 관심목록. 선택 사항. |
이 구분은 의도적입니다. Qualtrim은 FMP의 고객입니다. 원시 데이터를 구매해서 그 위에 레이어를 추가합니다. 그래서 이 서버는 원시 데이터가 필요하면 FMP에 직접 접근하고, Qualtrim 호출은 오직 Qualtrim만의 고유 기능에만 사용합니다.
도구 52개 — FMP 30개, Qualtrim 22개.
Qualtrim 백엔드를 활성화하기 전에
이 서버의 FMP 절반은 평범합니다. 문서화된 공개 API, 가입해서 받는 키, 원하는 대로 사용하면 됩니다.
Qualtrim 절반은 그렇지 않습니다. Qualtrim은 API를 공개하지 않습니다 — 해당 경로는 그들이 배포한 JavaScript에서 읽어낸 것이며, 서비스 약관은 플랫폼 리버스 엔지니어링과 사전 서면 동의 없이 자동화된 수단으로 데이터를 수집하는 행위를 모두 금지합니다.
그 동의는 양도할 수 없으며 이 저장소가 부여하지 않습니다. Qualtrim 백엔드를 실행하려면 자체 유료 Qualtrim 계정 그리고 Qualtrim으로부터 직접 받은 서면 허가가 필요합니다. support@qualtrim.com으로 직접 문의하세요.
그렇지 않으면
QUALTRIM_USERNAME/QUALTRIM_PASSWORD를 설정하지 않은 채 서버를 실행하세요. FMP 도구는 단독으로도 정상 작동하며 여기의 어떤 것도 Qualtrim에 의존하지 않습니다.이 코드는 그러한 클라이언트가 어떻게 구성되는지에 대한 참고용으로 공개된 것이지, 남의 서비스에 연결하라는 초대가 아닙니다. Qualtrim이 명시한 위반 조치는 계정 해지이며, 요금은 환불되지 않습니다.
설치
cd ~/Projects/stockdata-mcp
uv venv && uv pip install -e .
./scripts/set-credentials.sh # prompts; password input is hiddenset-credentials.sh는 0600 권한으로 .env를 작성합니다. 이 파일은 gitignore되어 있습니다. 무료 FMP 키는 https://site.financialmodelingprep.com/developer/docs에서 받으세요.
머신의 모든 세션에서 사용하려면 한 번만 등록하세요:
claude mcp add stockdata --scope user -- ~/Projects/stockdata-mcp/.venv/bin/stockdata-mcp-e 플래그는 필요 없습니다 — 서버가 .env를 직접 읽으므로 자격 증명이 ~/.claude.json에 남지 않습니다. 실제 환경 변수는 여전히 파일을 덮어쓰므로, 원한다면 MCP 클라이언트가 -e를 전달할 수도 있습니다.
어느 세션에서든 backend_status로 확인할 수 있습니다.
모델을 위한 안내
서버는 MCP 프로토콜을 통해 자체 사용 지침을 제공합니다 — 백엔드 선택, 무료 티어 제한, Qualtrim의 특이한 동작, 수치 보고 방법. 모든 MCP 클라이언트는 별도의 설정 없이 이를 자동으로 받습니다.
연구 워크플로를 더 심층적으로 다루는 더 상세한 스킬이 .claude/skills/stock-research/에도 있습니다. Claude Code는 ~/.claude/skills/에서 이를 읽습니다(거기에 심링크하세요). Claude Desktop은 스킬을 자체 위치에서 관리하므로 그 디렉터리에서 가져오지 않습니다 — 의사 결정에 중요한 부분을 담고 있는 위의 서버 지침에 의존합니다.
Related MCP server: StocksMCP
캐싱 및 예산
응답은 ~/.cache/stockdata-mcp/cache.db의 SQLite 저장소에 캐시됩니다. 이 저장소는 클라이언트별이 아니라 전역(global)입니다 — 이 사용자의 모든 서버 프로세스가 같은 파일을 열므로 Claude Code와 Claude Desktop이 하나의 캐시와 하나의 일일 합계를 공유합니다. 이는 효율성만을 위한 것이 아니라 정확성을 위해 필요합니다. FMP 할당량은 API 키에 속하며 두 앱 모두 같은 키를 사용합니다.
TTL은 엔드포인트별로 결정됩니다. 시세(quote)는 1분, 프로필은 1주일, 참조 데이터는 1개월입니다. 날짜 범위가 오늘 이전에 끝난 과거 봉(bar)은 절대 만료되지 않습니다, 이미 발생한 종가는 바뀔 수 없기 때문입니다. 오늘까지 이어지는 범위는 여전히 움직이는 경계를 가지므로 15분이 적용됩니다.
다음 세 가지 도구가 이를 관리합니다:
도구 | 용도 |
| 오늘 보낸 요청 수, 잔여 요청, 초기화 시간, 캐시 통계 |
| 실행 전에 계획된 호출 묶음이 업스트림에서 발생시킬 비용 |
| 만료된 항목(안전) 또는 백엔드 전체 삭제 |
estimate_cost가 존재하는 이유는 도구-요청 비율이 1:1이 아니며 호출자 쪽에서는 보이지 않기 때문입니다. fmp_search는 요청 2개를, fmp_price_target은 3개를, fmp_quote는 무료 키에서 심볼당 1개를 발생시킵니다. 최악의 경우 요청 수, 이미 캐시된 구간(leg) 수, 오늘의 잔여 예산 대비 순(net) 요청 수를 보고합니다. 검증 완료: 혼합된 5회 호출 계획에서 예측이 실제 지출과 정확히 일치했으며, 같은 계획을 웜(warm) 상태로 다시 실행했을 때는 0을 반환했습니다.
동일한 심볼을 동시에 요청하는 6개의 독립 프로세스에 걸쳐 측정한 결과: 업스트림 요청 1개, 캐시 히트 5개, 잠금 경합 없음.
구성
변수 | 기본값 | 용도 |
| — |
|
| — |
|
|
| 포트폴리오/관심목록을 수정하는 도구 허용 |
|
| Qualtrim 요청 사이 최소 간격(초) |
|
| FMP 요청 사이 최소 간격(초) |
|
| 과도하게 큰 도구 페이로드 절삭 |
|
| 환경 파일의 대체 경로 |
FMP 도구
검색 및 참조: fmp_search, fmp_profile, fmp_quote, fmp_peers, fmp_reference.
펀더멘털: fmp_income_statement, fmp_balance_sheet, fmp_cash_flow, fmp_key_metrics, fmp_ratios, fmp_financial_growth, fmp_financial_scores, fmp_revenue_segmentation, fmp_enterprise_values.
애널리스트 및 밸류에이션: fmp_analyst_estimates, fmp_price_target, fmp_grades, fmp_dcf.
이벤트 및 시장: fmp_dividends, fmp_earnings, fmp_earnings_calendar, fmp_historical_prices, fmp_technical_indicator, fmp_screener, fmp_market_movers, fmp_sector_performance, fmp_insider_trading, fmp_news.
fmp_request(endpoint, params)는 전용 래퍼 없이 FMP의 약 250개 안정 엔드포인트 — ETF 보유 내역, 13F, 상원 의원 거래, 경제 지표, SEC 제출 서류, 회의록 — 에 접근할 수 있습니다.
무료 티어가 실제로 포함하는 것
실제 무료 키로 검증한 결과: 29개 도구 중 22개가 작동합니다.
유료 플랜 필요: fmp_screener, fmp_reference, fmp_news, fmp_insider_trading, fmp_technical_indicator. 각각 원인으로 해당 플랜을 지목하는 명확한 오류를 반환합니다.
참고 사항 두 가지:
다중 심볼
fmp_quote는 일괄(batch) 경로가 유료이므로 심볼별 요청으로 대체됩니다. 일일 할당량을 보호하기 위해 20개 심볼로 제한됩니다.fmp_technical_indicator가 유료인 것은 쉽게 우회할 수 있습니다 —fmp_historical_prices는 무료이므로 지표를 OHLCV에서 로컬로 계산할 수 있습니다.
무료 티어는 하루 약 250회의 요청을 허용합니다. limit과 from_date/to_date를 전달하세요. 가격 이력의 기본값은 전체 시계열입니다.
Qualtrim 도구
심볼별: qualtrim_overview, qualtrim_profile, qualtrim_quote, qualtrim_dcf, qualtrim_kpi_charts, qualtrim_chart, qualtrim_ai_analysis, qualtrim_analyst_estimates.
비교: qualtrim_available_kpis, qualtrim_compare.
내 계정: qualtrim_portfolios, qualtrim_portfolio, qualtrim_portfolio_look_through_earnings, qualtrim_portfolio_ai_analysis, qualtrim_portfolio_dividends, qualtrim_watchlists, qualtrim_watchlist, qualtrim_dip_finder, qualtrim_watchlist_valuation_ranges.
탈출구: qualtrim_request(path), GET 전용.
쓰기 도구(qualtrim_add_watchlist_stock, qualtrim_add_portfolio_holding)는 QUALTRIM_ENABLE_WRITES=true가 아니면 실행을 거부합니다.
Qualtrim 인증의 실제 작동 방식
배포된 번들은 bearer-token 인증처럼 보입니다 — localStorage의 authTokens, Authorization: Bearer. 하지만 실제로는 그렇지 않습니다. 로그인은 사용자 객체를 반환하고 Express 세션 쿠키 (connect.sid)를 설정합니다. 일반 요청을 승인하는 것은 바로 그 쿠키입니다. 번들의 토큰 경로는 오직 refresh 호출에서만 사용됩니다.
이 클라이언트는 쿠키 저장소(cookie jar)를 유지하고, 세션을 ~/.cache/stockdata-mcp/qualtrim-session.json(0600)에 캐시하며, 401 응답 시 자동으로 다시 로그인합니다.
알려진 드리프트
배포된 백엔드는 이미 경로를 읽어낸 번들과 달라졌습니다:
번들의 경로 | 실제 |
| 404 — |
| 저장된 계산기만 반환; |
두 도구 모두 이미 작동하는 변형을 사용합니다. 시간이 지나면서 이런 일이 더 많아질 것입니다 — Qualtrim 도구의 404는 경로가 이동했다는 뜻이지 티커가 잘못되었다는 뜻이 아닙니다.
qualtrim_dcf가 빈 값을 반환하는 것은 실패가 아닙니다. 계정에 해당 심볼에 대한 DCF가 저장되어 있지 않다는 뜻입니다.
Qualtrim과 서비스 약관
Qualtrim은 API를 공개하지 않습니다. 이 경로들은 그들이 배포한 JavaScript에서 읽어낸 것입니다. 두 가지 결과가 있습니다:
예고 없이 깨질 수 있습니다. 위의 "알려진 드리프트"를 참고하세요 — 이미 그렇게 되었습니다.
약관에 의해 제한됩니다. 허용 사용(acceptable-use) 조항은 사전 서면 동의 없이 자동화된 수단으로 사이트에서 데이터를 체계적으로 수집하는 것을 금지하며, 별도로 플랫폼 리버스 엔지니어링도 금지합니다. 이들의 집행 수단은 계정 해지이며, 요금은 환불되지 않습니다.
동의는 얻을 수 있습니다 — 금지 조항은 동의를 조건으로 합니다. support@qualtrim.com으로 Qualtrim에 직접 문의하고 답변을 보관하세요.
여기의 기본값은 보수적입니다: 초당 1회 요청, 최대 2개 동시 요청, 브라우저와 일치하는 user agent, 기본적으로 GET만, 대량 열거 없음. 대화형 리서치 수준의 사용량으로 유지하세요.
구조
src/stockdata_mcp/
server.py tool definitions for both backends
fmp.py FMP stable-API client
qualtrim.py Qualtrim cookie-session client
util.py throttling, response trimming, .env loading
scripts/
set-credentials.sh
.claude/skills/stock-research/SKILL.md투자 조언이 아닙니다
자신의 연구를 위한 데이터입니다. 어느 소스도 정확성을 보장하지 않으며, 여기의 어떤 내용도 매수 또는 매도 권유가 아닙니다.
Available Tools
33 toolsbackend_statusA
Report which backends are configured and how this server is set up.
Inputs: no named parameters. Returns: result
cache_clearA
Drop cached responses. Use when data looks stale despite its TTL.
"expired" (the default) only removes entries already past their TTL and is always safe. Clearing live entries means paying for those requests again — note that past price bars never expire by design, because they cannot change.
Inputs: backend. Returns: result
estimate_costA
Say what a set of tool calls will cost upstream before running them.
The tool-to-request ratio is not 1:1 — fmp_search issues two requests, fmp_price_target three, and fmp_quote falls back to one per symbol on a free key. Cached legs cost nothing. Use this before a multi-step analysis, or whenever a plan touches many symbols.
Args: calls: Tool calls to price, e.g. [{"tool": "fmp_profile", "args": {"symbol": "AAPL"}}, {"tool": "fmp_quote", "args": {"symbols": "AAPL,MSFT,NVDA"}}]
Returns per-call worst-case requests, how many legs are already cached, and the net spend against today's remaining budget.
Inputs: calls (required). Returns: result
fmp_analyst_estimatesC
Forward analyst estimates for revenue, EPS, EBITDA and net income.
Inputs: symbol (required), limit, period. Returns: result
fmp_balance_sheetD
Balance sheet statements.
Inputs: symbol (required), limit, period. Returns: result
fmp_cash_flowD
Cash flow statements.
Inputs: symbol (required), limit, period. Returns: result
fmp_dcfB
FMP's discounted cash flow valuation for a symbol.
Args: levered: Use the levered (post-debt) DCF instead of the standard one.
Inputs: symbol (required), levered. Returns: result
fmp_dividendsB
Dividend history for a symbol: declaration, record, payment dates and amounts.
Inputs: symbol (required), limit. Returns: result
fmp_earningsB
Earnings history and upcoming dates: actual vs estimated EPS and revenue.
Inputs: symbol (required), limit. Returns: result
fmp_earnings_calendarB
Market-wide earnings calendar over a date range (YYYY-MM-DD).
Inputs: to_date (required), from_date (required). Returns: result
fmp_enterprise_valuesC
Enterprise value, market cap, and net debt over time.
Inputs: symbol (required), limit, period. Returns: result
fmp_financial_growthC
Period-over-period growth rates across the three statements.
Inputs: symbol (required), limit, period. Returns: result
fmp_financial_scoresB
Altman Z-score and Piotroski F-score for a symbol.
Inputs: symbol (required). Returns: result
fmp_gradesC
Analyst upgrades and downgrades, or the consensus grade distribution.
Inputs: symbol (required), historical. Returns: result
fmp_historical_pricesA
Historical OHLCV data.
Args: symbol: Ticker, index (^GSPC), crypto (BTCUSD) or FX pair (EURUSD). from_date: Start date, YYYY-MM-DD. Strongly recommended — without it you get the full history, which is large. to_date: End date, YYYY-MM-DD. interval: "1day" for end-of-day, otherwise an intraday bar size. full: For daily data, include change/VWAP columns rather than the light form.
Inputs: symbol (required), full, to_date, interval, +1 more. Returns: result
fmp_income_statementC
Income statements. Use limit to control how many periods come back.
Inputs: symbol (required), limit, period. Returns: result
fmp_insider_tradingC
Insider transactions for a symbol, or aggregate insider buy/sell statistics.
Inputs: symbol (required), limit, statistics. Returns: result
fmp_key_metricsC
Per-share and valuation metrics: P/E, EV/EBITDA, ROIC, FCF per share, etc.
Args: ttm: Return trailing-twelve-month values instead of discrete periods.
Inputs: symbol (required), ttm, limit, period. Returns: result
fmp_market_moversA
Today's biggest gainers, biggest losers, or most actively traded names.
Inputs: kind. Returns: result
fmp_newsA
Recent news articles for one or more comma-separated symbols.
Inputs: symbols (required), limit. Returns: result
fmp_peersC
Comparable companies for a symbol, as identified by FMP.
Inputs: symbol (required). Returns: result
fmp_price_targetB
Analyst price-target summary and consensus, plus the current rating snapshot.
Inputs: symbol (required). Returns: result
fmp_profileC
Company profile: sector, industry, market cap, description, exchange, CEO.
Inputs: symbol (required). Returns: result
fmp_quoteA
Current quote for one or more symbols.
Args: symbols: One symbol, or several comma-separated ("AAPL,MSFT,NVDA"). short: Return only price/volume rather than the full quote.
Inputs: symbols (required), short. Returns: result
fmp_ratiosC
Financial ratios: margins, liquidity, leverage, returns, payout.
Inputs: symbol (required), ttm, limit, period. Returns: result
fmp_referenceA
Look up the valid values for screener filters, or an index's constituents.
Inputs: kind (required). Returns: result
fmp_requestA
Call any FMP stable endpoint directly — an escape hatch for the ~250 endpoints without a dedicated tool here (ETF holdings, 13F, senate trades, economic indicators, SEC filings, transcripts, and so on).
Args: endpoint: Path after /stable/, e.g. "etf/holdings" or "treasury-rates". params: Query parameters, e.g. {"symbol": "SPY"}. The API key is added automatically.
Inputs: endpoint (required), params. Returns: result
fmp_revenue_segmentationB
Revenue split by product line or by geography.
Inputs: symbol (required), by. Returns: result
fmp_screenerB
Screen for stocks matching fundamental and market filters.
Call fmp_reference("sectors") or fmp_reference("industries") first if you need the exact spelling of a sector or industry value.
Inputs: limit, is_etf, sector, country, +14 more. Returns: result
fmp_searchA
Find a ticker symbol by symbol fragment or company name.
Args: query: A symbol fragment ("AAP") or company name ("Apple"). limit: Max results. exchange: Optional exchange filter, e.g. "NASDAQ".
Inputs: query (required), limit, exchange. Returns: result
fmp_sector_performanceB
Sector performance, or sector P/E ratios, as of a date (YYYY-MM-DD).
Inputs: pe, date. Returns: result
fmp_technical_indicatorD
A technical indicator series — useful for backtesting signal ideas.
Inputs: symbol (required), to_date, from_date, indicator, +2 more. Returns: result
usage_statusA
Upstream requests spent today, what remains, and when the budget resets.
Counts requests that actually left this machine — cache hits are free and
are reported separately as saved. The count is shared by every client on
this machine (Claude Code and Claude Desktop use the same store and the
same API key), so it reflects total spend, not this session's.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Most tools map cleanly to a distinct data category, and the fmp_ prefixes help separate market data, fundamentals, analyst data, and utilities. A few analyst-related tools and the key_metrics/ratios pair overlap enough that an agent must read the descriptions carefully to pick the right one.
All data tools follow a consistent fmp_<category> snake_case pattern, making the group recognizable and predictable. The operational tools like usage_status and cache_clear break the prefix convention, but they are still readable and clearly grouped, so the deviation is minor.
At 33 tools, the server exceeds the 25+ threshold and presents a heavy surface for an agent to navigate. Many fundamental and analyst tools could be consolidated, and fmp_request already provides a catch-all for less common FMP endpoints.
The set covers the core market-data workflow thoroughly: quotes, historical prices, fundamentals, financial statements, dividends, earnings, analyst data, screening, news, and insider trades. The fmp_request escape hatch also covers any remaining FMP endpoints, so there are no obvious dead ends.
Maintenance
Related MCP Connectors
Production MCP server for US equity and options intelligence: real-time IV radar, Monte Carlo simulation, options pressure, strategy backtesting, AI prediction, pre-trade risk analysis, and automated stock research reports.
MCP server for Financial Modeling Prep API with 250+ financial data tools
Hosted MCP server for Indian NSE/BSE stock research: 59 tools for quotes, financials and ratios, peers, shareholding and pledge, filings with extracted facts, screens, F&O and FII/DII context. Source and freshness on every answer; no buy/sell calls.
Research-only MCP server: your AI as a quant research desk. 90 tools, no trades, no brokers.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that provides comprehensive access to real-time stock quotes, financial statements, analyst estimates, and technical indicators via the Financial Modeling Prep API. It enables users to conduct in-depth financial analysis and track market performance through specialized tools, resources, and prompt templates.2630 npm1MIT
- FlicenseNot gradedqualityDmaintenanceAI-powered stock research MCP server with real-time data, CRUD operations, and interactive dashboard for fundamental analysis and comparisons.-
- AlicenseAqualityDmaintenanceA comprehensive MCP server for stock analysis and trading insights, including stock screening, fundamental analysis, insider trading, options analysis, social media research, and news analysis.1075MIT
- AlicenseAqualityBmaintenanceA modular MCP server providing 64 tools across 13 modules for real-time stock and crypto market data, including scanning, technical analysis, options flow, insider trades, and personalized watchlists.39184 npm8MIT