Skip to main content
Glama
Agentic-Investor

Agentic-Investor

by jon-fox

Agentic-Investor: A Financial Analysis MCP Server

Overview

The Agentic-Investor is a Model Context Protocol (MCP) server that provides comprehensive financial insights and analysis to Large Language Models. It leverages real-time market data, fundamental and technical analysis to deliver:

  • Market Movers: Top gainers, losers, and most active stocks with support for different market sessions

  • Ticker Analysis: Company overview, news, metrics, analyst recommendations, and upgrades/downgrades

  • Options Data: Filtered options chains with customizable parameters

  • Historical Data: Price trends and earnings history

  • Financial Statements: Income, balance sheet, and cash flow statements

  • Ownership Analysis: Institutional holders and insider trading activity

  • Earnings Calendar: Upcoming earnings announcements with date filtering

  • Market Sentiment: CNN Fear & Greed Index, Crypto Fear & Greed Index, and Google Trends sentiment analysis

  • Technical Analysis: SMA, EMA, RSI, MACD, BBANDS indicators (optional)

  • Intraday Data: 15-minute historical stock bars via Alpaca API (optional)

The server integrates with yfinance for market data and automatically optimizes data volume for better performance.

Related MCP server: StockMCP

Architecture & Performance

Robust Caching & Error Handling Strategy:

  1. yfinance[nospam] → Built-in smart caching + rate limiting for Yahoo Finance API

  2. hishel → HTTP response caching for external APIs (CNN, crypto, earnings data)

  3. tenacity → Retry logic with exponential backoff for transient failures

This multi-layered approach ensures reliable data delivery while respecting API rate limits and minimizing redundant requests.

Prerequisites

  • Python: 3.12 or higher

  • Package Manager: uv. Install if needed:

    curl -LsSf https://astral.sh/uv/install.sh | sh

Optional Dependencies

Installation

Quick Start

# Core features only
uvx agentic-investor

# With technical indicators (requires TA-Lib)
uvx "agentic-investor[ta]"

# With Alpaca intraday data (requires Alpaca API keys)
uvx "agentic-investor[alpaca]"

# With all optional features
uvx "agentic-investor[ta,alpaca]"

Tools

Market Data

  • get_market_movers(category="most-active", count=25, market_session="regular") - Market movers data including top gainers, losers, or most active stocks. Supports different market sessions (regular/pre-market/after-hours) for most-active category. Returns up to 100 stocks with cleaned percentage changes, volume, and market cap data

  • get_ticker_data(ticker, max_news=5, max_recommendations=5, max_upgrades=5) - Comprehensive ticker report with essential field filtering and configurable limits for news, analyst recommendations, and upgrades/downgrades

  • get_options(ticker_symbol, num_options=10, start_date=None, end_date=None, strike_lower=None, strike_upper=None, option_type=None) - Options data with advanced filtering by date range (YYYY-MM-DD), strike price bounds, and option type (C=calls, P=puts)

  • get_price_history(ticker, period="1mo") - Historical OHLCV data with intelligent interval selection: daily intervals for periods ≤1y, monthly intervals for periods ≥2y to optimize data volume

  • get_financial_statements(ticker, statement_types=["income"], frequency="quarterly", max_periods=8) - Financial statements with parallel fetching support. Returns dict with statement type as key

  • get_institutional_holders(ticker, top_n=20) - Major institutional and mutual fund holders data

  • get_earnings_history(ticker, max_entries=8) - Historical earnings data with configurable entry limits

  • get_insider_trades(ticker, max_trades=20) - Recent insider trading activity with configurable trade limits

  • get_nasdaq_earnings_calendar(date=None, limit=100) - Upcoming earnings announcements using Nasdaq API (YYYY-MM-DD format, defaults to today).

  • fetch_intraday_data(stock, window=200) - Fetch 15-minute historical stock bars using Alpaca API. Returns CSV string with timestamp and close price data in EST timezone. Requires agentic-investor[alpaca] installation and ALPACA_API_KEY/ALPACA_API_SECRET environment variables.

Market Sentiment

  • get_cnn_fear_greed_index(indicators=None) - CNN Fear & Greed Index with selective indicator filtering. Available indicators: fear_and_greed, fear_and_greed_historical, put_call_options, market_volatility_vix, market_volatility_vix_50, junk_bond_demand, safe_haven_demand

  • get_crypto_fear_greed_index() - Current Crypto Fear & Greed Index with value, classification, and timestamp

  • get_google_trends(keywords, period_days=7) - Google Trends relative search interest for market-related keywords. Requires a list of keywords to track (e.g., ["stock market crash", "bull market", "recession", "inflation"]). Returns relative search interest scores that can be used as sentiment indicators.

Technical Analysis

  • calculate_technical_indicator(ticker, indicator, period="1y", timeperiod=14, fastperiod=12, slowperiod=26, signalperiod=9, nbdev=2, matype=0, num_results=100) - Calculate technical indicators (SMA, EMA, RSI, MACD, BBANDS) with configurable parameters and result limiting. Returns dictionary with price_data and indicator_data as CSV strings. matype values: 0=SMA, 1=EMA, 2=WMA, 3=DEMA, 4=TEMA, 5=TRIMA, 6=KAMA, 7=MAMA, 8=T3. Requires TA-Lib library.

Usage with MCP Clients locally

Install mcp-remote

https://www.npmjs.com/package/mcp-remote

npm i mcp-remote

Start the server and add to your claude_desktop_config.json:

uv run python -m agentic_investor.server
{
  "mcpServers": {
    "Agentic-Investor": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://0.0.0.0:8000/mcp",
        "--allow-http"
      ]
    }
  }
}

Local Testing

For local development and testing, use the included chat.py script:

# Install dev dependencies
uv sync --group dev

# Set up your API key
export OPENAI_API_KEY="your-api-key"  # or ANTHROPIC_API_KEY, GEMINI_API_KEY, etc.

# Optional: Set custom model (defaults to openai:gpt-5-mini)
export MODEL_IDENTIFIER="your-preferred-model"

# Run the chat interface
python chat.py

For available model providers and identifiers, see the pydantic-ai documentation.

Debugging

MCP Inspector

npx @modelcontextprotocol/inspector uvx agentic-investor

Debug Logging

Enable detailed debug logging for development and troubleshooting:

# Enable debug logging
export DEBUG_LOGGING=true

# Run with debug logging
DEBUG_LOGGING=true python -m agentic_investor.server

See DEBUG_LOGGING.md for more details on what gets logged and how to use it.

License

MIT License. See LICENSE file for details.

Available Tools

14 tools
calculate_technical_indicatorA

Calculate professional technical analysis indicators using TA-Lib including: Simple Moving Average (SMA), Exponential Moving Average (EMA), Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD with signal line and histogram), and Bollinger Bands (upper/middle/lower bands with standard deviation). Use this when asked about technical analysis, chart indicators, overbought/oversold conditions (RSI), trend identification (moving averages), momentum signals (MACD), volatility analysis (Bollinger Bands), support/resistance levels, crossover signals, or trading indicators. Supports customizable time periods (5-200 periods), lookback windows (1 month to 5 years), and moving average types. Returns up to 1000 data points. Example: "Calculate RSI for AAPL" or "Show me 50-day and 200-day moving averages for SPY".

Inputs: input_data (required).

fetch_intraday_dataA

Fetch high-resolution 15-minute interval stock price data (bars) using Alpaca market data API. Returns timestamp and close price for each 15-minute period in EST timezone. Supports up to 1000 bars (roughly 10 trading days of intraday data). Use this when asked about intraday price action, today's trading pattern, minute-by-minute movement, recent price fluctuations, current session behavior, or short-term price trends. Perfect for day trading analysis, identifying intraday support/resistance, or examining recent volatility. Example: "Show me TSLA's price movement today" or "What's the intraday chart for AAPL?".

Inputs: input_data (required).

get_cnn_fear_greed_indexA

Get CNN's Fear & Greed Index showing overall stock market sentiment (0-100 scale) with detailed breakdowns of seven key indicators: VIX volatility levels, put/call option ratios, junk bond demand vs investment grade, safe haven demand (bonds vs stocks), market momentum, stock price strength, and market breadth. Use this when asked about market sentiment, investor psychology, risk appetite, bull/bear market conditions, whether markets are overbought/oversold, or overall market health. Scale: 0=extreme fear, 100=extreme greed.

Inputs: input_data (required).

get_crypto_fear_greed_indexB

Get the current Crypto Fear & Greed Index (0-100 scale) from Alternative.me, indicating cryptocurrency market sentiment where 0 represents extreme fear and 100 represents extreme greed. Use this when asked about crypto market sentiment, investor psychology in digital assets, Bitcoin market mood, altcoin risk appetite, or whether it's a good time to buy/sell cryptocurrencies. Includes historical data and trend analysis.

Inputs: input_data (required).

get_earnings_historyA

Get historical quarterly earnings results including EPS estimates (analyst consensus), actual reported EPS, earnings surprise amounts and percentages, and earnings announcement dates. Returns up to 50 historical earnings reports. Use this when asked about earnings beats/misses, earnings surprise history, quarterly results trends, how often a company beats estimates, earnings consistency, EPS growth trajectory, or past earnings performance. Helps identify companies that consistently beat/miss expectations. Example: "Has NVDA been beating earnings?" or "Show me TSLA's earnings surprise history".

Inputs: input_data (required).

get_financial_statementsA

Get detailed financial statements including income statements (revenue, expenses, net income, EPS), balance sheets (assets, liabilities, equity, cash, debt), and cash flow statements (operating cash flow, investing activities, financing activities, free cash flow). Supports both quarterly and annual reporting frequencies with up to 20 historical periods. Use this when asked about company financials, revenue trends, profitability, cash position, debt levels, financial health, accounting metrics, earnings quality, or fundamental analysis. Essential for DCF models, financial modeling, and deep-dive company research. Returns data in structured format with all line items. Example: "Show me AAPL's last 8 quarters of income statements" or "Get TSLA's annual balance sheets".

Inputs: input_data (required).

get_insider_tradesA

Get recent insider trading activity including executive and director transactions: stock purchases, sales, option exercises, and other reportable transactions. Returns up to 100 recent trades with insider name, title, transaction type, share count, price per share, total value, and filing date. Use this when asked about insider buying/selling, whether executives are confident, if insiders are dumping stock, insider sentiment, Form 4 filings, C-suite transactions, or director activity. Heavy insider buying can signal confidence while selling may indicate concerns. Example: "Are AAPL insiders buying?" or "Show me recent insider sales at TSLA".

Inputs: input_data (required).

get_institutional_holdersA

Get major institutional shareholders and mutual fund holders including their position sizes, share counts, percentage of total shares owned, and position values. Returns top 20-100 largest holders. Use this when asked about institutional ownership, who owns the most shares, major shareholders, hedge fund positions, mutual fund holdings, institutional support, ownership concentration, or smart money positioning. High institutional ownership often indicates confidence while institutions selling can signal concerns. Example: "Who are the biggest holders of NVDA?" or "Show me institutional ownership of TSLA".

Inputs: input_data (required).

get_market_moversA

Identify top gaining stocks (biggest winners), biggest losing stocks (worst performers), and most actively traded securities by volume in real-time or recent trading sessions. Use this when asked about "what's hot", "what's moving", market leaders, volatile stocks, today's biggest movers, stocks making news, pre-market activity, or after-hours trading action. Supports filtering by market session: regular hours, pre-market, and after-hours. Returns up to 100 stocks with price, volume, and percentage change data.

Inputs: input_data (required).

get_nasdaq_earnings_calendarA

Get upcoming earnings announcements for a specific date showing company names, ticker symbols, earnings dates, EPS estimates (high/low/average), revenue estimates, and surprise history. Returns up to 500 companies reporting on the specified date. Use this when asked about earnings calendar, who reports today/tomorrow, upcoming earnings, what companies announce this week, earnings season schedule, or when specific companies report. Defaults to today's date if not specified. Essential for planning trades around earnings events and tracking market-moving announcements. Example: "Who reports earnings today?" or "Show me earnings calendar for next Friday".

Inputs: input_data (required).

get_optionsA

Retrieve options chain data including strike prices, expiration dates, bid/ask spreads, implied volatility, open interest, trading volume, and Greeks (delta, gamma, theta, vega) for both call and put options. Use this when asked about options strategies, checking option premiums, evaluating covered calls, analyzing protective puts, finding strike prices, assessing derivatives positions, volatility trading opportunities, or options expiring soon. Supports flexible filtering by strike price range, expiration date window (start/end dates), and option type (calls only, puts only, or both). Returns up to 1000 contracts per query. Example usage: AAPL calls expiring in 30 days, TSLA puts near current price.

Inputs: input_data (required).

get_price_historyA

Get historical OHLCV (Open, High, Low, Close, Volume) stock price data with smart interval selection based on time period. Returns daily data for longer periods and intraday data for shorter periods. Use this when asked about price history, past performance, stock charts, historical trends, price patterns over time, year-to-date performance, or comparing current prices to historical levels. Supports periods: 1 day, 5 days, 1 month, 3 months, 6 months, 1 year, 2 years, 5 years, 10 years, year-to-date, and maximum available history. Perfect for backtesting, technical analysis, and historical comparisons. Works with any ticker: AAPL, TSLA, SPY, QQQ, etc.

Inputs: input_data (required).

get_ticker_dataA

Get comprehensive stock analysis including current price, daily volume, market capitalization, P/E ratios (trailing and forward), 52-week high/low range, beta, profit margins, revenue/earnings growth, book value, debt levels, and ROE/ROA metrics. Also includes up to 50 recent news headlines with sources and URLs, latest analyst recommendations (strong buy/buy/hold/sell/strong sell distribution), recent upgrades and downgrades from major firms, and upcoming earnings calendar dates with EPS estimates. Use this when asked about stock performance, company valuation, fundamentals, Wall Street sentiment, analyst opinions, recent company news, or financial health. Supports any public company ticker: AAPL, TSLA, MSFT, GOOGL, AMZN, NVDA, etc.

Inputs: input_data (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of investing (technical analysis, intraday data, sentiment indices, fundamentals, etc.). While get_price_history and fetch_intraday_data both provide price data, their granularities are clearly different (daily vs 15-min), and get_ticker_data combines current price with fundamentals, avoiding confusion.

    Naming Consistency4/5

    Most tools follow a 'get_noun' pattern (e.g., get_earnings_history, get_price_history), with exceptions: calculate_technical_indicator and fetch_intraday_data. This slight inconsistency is minor and still clear.

    Tool Count5/5

    14 tools is well-scoped for an investing research server, covering technical, fundamental, sentiment, and market data without being overwhelming.

    Completeness4/5

    The tools provide comprehensive coverage for stock and crypto research, including history, fundamentals, options, and sentiment. Minor gaps exist (e.g., no multi-ticker comparison or direct execution), but core workflows are supported.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides comprehensive financial market data and news through the Finnhub API. Enables real-time stock quotes, company profiles, financial metrics, analyst recommendations, and market news access.
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time stock market data and financial analysis through Yahoo Finance integration. Enables users to get quotes, historical prices, fundamentals, dividends, analyst forecasts, and growth projections for any stock symbol.
      4
      -
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides real-time financial data from Yahoo Finance, enabling stock price lookups, historical data analysis, company information retrieval, and multi-stock comparisons through natural language queries.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides comprehensive financial data from Yahoo Finance, enabling retrieval of stock prices, company information, financial statements, options data, analyst recommendations, and market news through natural language queries.
      MIT