what is Mcp Yfinance?
Mcp Yfinance is a simple wrapper around the classic yFinance library that operates as an MCP tool, allowing users to easily access financial data through a command-line interface.
how to use Mcp Yfinance?
To use Mcp Yfinance, register it as an extension in your MCP host, configure it using the provided commands, and then invoke it to retrieve financial data such as stock history.
key features of Mcp Yfinance?
- Easy integration with MCP hosts
- Command-line interface for accessing financial data
- Ability to retrieve historical stock data and perform analysis
use cases of Mcp Yfinance?
- Analyzing stock performance over specific time periods.
- Retrieving historical data for various stock symbols.
- Performing detailed financial analysis based on stock data.
FAQ from Mcp Yfinance?
- What data can I retrieve using Mcp Yfinance?
You can retrieve historical stock prices, including Open, High, Low, Close prices, Volume, Dividends, and Stock Splits.
- Is Mcp Yfinance easy to set up?
Yes! It can be easily registered as an extension in your MCP host with simple configuration commands.
- Can I analyze multiple stocks at once?
Yes! You can invoke commands for different stock symbols to analyze their performance.
A simple wrapper around the classic yFinance that operates as an MCP tool.
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!