A Model Context Protocol (MCP) server that provides real-time financial data to Large Language Models through Yahoo Finance.
This project creates an MCP server that allows AI models like Claude to access real-time stock and financial data through the Yahoo Finance API. The server implements the Model Context Protocol standard, enabling seamless integration with various MCP clients including Claude Desktop, Cursor, Winds AI, and others.
Clone this repository:
git clone https://github.com/dino65-dev/Finance_mcp-server.git
Create a virtual environment:
python -m venv venv
On Windows: venv\Scripts\activate
Create a virtual environment (recommended) for faster creation:
pip install uv
uv venv
On Windows: venv\Scripts\activate
pip install -r requirements.txt
Start the server by running:
python yfinance_mcp_server.py
The server will run as a stdin/stdout process that communicates via the MCP protocol.
{
"mcpServers": {
"yfinance": {
"command": "python",
"args": [
"/absolute/path/to/yfinance_mcp_server.py"
]
}
}
}
{
"yfinance": {
"command": "python",
"args": [
"/absolute/path/to/yfinance_mcp_server.py"
]
}
}
The server provides the following tools:
get_stock_price
: Get current stock prices
Example: Get the current price of Apple stock
get_historical_data
: Retrieve historical price data
Example: Get the stock history for TSLA over the past 3 months
get_stock_metric
: Access specific financial metrics
Example: What is Amazon's market capitalization?
compare_stocks
: Compare multiple stocks by metrics
Example: Compare the P/E ratios of Google, Microsoft, and Apple
search_stocks
: Find stocks by name or keyword
Example: Find stocks related to artificial intelligence
Access stock information directly through resource URIs:
finance://SYMBOL/info
- Get basic information about a stockThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
{
"mcpServers": {
"yfinance": {
"env": {},
"args": [
"/absolute/path/to/yfinance_mcp_server.py"
],
"command": "python"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.