Skip to main content
Glama
sip-advisor-mcp

sip-advisor-mcp

Market-Aware SIP Timing Advisor — FastMCP (워크숍)

약 180줄짜리 Python MCP 서버로, 실시간 NSE 지수 데이터를 SIP 증액/일시중지 추천으로 변환합니다. mfAPIs × SunitechAI 웨비나를 위해 제작되었습니다.

설계: 서버는 데이터를 자체 보유하지 않습니다. 원시 NIFTY 50 PE 및 OHLC 행은 MF Engine REST API에서 가져오며, 밸류에이션 백분위수, 가격 추세, SIP 규칙 로직은 이 Python 코드에 있습니다. 이 분리가 핵심 학습 포인트입니다.

도구

기능

get_nifty_valuation_context

현재 PE + 백분위수 + z-score (10년 이력 대비) → 저평가 / 적정 / 고평가

get_nifty_trend

DMA50/200, 52주 최고가/최저가와의 이격, 1/3/6개월 수익률 → 상승 / 횡보 / 하락

recommend_sip_action

밴드 (+ 추세) → 일시중지 / 유지 / step_up + 제안된 새 금액

설정

cd workshop/sip-advisor-mcp
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env      # then paste MFAPI_TOKEN

MFAPI_TOKEN은 파트너/투자자/관리자 사용자용 JWT access-token입니다. zinni-app 브라우저 세션(DevTools → Application → Local Storage 또는 Network 탭)이나 로그인 API 호출을 통해 가져올 수 있습니다. 이는 MCP 정적 토큰이 아니며, REST 엔드포인트는 일반 사용자 인증을 사용합니다.

Related MCP server: Quant Brain MCP

실행

# stdio — for Claude Desktop
python server.py

# HTTP — for ChatGPT developer mode / remote clients  (serves :8000/mcp)
MCP_TRANSPORT=http python server.py

LLM 없이 빠른 확인:

pip install fastmcp   # includes the CLI
fastmcp run server.py --transport http &
npx @modelcontextprotocol/inspector   # connect to http://localhost:8000/mcp

Claude에 연결

Claude Desktop — claude_desktop_config.example.json을 ~/Library/Application Support/Claude/claude_desktop_config.json에 병합하고(절대 경로 + 토큰 수정), Claude Desktop을 재시하는세요.

Claude Code

claude mcp add sip-advisor -- python /abs/path/workshop/sip-advisor-mcp/server.py
# set MFAPI_TOKEN in the shell that launches claude, or via --env

ChatGPT에 연결

HTTP 모드로 실하고 외부에 노출하세요(cloudflared tunnel --url http://localhost:8000 또는 ngrok http 8000). 그런 다름 설정 → 커넥터 → 고급 → 개발자 모드 → 추가를 선택해 https://…/mcp URL을 추가하세요. 일반 ChatGPT 커넥터는 search/fetch 도구가 필요하며, 이 서버는 개발자 모드 또는 Responses API에서만 작동합니다.

데모 스크립트

"저는 월 ₹10,000 NIFTY 50 SIP를 운용하고 있습니다. 현재 시장 상황을 볼 때, 증액해야 할까요, 유지해야 할까요, 아니면 일시중지해야 할까요?"

모델은 get_nifty_valuation_context → get_nifty_trend → recommend_sip_action(band, trend, 10000)을 차례로 호출하고, PE 백분위수, 추세, as_of 날짜를 근거로 그 호출을 설명합니다.

데이터 최신성에 관한 참고

프로덕션 NSE OHLC/밸류에이션 테이블은 실시간 시장보다 몇 주 늦을 수 있습니다. 도구는 as_of를 반환하므로, 데모에서 항상 그 값을 읽어서 언급하고, 라이브 전환 전에 데이터 저장소의 수집 로직을 수정하세요.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Indian stock market (NSE & BSE) MCP server with 55 tools: live quotes, financials, technicals, a 326-ratio screener, FII/DII flows, option chains with IV, parsed annual reports and concall transcripts, IPOs and portfolio tracking for ~8,200 stocks.
    55
    229 npm
    147
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables natural language quantitative analysis for US and Indian equities, including trade plans, portfolio optimization, backtests, and price alerts using real market data.
    4
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Gives AI assistants live Indian market data without any API keys, spanning NSE quotes and indices, option chains with Greeks, max pain and OI analytics, company financials, shareholding and corporate actions, plus mutual fund NAVs and trailing returns. It also ships research, market-brief and options-positioning prompts so users can compare stocks, trace sector leadership or size up an expiry through natural language.
    13
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI clients to pull live Indian and global market data and run research workflows, including multi-agent stock debate, sentiment and insider-activity detection, options and Greeks analytics, and portfolio risk scanning. It also covers institutional flows, mutual fund overlap, pledge alerts, and macro indicators so users can go from a single question to a ranked, reasoned trade or risk assessment.
    MIT