Portfolio Manager
Comprehensive portfolio analysis using Alpaca MCP Server integration to fetch holdings and positions, then analyze asset allocation, risk metrics, individual stock positions, diversification, and generate rebalancing recommendations. Use when user requests portfolio review, position analysis, risk assessment, performance evaluation, or rebalancing suggestions for their brokerage account.
Alpaca Required for Full Analysis
Download Skill Package (.skill) View Source on GitHub
Table of Contents
Limited Offline CSV Review
Run python3 skills/portfolio-manager/scripts/review_csv.py --input
skills/portfolio-manager/assets/fictional_holdings.csv --as-of
2026-10-20T12:00:00Z --output-dir reports from the repository root with Python
3.9+. No credentials are needed. This fictional example writes JSON and Markdown
allocation reports with gross holdings value 80 USD and signed net value 20 USD.
Read the CSV schema and output contract
before supplying a local snapshot. Missing costs mean unavailable P&L; cash,
leverage, historical performance and trading recommendations are unavailable.
Reports contain sensitive holdings: keep personal inputs and reports local.
This is a standalone foundation for #512; Navigator/workflow/replay integration
and API/CSV contract alignment remain outstanding. It does not make
core-portfolio-weekly runnable from CSV or bypass reconciliation.
1. Overview
Analyze and manage investment portfolios by integrating with Alpaca MCP Server to fetch real-time holdings data, then performing comprehensive analysis covering asset allocation, diversification, risk metrics, individual position evaluation, and rebalancing recommendations. Generate detailed portfolio reports with actionable insights.
This skill leverages Alpaca’s brokerage API through MCP (Model Context Protocol) to access live portfolio data, ensuring analysis is based on actual current positions rather than manually entered data.
2. When to Use
Invoke this skill when the user requests:
- “Analyze my portfolio”
- “Review my current positions”
- “What’s my asset allocation?”
- “Check my portfolio risk”
- “Should I rebalance my portfolio?”
- “Evaluate my holdings”
- “Portfolio performance review”
- “What stocks should I buy or sell?”
- Any request involving portfolio-level analysis or management
3. Prerequisites
Alpaca MCP Server Setup
This skill requires Alpaca MCP Server to be configured and connected. The MCP server provides access to:
- Current portfolio positions
- Account equity and buying power
- Historical positions and transactions
- Market data for held securities
MCP Server Tools Used:
get_account_info- Fetch account equity, buying power, cash balanceget_positions- Retrieve all current positions with quantities, cost basis, market valueget_portfolio_history- Historical portfolio performance data- Market data tools for price quotes and fundamentals
If Alpaca MCP Server is not connected, inform the user and provide setup instructions from references/alpaca_mcp_setup.md.
4. Quick Start
# Test Alpaca connection
python3 skills/portfolio-manager/scripts/check_alpaca_connection.py
# Portfolio analysis is done via Claude with Alpaca MCP tools
# See portfolio-manager/references/alpaca-mcp-setup.md for setup
5. Workflow
Step 1: Fetch Portfolio Data via Alpaca MCP
Use Alpaca MCP Server tools to gather current portfolio information:
1.1 Get Account Information:
Use mcp__alpaca__get_account_info to fetch:
- Account equity (total portfolio value)
- Cash balance
- Buying power
- Account status
1.2 Get Current Positions:
Use mcp__alpaca__get_positions to fetch all holdings:
- Symbol ticker
- Quantity held
- Average entry price (cost basis)
- Current market price
- Current market value
- Unrealized P&L ($ and %)
- Position size as % of portfolio
1.3 Get Portfolio History (Optional):
Use mcp__alpaca__get_portfolio_history for performance analysis:
- Historical equity values
- Time-weighted return calculation
- Drawdown analysis
Data Validation:
- Verify all positions have valid ticker symbols
- Confirm market values sum to approximate account equity
- Check for any stale or inactive positions
- Handle edge cases (fractional shares, options, crypto if supported)
Step 2: Enrich Position Data
For each position in the portfolio, gather additional market data and fundamentals:
2.1 Current Market Data:
- Real-time or delayed price quotes
- Daily volume and liquidity metrics
- 52-week range
- Market capitalization
2.2 Fundamental Data: Use WebSearch or available market data APIs to fetch:
- Sector and industry classification
- Key valuation metrics (P/E, P/B, dividend yield)
- Recent earnings and financial health indicators
- Analyst ratings and price targets
- Recent news and material developments
2.3 Technical Analysis:
- Price trend (20-day, 50-day, 200-day moving averages)
- Relative strength
- Support and resistance levels
- Momentum indicators (RSI, MACD if available)
Step 3: Portfolio-Level Analysis
Perform comprehensive portfolio analysis using frameworks from reference files:
3.1 Asset Allocation Analysis
Read references/asset-allocation.md for allocation frameworks
Analyze current allocation across multiple dimensions:
By Asset Class:
- Equities vs Fixed Income vs Cash vs Alternatives
- Compare to target allocation for user’s risk profile
- Assess if allocation matches investment goals
By Sector:
- Technology, Healthcare, Financials, Consumer, etc.
- Identify sector concentration risks
- Compare to benchmark sector weights (e.g., S&P 500)
By Market Cap:
- Large-cap vs Mid-cap vs Small-cap distribution
- Concentration in mega-caps
- Market cap diversification score
By Geography:
- US vs International vs Emerging Markets
- Domestic concentration risk assessment
Read-only reconciliation before weekly review
For core-portfolio-weekly, prepare complete, same-account broker and ACTIVE /
PARTIALLY_CLOSED memory snapshots using the
position reconciliation guide.
Run skills/portfolio-manager/scripts/reconcile_positions.py locally to obtain
JSON and Markdown reports. Stop allocation and rebalance review when
can_continue is false or completeness, account attribution or freshness is
unresolved. This offline manual gate does not authorize orders or modify theses;
automatic exports and replay enforcement remain follow-up work under #493.
6. Resources
References:
skills/portfolio-manager/references/alpaca-mcp-setup.mdskills/portfolio-manager/references/asset-allocation.mdskills/portfolio-manager/references/diversification-principles.mdskills/portfolio-manager/references/portfolio-risk-metrics.mdskills/portfolio-manager/references/position-evaluation.mdskills/portfolio-manager/references/position-reconciliation.mdskills/portfolio-manager/references/rebalancing-strategies.mdskills/portfolio-manager/references/risk-profile-questionnaire.mdskills/portfolio-manager/references/target-allocations.md