PM-MCP (Portfolio Management MCP Server)
Enables saving investment analysis reports, portfolio evaluations, and theme research directly to Obsidian vault as markdown notes with frontmatter and tags.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PM-MCP (Portfolio Management MCP Server)create a weekly report for my AI portfolio holdings"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PM-MCP (Portfolio Manager MCP Server)
미국·한국 주식을 분석하는 포트폴리오 매니저 MCP 서버입니다. 시세·재무·공시·뉴스를 수집해 팩터 점수, 랭킹, 백테스트, 차트, 마크다운 리포트를 만들고, Claude(Claude Code / Desktop)가 도구 호출로 이 과정을 대화형으로 진행합니다.
대상 시장: 미국 주식, 한국 주식(KOSPI/KOSDAQ)
서버: MCP Python SDK v2
MCPServer(v2.0.0), stdio 또는 Streamable HTTP구성: 도구 25개, 리소스 5개, 프롬프트 3개
모든 결과는 정보 제공 목적이며 투자 권유가 아닙니다.
기능
영역 | 도구 | 하는 일 |
테마 발굴 |
| 뉴스 기반 테마 추천 → 대표 종목 → 팩터 점수·백테스트 → 저점 매수 후보 |
종목 분석 |
| 종합 신호(Buy/Hold/Sell), 기술 10·재무 20·감성 10 팩터, 비교·순위, 시장 국면, 팩터 전략 백테스트 |
원천 데이터 |
| OHLCV, 뉴스 원문·감성, SEC 공시, Finnhub |
포트폴리오 |
| 건강도·손익·리밸런싱·배당·알림·상관·섹터, 페이즈 진단(상승/유지/불안정/적신호), 저장, 워치리스트 |
출력 |
| Plotly 차트 9종, 마크다운 리포트 5종 |
운영 |
| 데이터 품질 점검, 캐시·서킷 브레이커·스케줄러 상태와 조작 |
리소스:
pm://watchlist,pm://portfolios,pm://portfolios/{name},pm://reference/news-keywords,pm://reference/sector-weights프롬프트:
analyze_stock,portfolio_checkup,discover_themes파라미터 전체 목록과 v1 → v2 도구 이름 대응표: tool-catalog.md
Related MCP server: K-invest
구조
mcp_server/
mcp_app.py stdio 진입점 (python -m mcp_server.mcp_app)
mcp_app_http.py Streamable HTTP 진입점 (/mcp, Bearer 토큰)
config.py 환경 변수·경로·점수/표시 설정
endpoints/ MCP 인터페이스 계층: 도구·리소스·프롬프트 등록
discovery.py analysis.py data.py portfolio.py output.py ops.py resources.py
tools/ 데이터 수집·분석 로직 (시세, 팩터, 랭킹, 백테스트, 차트, 캐시, 스케줄러 등)
pipelines/ 여러 도구를 묶은 리포트·후보 선별 파이프라인
data/ 정적 참조 데이터 (DART/KRX/SEC 코드표, 이벤트 가중치)
skills/pm-mcp-director/ Claude가 도구를 조합하는 방법을 담은 스킬
scripts/ 실행 스크립트, 도구 카탈로그 생성기
tests/ 오프라인 테스트
data/ 런타임 산출물 (watchlist.json 외에는 git 추적 제외)데이터 소스와 필요한 키:
용도 | 소스 | 환경 변수 |
미국 시세·펀더멘털 | yfinance, SEC EDGAR | (없음) / |
미국 기술 신호 ( | Alpha Vantage |
|
미국 뉴스·내부자·애널리스트 | Finnhub |
|
한국 시세 | PyKrx → KIS Developers → Yahoo(.KS/.KQ) 순 대체 | (없음) / |
한국 재무 | OpenDART, FinanceDataReader |
|
뉴스 | Google News RSS | (없음) |
LLM 요약·감성 | Anthropic Claude (기본 |
|
키가 없는 기능은 건너뛰거나 오류로 알리고, 나머지는 그대로 동작합니다. 전체 변수와 선택 설정은 .env.example에 있습니다.
설치
Python 3.12 이상이 필요합니다.
python3.12 -m venv .venv
.venv/bin/pip install -r requirements.txt
cp .env.example .env # 필요한 키만 채움서버는 시작할 때 저장소 루트의 .env를 읽습니다.
Claude에 연결
Claude Code (모든 프로젝트에서 사용하려면 -s user):
claude mcp add -s user pm-mcp -e PYTHONPATH=$PWD -- $PWD/.venv/bin/python -m mcp_server.mcp_app
claude mcp get pm-mcp # Status: ✔ Connected 확인새 대화를 열면 /mcp에 도구 25개가 보입니다. 해제는 claude mcp remove pm-mcp -s user.
Claude Desktop 등 JSON 설정: mcp_config.sample.json을 복사해 /path/to/PM-MCP를 실제 경로로 바꿉니다. 프로젝트 루트의 .mcp.json은 경로가 PC마다 달라 git에서 제외됩니다.
Streamable HTTP:
scripts/run_mcp_http.sh # http://127.0.0.1:8010/mcpPM_MCP_TOKEN을 설정하면Authorization: Bearer <token>헤더가 필요합니다.HOST를 loopback 외 주소로 지정하려면PM_MCP_TOKEN과ALLOWED_HOSTS가 필수입니다.
스킬: skills/pm-mcp-director/는 요청 의도별로 도구를 어떤 순서로 부를지 안내합니다. claude.ai에 올릴 때는 폴더를 zip으로 묶어 Settings → Capabilities → Skills에 업로드합니다. 도구 이름이 바뀌면 이전에 올린 스킬도 교체해야 합니다.
사용 예시
자연어 요청 | 내부 호출 |
"삼성전자 분석해줘" |
|
"AAPL, MSFT, NVDA 순위 매겨줘" |
|
"AAPL 10주 150달러, MSFT 5주 400달러 들고 있는데 점검해줘" |
|
"삼성전자 최근 6개월 시세 보여줘" |
|
"요즘 뜨는 테마 추천해줘" |
|
"AI 테마 리포트 만들어줘. 티커는 AAPL, MSFT, NVDA" |
|
"최근 일주일 AI 칩, 클라우드 성장 뉴스 5개 요약해줘" |
|
"AAPL 최근 10-Q/8-K 3건 보여줘" |
|
"NVDA 2023~2024 팩터 전략 백테스트" |
|
입력 규칙:
티커: 미국은 심볼(
AAPL), 한국은 6자리 코드(005930)와market="KR"보유 종목:
'TICKER:SHARES@ENTRY_PRICE, ...'.portfolio_quick_check는'AAPL@2024-10-01:185, NVO'처럼 느슨한 형식도 받습니다.
런타임 데이터
위치 | 내용 |
| API 응답 캐시 |
|
|
|
|
|
|
| 스케줄러 주간 리포트 |
| 워치리스트 (git 추적) |
| 리포트용 PNG 차트 ( |
캐시: 데이터 유형별 TTL(가격 4시간, 펀더멘털 24시간, 뉴스 1시간, 공시 6시간 등)로 data/diskcache/에 저장합니다. 빈 결과(None, 빈 DataFrame·컬렉션)는 일시 장애일 수 있어 캐시하지 않습니다. 전체 삭제는 ops_action(action="cache_clear").
스케줄러: 서버 시작 시 자동으로 켜지지 않습니다. ops_action(action="scheduler_start")로 시작하며 시간대는 SCHEDULER_TIMEZONE(기본 Asia/Seoul)입니다.
작업 | 주기 |
| 평일 18:30 |
| 4시간마다 |
| 평일 09:00 |
| 금요일 18:00 |
| 매일 00:00 |
| 평일 19:00 |
한 번만 실행하려면 ops_action(action="scheduler_run_job", target="<작업>"), 상태는 ops_status()로 확인합니다.
테스트
.venv/bin/pip install -r requirements-dev.txt
.venv/bin/python -m pytest테스트는 네트워크 없이 동작합니다. 도구·리소스·프롬프트 등록, 오류 변환, 경로 조작 방어, 캐시 정책, HTTP 인증, Claude 래퍼(가짜 클라이언트)를 검증합니다.
실제 데이터로 도구를 하나씩 호출해 보려면 MCP Inspector를 씁니다:
npx @modelcontextprotocol/inspector .venv/bin/python -m mcp_server.mcp_app개발 가이드
도구 추가·변경
mcp_server/endpoints/<영역>.py에 함수를 작성합니다. 무거운 import는 함수 안에서 합니다(서버 시작 속도).docstring 첫 문단이 도구 설명이 됩니다. 파라미터 제약은
Annotated[..., Field(...)], 선택지는Literal로 표현합니다.실패는
ToolError를 던지거나, 기존{"error": ...}반환은check()로 감쌉니다.오래 걸리는 작업은
async+ctx.report_progress+anyio.to_thread.run_sync를 씁니다 (theme_analyze참고).
같은 파일의
TOOLS에(함수, 어노테이션)을 추가합니다. 어노테이션은_common.py의READ_EXTERNAL,READ_LOCAL,WRITE_LOCAL,WRITE_EXTERNAL,DESTRUCTIVE_LOCAL중에서 고릅니다.tests/test_server.py의EXPECTED_TOOLS를 갱신하고 테스트를 추가합니다.도구 카탈로그를 다시 생성합니다:
.venv/bin/python scripts/gen_tool_catalog.py워크플로가 바뀌면 SKILL.md와
endpoints/__init__.py의INSTRUCTIONS를 함께 고칩니다.
주의
stdio 모드에서 stdout은 JSON-RPC 전용입니다. 라이브러리
print()는 lifespan에서 stderr로 돌리지만, 새 코드는logging을 쓰세요.사용자 입력으로 파일 경로를 만들 때는
config.safe_filename()을 거칩니다.외부 API 호출은
tools/resilience.py의 서킷 브레이커와tools/cache_manager.py의@cached를 적용합니다.
This server cannot be deployed
Maintenance
Related MCP Connectors
Portfolio analytics + US-equity market research for AI clients. ChatGPT deep-research compat.
Investment research superagent: podcasts, SEC filings, and no-code research pipelines.
The Octagon MCP server provides specialized AI-powered financial research and analysis by integrating with the Octagon Market Intelligence API. It enables users to analyze public market data (SEC filings, earnings transcripts, financial metrics, and stock data for 8000+ companies), private market data (3M+ companies, 500k+ funding rounds, 2M+ M&A/IPO transactions), and conduct deep research including web scraping capabilities. The server also features autonomous research agents that search hundreds of sources and return fully cited reports in approximately one minute.
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Related MCP Servers
- AlicenseAqualityCmaintenanceA portfolio analysis MCP server that enables AI agents to manage investment portfolios, fetch financial data from Yahoo Finance and CoinGecko, and perform advanced analysis like weight optimization and Monte Carlo simulations. It utilizes reference-based caching to efficiently handle large datasets without bloating the LLM's context window.261MIT
- AlicenseNot gradedqualityAmaintenanceRead-only MCP server that connects LLMs to personal investment accounts (Toss Securities, KIS), market data, SEC filings, and Binance futures for context-aware investment responses.1MIT
- AlicenseNot gradedqualityDmaintenanceA remote MCP server for top-down portfolio construction with Interactive Brokers, exposing a typed catalog of screeners, news access, and account tools for LLM-driven research workflows.19MIT
- FlicenseBqualityCmaintenanceAn MCP server that transforms standard LLMs into autonomous investment bankers, enabling live market data retrieval, fundamental ratio calculations, DCF valuations, portfolio diversification assessment, and automated emailing of executive reports.12-