Skip to main content
Glama
Financial Analysis MCP Server

Financial Analysis MCP Server

by NARAVINDR321

MCP Server for Financial Analysis

Introduction

This project is a Model Context Protocol (MCP) server designed to enable LLMs (such as Claude, Cursor, or GPT-based agents) to retrieve, analyze, and visualize stock prices and financial report data. It provides a set of robust tools for quantitative trading research, investment analysis, and financial education.

Related MCP server: MCP Yahoo Finance

Usage Scenarios

  • LLM-driven trading analysis: Let LLMs fetch and analyze stock data, financial statements, and technical indicators to generate trading insights.

  • Financial metric calculation: Compute key ratios and metrics from income statements, balance sheets, and cash flow tables.

  • Visualization: Generate price charts, financial metric trends, and highlight trading opportunities.

  • Automated research: Integrate with LLMs to answer questions like "What is the ROE of AAPL?", "Show me the last 6 months of MSFT price data.", or "Plot buy/sell signals for TSLA."

Features

  • Retrieve real-time and historical stock prices (single or multiple tickers)

  • Extract and analyze financial statements (income, balance sheet, cash flow)

  • Calculate key financial and technical metrics (PE, ROE, moving averages, etc.)

  • Visualize price data, metrics, and trading signals

  • LLM-friendly, JSON-serializable outputs

Installation

  1. Clone the repository

    git clone https://github.com/Nishaant-Soni/MCP_Server_for_Financial_Analysis.git
    cd <your-repo-folder>
  2. Set up a Python virtual environment

    python3 -m venv .venv
    source .venv/bin/activate
  3. Install dependencies

    uv sync

How to Run

  1. Configure your LLM client (Claude, Cursor, etc.) to connect to the MCP server and call the available tools.

    Go to Claude settings Select Developer --> Edit Config Add new MCP server. In the JSON File, add

    {"mcpServers": 
         {"trader-mcp": {
                "command": "uv",
                "args": [
                "--directory",
                "/directory/to/your/mcp",
                "run",
                "main.py"
            ]
            }
         }
    }  

'trader-mcp' should now be listed in your Claude tools.

  1. Start talking with your trading assistant!

Quries like:

Compare the stock prices of Nvidia and AMD in the past month.

How's Tesla stock like in the past 3 months?

Plot the trading opportunities of Microsoft in the past 3 months.

Available Tools

13 tools
mcp_calculate_financial_metricsC
Calculates financial metrics from the provided data. The metrics are:
- gross_margin (need retrieve income_statement)
- operating_margin (need retrieve income_statement)
- net_profit_margin (need retrieve income_statement)
- ebitda (need retrieve income_statement)
- debt_to_equity (need retrieve balance_sheet)
- current_ratio (need retrieve balance_sheet)
- quick_ratio (need retrieve balance_sheet)
- book_value_per_share (need retrieve balance_sheet)
- free_cash_flow (need retrieve cash_flow)
- cash_flow_margin (need retrieve cash_flow)
- roe (need retrieve income_statement and balance_sheet)
- roa (need retrieve income_statement and balance_sheet)
- pe_ratio (need retrieve income_statement and market)
- pb_ratio (need retrieve income_statement and market)
- dividend_yield (need retrieve income_statement and market)
Args:
    financial_data: Dict with financial data.
    indicator: str, one of the supported metric names
    window: int, window size for the indicator
Returns:
    Dict with financial metrics name as key and value as value. e.g. {'gross_margin': 0.5}

Inputs: financial_data (required), indicator (required).

mcp_calculate_growth_ratesB
Calculates growth rates for a time series (e.g., revenue, earnings).
Args:
    series: List of numbers ordered oldest to newest.
Returns:
    Dict with annualized growth rate and list of period-over-period growth rates.

Inputs: series (required).

mcp_calculate_technical_indicatorsC
Calculates technical indicators (SMA, EMA, RSI, MACD, volatility) on stockprice data.
Args:
    price_data: List of closing prices ordered oldest to newest.
    indicator: 'sma', 'ema', 'rsi', 'macd', 'volatility'
    window: Window size for the indicator.
Returns:
    Dict with indicator values.

Inputs: indicator (required), price_data (required), window.

mcp_plot_comparison_chartB
Plots a comparison chart for multiple tickers or financial metrics over time.
Args:
    dates: List of date strings.
    series: Dict where keys are labels and values are lists of values for each date.
    title: Chart title.
    filename: Optional filename to save the plot.
Returns:
    Dict with 'file_path' and 'base64' of the image.

Inputs: dates (required), series (required), filename, title.

mcp_plot_financial_metricC
Plots a financial metric over time.
Args:
    dates: List of date strings.
    values: List of metric values.
    metric_name: Name of the metric.
    title: Chart title.
    filename: Optional filename to save the plot.
Returns:
    Dict with 'file_path' and 'base64' of the image.

Inputs: dates (required), values (required), filename, metric_name, +1 more.

mcp_plot_price_chartA
Generates a price chart (line or candlestick) from OHLCV data. 
Args:
    prices: List of dicts with keys 'date', 'open', 'high', 'low', 'close', 'volume'.
    chart_type: 'line' or 'candlestick'.
    title: Chart title.
    filename: Optional filename to save the plot.
Returns:
    Dict with 'file_path' and 'base64' of the image.

Inputs: prices (required), chart_type, filename, title.

mcp_plot_trading_opportunitiesB
Plots price data with trading signals/opportunities.
Args:
    prices: List of dicts with keys 'date', 'open', 'high', 'low', 'close', 'volume'.
    short_window: Short window for the short moving average. Default is 9.
    long_window: Long window for the long moving average. Default is 21.
    title: Chart title.
Returns:    
    Dict with 'file_path' and 'base64' of the image.

Inputs: prices (required), long_window, short_window, title.

retrieve_current_priceB
Retrieves the current price for the given ticker.
Args:
    ticker: The ticker symbol of the stock to retrieve the current price for.
Returns:
    A JSON-serializable dict with the current price and related info.

Inputs: ticker (required).

retrieve_dividendsC

Retrieves dividends for the given ticker.

Inputs: ticker (required).

retrieve_financial_statementsB
Retrieves the annual income statements, balance sheet, or cash flow for the given ticker. 
Args:
    ticker: The ticker symbol of the stock to retrieve the statements for.
    indicator: The type of financial statement to retrieve. e.g. "income_statement", "balance_sheet", "cash_flow"
Returns:
    A JSON-serializable dict with income statements, balance sheet, or cash flow.

Inputs: indicator (required), ticker (required).

retrieve_splitsC

Retrieves splits for the given ticker.

Inputs: ticker (required).

retrieve_stock_dataA
Retrieves stock data for a list of tickers using yfinance.
Args:
    ticker_list: List of ticker symbols (e.g., ['AAPL', 'MSFT', 'GOOGL'])
    start_date: Start date of the data (e.g., '2024-01-01')
    end_date: End date of the data (e.g., '2024-12-31')
    interval: Data interval (e.g., '1d', '1h', '5m', etc.)
Returns:
    Dict mapping ticker to its historical data (as a list of dicts).

Inputs: end_date (required), start_date (required), ticker_list (required), interval.

retrieve_ticker_infoC
Retrieves information about the given ticker.
Args:
    ticker: The ticker symbol of the stock to retrieve the information for.
Returns:
    A JSON-serializable dict with information about the given ticker.

Inputs: ticker (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between the three plotting tools (mcp_plot_comparison_chart, mcp_plot_financial_metric, mcp_plot_price_chart) which could cause confusion about when to use each. The retrieve tools are clearly differentiated by the type of data they fetch.

    Naming Consistency3/5

    The naming is mixed: most tools use a verb_noun pattern (e.g., retrieve_current_price, calculate_financial_metrics), but the mcp_ prefix is inconsistently applied (some have it, some don't), and tools like retrieve_splits lack clear verb consistency. This creates a somewhat readable but inconsistent convention.

    Tool Count5/5

    With 13 tools, the count is well-scoped for a financial analysis server, covering data retrieval, calculations, and visualization without being overwhelming. Each tool serves a clear purpose in the domain.

    Completeness4/5

    The toolset provides good coverage for financial analysis, including data retrieval, metric calculations, and plotting. Minor gaps exist, such as no explicit tools for updating or deleting data, but these are not critical for the analysis-focused purpose, and agents can work around them.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Provides comprehensive stock screening capabilities through Yahoo Finance. Enables LLMs to screen stocks based on technical, fundamental, and options criteria, with support for watchlist management and result storage.
      4
      49
      MIT
    • F
      license
      B
      quality
      D
      maintenance
      Provides tools to get financial data (stock prices, company information) and generate financial visualizations through the Model Context Protocol.
      10
      12
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time financial data from Yahoo Finance to Large Language Models through the Model Context Protocol, enabling AI models to access stock prices, historical data, and company information.
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables trading and market analysis through Tiger Brokers API integration. Provides real-time market data, portfolio management, order execution, and technical analysis tools with a comprehensive web dashboard for monitoring.
      9
      -