Mcp Yfinance

Mcp Yfinance

A MCP stdio server shim around common yFinance calls.

nicholasf

Research & Data
Visit Server

README

A simple wrapper around the classic yFinance that operates as an MCP tool.

Note - this tool passes back a Pandas Dataframe to the MCP host, so it expects that to be understood by the host. It was written using Goose as the MCP Host and Claude Sonnet 3.5 as the integrated LLM.

I've so far used it to fetch daily stock prices for individual instruments. When I've asked the LLM to perform some more advanced aggregations I've quickly hit token limits from Anthropic.

This tool is meant as a demo, starting point or a proof of concept.

Install

Register it as an extension in your MCP host.

On goose:


☁  mcp-yfinance [main] ⚡  goose configure    

This will update your existing config file
  if you prefer, you can edit it directly at /home/nicholasf/.config/goose/config.yaml

┌   goose-configure 
│
◇  What would you like to configure?
│  Add Extension 
│
◇  What type of extension would you like to add?
│  Command-line Extension 
│
◇  What would you like to call this extension?
│  yf
│
◇  What command should be run?
│  uv run server.py
│
◇  Please set the timeout for this tool (in secs):
│  5
│
◇  Would you like to add environment variables?
│  No 
│
└  Added yf extension

Then invoke it:

☁  mcp-yfinance [main] ⚡  goose session -n yf
starting session | provider: anthropic model: claude-3-5-sonnet-latest
    logging to /home/nicholasf/.local/share/goose/sessions/yf.jsonl
    working directory: /home/nicholasf/code/github/nicholasf/mcp-yfinance

Goose is running! Enter your instructions, or try asking what goose can do.

( O)> yf__history AAPL
I'll try getting Apple's stock history now.
─── history | yf ──────────────────────────
symbol: AAPL



Great! The command is now working correctly. The data shows Apple's stock performance over the last month (from February 19, 2025 to March 18, 2025). Here are some key observations:

1. The stock has shown a general downward trend over this period
2. Starting price (Feb 19): Around $244.66
3. Latest price (March 18): Around $214.16
4. Highest point: Around $250.00 (Feb 25)
5. Notable decline: A sharp drop occurred around March 11, falling from ~$235 to ~$223

The data includes Open, High, Low, Close prices, Volume, Dividends, and Stock Splits (though no dividends or splits occurred during this period).

Would you like to:
1. See the data for a different time period?
2. Look at a different stock symbol?
3. Get more detailed analysis of specific aspects of this data?

Just let me know what information would be most helpful!


Running tests

pytest -v

Recommended Servers

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.

Featured
TypeScript
MCP PubMed Search

MCP PubMed Search

Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.

Featured
Python
dbt Semantic Layer MCP Server

dbt Semantic Layer MCP Server

A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.

Featured
TypeScript
mixpanel

mixpanel

Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Featured
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python
Nefino MCP Server

Nefino MCP Server

Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.

Official
Python
Vectorize

Vectorize

Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.

Official
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.

Local
Python
kb-mcp-server

kb-mcp-server

An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded

Local
Python
Research MCP Server

Research MCP Server

The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.

Local
Python