Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables financial analysis by fetching real market data from Yahoo Finance, computing moving averages, returns, and volatility, and generating price charts.

README.md

MCP Financial Analyst

A local MCP (Model Context Protocol) server that acts as a financial analyst: it fetches real market data from Yahoo Finance, runs lightweight analysis (moving averages, returns, volatility), and generates price charts. No hallucinated numbers—all data comes from yfinance.

---

Quick start (how to use the app)

1. Create a venv and install dependencies

Use a virtual environment so you avoid conda/base Python and Homebrew’s “externally managed” pip. Use Python 3.12+ (MCP currently supports 3.10–3.13; 3.14 support may lag).

cd MCP_StockTool
python3.12 -m venv .venv  # or: python -m venv .venv
.venv/bin/pip install -r requirements.txt

If you don't have Python 3.12, install it with your package manager (e.g. Homebrew on macOS), then run the two commands above with that Python.

2. Add the MCP server to MCP Client

Link this MCP Server to an existing MCP Client + LLM platforms like GitHub Copilot, Cursor or Claude Desktop to use: ** Repace /absolute/path/to with location of this server on your local computer.

{
  "mcpServers": {
    "financial-analyst": {
      "command": "python",
      "args": ["server.py"],
      "cwd": "/absolute/path/to/MCP_StockTool"
    }
  }
}
  • Save. Restart Cursor (or reload the window) so it picks up the server.

3. Use it in chat

In the Platform / IDE of your choice, open the chat, ask things like:

  • "Fetch the last 3 months of daily data for AAPL."
  • "Analyze MSFT from 2026-01-01 to 2026-02-01 and show me the chart and key metrics."
  • "What’s the 30-day moving average and return for GOOGL over the last 6 months?"

The AI will call the financial tools, get real data, and answer with numbers and (when you use analyze) a chart path. Charts are saved under MCP_StockTool/charts/.

---

  1. fetch_market_data – Get OHLCV data for a ticker over a date range.
  2. analyze_and_chart – Get the same data, compute 7-day/30-day MAs, return %, and volatility, and save a price chart.

Requirements

  • Python 3.10+
  • Dependencies: mcp, yfinance, pandas, matplotlib

Install

From the project root:

cd MCP_StockTool
pip install -r requirements.txt

Or with uv:

uv pip install -r requirements.txt

Run the server (stdio)

For use by an MCP client (Cursor, Claude Desktop, etc.):

python server.py

The server uses stdio transport: the client spawns this process and talks over stdin/stdout. Do not run it interactively; the client will start it.

MCP Client Integration

Add this MCP server in Github Copilot/Cursor/Claude Desktop so the AI can use the financial tools.

  1. Add a server entry like this (adjust path if your project lives elsewhere):
{
  "mcpServers": {
    "financial-analyst": {
      "command": "python",
      "args": ["server.py"],
      "cwd": "/absolute/path/to/MCP_StockTool",
      "env": {}
    }
  }
}

If you use a virtualenv or uv:

{
  "mcpServers": {
    "financial-analyst": {
      "command": "/path/to/venv/bin/python",
      "args": ["server.py"],
      "cwd": "/absolute/path/to/MCP_StockTool"
    }
  }
}

Or with uv:

{
  "mcpServers": {
    "financial-analyst": {
      "command": "uv",
      "args": ["run", "python", "server.py"],
      "cwd": "/absolute/path/to/MCP_StockTool"
    }
  }
}

Restart App (or reload MCP) so it picks up the server. The AI will then see fetch_market_data and analyze_and_chart as available tools.

Tools

fetch_market_data

  • ticker (str): Symbol, e.g. AAPL, MSFT.
  • start_date (str): Start date YYYY-MM-DD.
  • end_date (str): End date YYYY-MM-DD.
  • interval (str): "daily" | "weekly" | "monthly" (default "daily").

Returns a JSON object with ticker, start_date, end_date, interval, row_count, and data (list of OHLCV rows). On error, returns an error field and empty or partial data.

analyze_and_chart

  • ticker (str): Symbol, e.g. AAPL, MSFT.
  • start_date (str): Start date YYYY-MM-DD.
  • end_date (str): End date YYYY-MM-DD.
  • interval (str): "daily" | "weekly" | "monthly" (default "daily").
  • output_path (str, optional): Path for the chart image. If omitted, saves to charts/<ticker>_<timestamp>.png.

Returns a JSON object with:

  • chart_path: Absolute path to the saved chart.
  • metrics: ma_7d, ma_30d (when enough data), return_pct, volatility_annual_pct, data_points, first_close, last_close.
  • ticker, start_date, end_date, interval.

Volatility is the annualized standard deviation of daily (or period) returns in percent.

Example prompts (for the AI using this server)

  • “Fetch the last 3 months of daily data for AAPL.”
  • “Analyze MSFT from 2024-01-01 to 2024-12-01 and show me the chart and key metrics.”
  • “What’s the 30-day moving average and return for GOOGL over the last 6 months?”

The AI will call the MCP tools with the right parameters and report back using the real data and chart path returned by the server.

Project layout

MCP_StockTool/
├── pyproject.toml
├── README.md
├── server.py              # MCP entrypoint (stdio)
├── tools/
│   ├── __init__.py
│   ├── market_data.py     # fetch_market_data implementation
│   └── chart_analyzer.py  # analyze_and_chart implementation
└── charts/                # created at runtime for saved images

License

Use and modify as you like. Data is from Yahoo Finance via yfinance.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.