실제 시장 데이터를 사용하여 AI 에이전트가 결정론적인 주식 스크리닝, 과거 백테스팅 및 Fama-French 요인 분석을 수행할 수 있도록 합니다.
다른 이름 zomma-dev/quantcontext-mcp-server, quantcontext-mcp-server, quantcontext-mcp
- 스타
- 10
- Tools
- 3
- 다운로드, 30일
- 268
- 최신 버전
- 0.1.2
- 마지막 커밋
- 2026년 10월 21일
- 라이선스
- MIT
QuantContext MCP란?
QuantContext은(는) MCP server입니다. 실제 시장 데이터를 사용하여 AI 에이전트가 결정론적인 주식 스크리닝, 과거 백테스팅 및 Fama-French 요인 분석을 수행할 수 있도록 합니다. 3개 도구를 제공합니다. 예: screen_stocks, backtest_strategy, factor_analysis.
프로젝트 README에서 생성된 요약
QuantContext MCP server 정보
QuantContext는 Claude, Codex 또는 OpenCode를 사용하는 개발자가 자연어를 통해 정량적 연구와 주식 스크리닝을 수행할 수 있게 합니다. 사용자는 생성된 숫자가 아닌 실제 시장 데이터를 사용하여 일반적인 영어로 된 전략 설명을 실행 가능한 연구 워크플로우로 변환할 수 있습니다. 이 server는 API key나 복잡한 설정 없이 로컬에서 작동하며, Yahoo Finance 및 Kenneth French Data Library와 같은 소스에서 데이터를 가져옵니다.
사용자는 세 가지 주요 도구에 액세스하여 완전한 연구 파이프라인을 구축할 수 있습니다. screen_stocks 도구는 기본적, 모멘텀 또는 기술적 신호를 사용하여 S&P 500 또는 Nasdaq 100과 같은 유니버스를 필터링합니다. backtest_strategy 도구는 이러한 선택 항목을 과거 기간 동안 평가하여 CAGR, Sharpe ratio, 최대 낙폭(maximum drawdown)과 같은 지표를 계산합니다. 마지막으로 factor_analysis 도구는 수익률을 Fama-French 요인으로 분해하여 전략이 진정한 알파를 생성하는지 아니면 단순히 시장 노출을 반영하는지 판단합니다. 이 설정은 코딩 에이전트 환경 내에서 재현 가능하고 결정론적인 결과가 필요한 트레이더와 연구원에게 이상적입니다.
활용 사례
- 1특정 지표별 주식 필터링에이전트에게 주가수익비율(PER)이 낮고 자기자본이익률(ROE)이 높은 S&P 500 기업을 찾아달라고 요청합니다.
- 2과거 데이터를 통한 매매 전략 검증Nasdaq 100 기반의 모멘텀 전략이 지난 2년 동안 월간 리밸런싱을 통해 어떻게 수행되었을지 테스트합니다.
- 3수익률 동인 분석전략의 성과가 진정한 알파에 의한 것인지, 아니면 특정 Fama-French 요인에 대한 노출 때문인지 판단합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
QuantContext MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 QuantContext MCP 설치
$ claude mcp add quantcontext-mcp-server -- uvx quantcontext-mcpCursor에 QuantContext MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"quantcontext-mcp-server": {
"command": "uvx",
"args": [
"quantcontext-mcp"
]
}
}
}VS Code에 QuantContext MCP 설치
.vscode/mcp.json
{
"servers": {
"quantcontext-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"quantcontext-mcp"
]
}
}
}VS Code CLI에 QuantContext MCP 설치
$ code --add-mcp '{"name":"quantcontext-mcp-server","type":"stdio","command":"uvx","args":["quantcontext-mcp"]}'Claude Desktop에 QuantContext MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"quantcontext-mcp-server": {
"command": "uvx",
"args": [
"quantcontext-mcp"
]
}
}
}Codex에 QuantContext MCP 설치
$ codex mcp add quantcontext-mcp-server -- uvx quantcontext-mcpCodex config.toml에 QuantContext MCP 설치
~/.codex/config.toml
[mcp_servers.quantcontext-mcp-server] command = "uvx" args = ["quantcontext-mcp"]
Gemini CLI에 QuantContext MCP 설치
$ gemini mcp add -s user quantcontext-mcp-server uvx -- quantcontext-mcpGemini settings.json에 QuantContext MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"quantcontext-mcp-server": {
"command": "uvx",
"args": [
"quantcontext-mcp"
]
}
}
}QuantContext MCP 도구 3
README에서 감지됨screen_stocksbacktest_strategyfactor_analysis
| screen_stocks | — | |
| backtest_strategy | — | |
| factor_analysis | — |
자동 검사
2026년 11월 13일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음통과
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨통과
- 모델에 대한 숨겨진 지침 없음통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음통과
README
GitHub에서 보기QuantContext
QuantContext is an MCP server that turns plain-English strategy descriptions into executable quant research: screen stocks by any criteria, backtest over historical data, and run factor analysis to see where the returns come from. Every number is computed from real market data, not generated by an LLM. Results are fully reproducible.
Works with Claude, Codex, OpenCode, or any other MCP-compatible coding agent.
Install
pip install quantcontext-mcp
Claude Code:
claude mcp add quantcontext -- quantcontext
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"quantcontext": {
"command": "quantcontext"
}
}
}
No API keys. No configuration.
Tools
Three tools that compose into a full research workflow:
screen_stocks -> backtest_strategy -> factor_analysis
| Tool | What it does |
|---|---|
screen_stocks |
Filter S&P 500, Nasdaq 100, or Russell 2000 by fundamentals, momentum, quality, technical signals, or a multi-factor blend. Returns ranked candidates. |
backtest_strategy |
Test a strategy over history with a rebalance-loop engine. Returns CAGR, Sharpe, max drawdown, equity curve, and trade log. |
factor_analysis |
Decompose strategy returns into Fama-French factors (market, size, value, momentum). Returns alpha with t-statistic, factor loadings, and R-squared. |
Sample Prompts
Stock screening:
Screen S&P 500 for value stocks: PE under 15, ROE above 12%
Find the top 20% momentum stocks in the Nasdaq 100 over the last 200 days
Rank S&P 500 stocks by a blend of value, momentum, and quality, equal weight each factor
Find S&P 500 stocks with RSI under 40 and price above the 200-day moving average
Backtesting:
Backtest a top-20% momentum strategy on Nasdaq 100, monthly rebalance, last 2 years
How would a value screen (PE under 15, ROE above 12%) have performed on S&P 500 over the last 3 years?
Test a momentum strategy with a 15% stop loss and 20% max portfolio drawdown circuit breaker
Full research workflow:
Screen S&P 500 for cheap, high-quality stocks. Backtest monthly over 3 years,
then run factor analysis. Is the return real alpha or just factor exposure?
Screen Types
| Screen | Description | Key parameters |
|---|---|---|
fundamental_screen |
Filter by PE, ROE, leverage, revenue growth | pe_lt, roe_gt, debt_equity_lt, revenue_growth_gt |
quality_screen |
Profitability and balance sheet health | roe_gt, debt_equity_lt, profit_margin_gt |
momentum_screen |
Rank by N-day price momentum | lookback_days, top_pct |
value_screen |
Cheapest stocks by valuation | pe_lt, top_n |
factor_model |
Multi-factor composite score | weights (value/momentum/quality/volatility), top_n |
technical_signal |
RSI and SMA crossover signals | rsi_period, sma_short, sma_long |
mean_reversion |
Stocks below z-score threshold | lookback_days, z_threshold |
Use from Python
The tools are also importable directly — no agent required. Useful if you have an existing script and want to plug in backtesting or factor analysis.
from quantcontext.server import screen_stocks, backtest_strategy, factor_analysis
import asyncio, json
# Screen
result = json.loads(asyncio.run(screen_stocks(
universe="sp500",
screen_type="fundamental_screen",
config={"pe_lt": 15, "roe_gt": 12},
)))
# Backtest
bt = json.loads(asyncio.run(backtest_strategy(
stages=[{"order": 1, "type": "screen", "skill": "fundamental_screen", "config": {"pe_lt": 15, "roe_gt": 12}}],
universe="sp500",
rebalance="monthly",
start_date="2022-01-01",
)))
print(bt["metrics"])
# Factor analysis — pipe the equity curve straight in
fa = json.loads(asyncio.run(factor_analysis(
equity_curve=bt["full_equity_curve"]
)))
print(fa["alpha_annualized"], fa["alpha_tstat"])
Strategies are expressed using the built-in screen types from the table above. All functions are async and return JSON strings.
Data
All public data, no API keys required.
| Data | Source | Cache |
|---|---|---|
| Daily OHLCV prices | Yahoo Finance (yfinance) |
~/.cache/quantcontext/prices.parquet |
| Fundamentals (PE, ROE, margins, etc.) | Yahoo Finance | ~/.cache/quantcontext/financials/, 24h TTL |
| Fama-French factors (Mkt-RF, SMB, HML, Mom) | Kenneth French Data Library | ~/.cache/quantcontext/ff_factors.parquet |
| Universe lists (S&P 500, Nasdaq 100) | Wikipedia | ~/.cache/quantcontext/sp500_tickers.json |
The first tool call downloads and caches data (10-30 seconds). All subsequent calls use the local cache: screening under 1s, backtesting 3-8s.
To skip the cold start, run once after install:
quantcontext-warmup --url https://quantcontext.ai/api/data
Links
License
MIT
QuantContext MCP 질문
QuantContext MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add quantcontext-mcp-server -- uvx quantcontext-mcp를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
QuantContext MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
QuantContext MCP는 어떤 도구를 제공하나요?
3개 도구를 제공합니다. 예: screen_stocks, backtest_strategy, factor_analysis.
이 MCP server를 사용하려면 API key가 필요한가요?
아니요, 이 server는 작동을 위해 API key나 별도의 설정이 필요하지 않습니다.
이 도구들을 개인 Python script에서 사용할 수 있나요?
네, AI 에이전트 없이도 기존 Python script에서 직접 임포트하여 사용할 수 있습니다.
데이터를 가져오는 데 얼마나 걸리나요?
첫 번째 도구 호출 시 데이터를 다운로드하고 캐싱하는 데 10~30초가 소요되지만, 이후 호출은 로컬 캐시를 사용하므로 훨씬 빠르게 결과를 얻을 수 있습니다.