- Explore MCP Servers
- yahoo-finance-mcp
Yahoo Finance Mcp
What is Yahoo Finance Mcp
Yahoo-finance-mcp is a Multi-Channel Processing (MCP) tool designed to fetch stock data from Yahoo Finance and send it to a trading simulator. It utilizes Puppeteer for web scraping to gather real-time stock information.
Use cases
Use cases include integrating stock data into trading simulators, developing financial analysis tools, and automating stock data retrieval for research purposes.
How to use
To use yahoo-finance-mcp, clone the repository, install dependencies, and configure the .env file with the trading simulator API endpoint. You can run the tool with a default stock symbol or specify a different one using command line arguments.
Key features
Key features include fetching real-time stock data, extracting financial metrics like price and volume, optional historical data retrieval, sending data to a trading simulator API, configurable settings via environment variables, and detailed logging for monitoring.
Where to use
Yahoo-finance-mcp can be used in financial applications, trading simulators, and any project that requires real-time stock data for analysis or trading strategies.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Yahoo Finance Mcp
Yahoo-finance-mcp is a Multi-Channel Processing (MCP) tool designed to fetch stock data from Yahoo Finance and send it to a trading simulator. It utilizes Puppeteer for web scraping to gather real-time stock information.
Use cases
Use cases include integrating stock data into trading simulators, developing financial analysis tools, and automating stock data retrieval for research purposes.
How to use
To use yahoo-finance-mcp, clone the repository, install dependencies, and configure the .env file with the trading simulator API endpoint. You can run the tool with a default stock symbol or specify a different one using command line arguments.
Key features
Key features include fetching real-time stock data, extracting financial metrics like price and volume, optional historical data retrieval, sending data to a trading simulator API, configurable settings via environment variables, and detailed logging for monitoring.
Where to use
Yahoo-finance-mcp can be used in financial applications, trading simulators, and any project that requires real-time stock data for analysis or trading strategies.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Yahoo Finance MCP Tool
This is a Multi-Channel Processing (MCP) tool that fetches stock data from Yahoo Finance and sends it to a trading simulator website. The tool uses Puppeteer to scrape stock data from Yahoo Finance and then sends the data to a specified API endpoint.
Features
- Fetches real-time stock data from Yahoo Finance
- Extracts key financial metrics (price, volume, market cap, etc.)
- Optionally retrieves historical data
- Sends data to a trading simulator API
- Configurable via environment variables or config file
- Detailed logging for monitoring and debugging
Installation
-
Clone this repository:
git clone https://github.com/Imago-Dei2024/yahoo-finance-mcp.git cd yahoo-finance-mcp -
Install dependencies:
npm install -
Create a
.envfile based on the provided.env.example:cp .env.example .env -
Edit the
.envfile to configure your settings, especially the trading simulator API endpoint.
Usage
Basic Usage
Run the tool with a default stock symbol (AAPL if not configured otherwise):
npm start
Specify a Stock Symbol
npm start -- MSFT
or
node index.js MSFT
Programmatic Usage
You can also use this tool programmatically in your own code:
const { main } = require('yahoo-finance-mcp');
// Run the MCP tool
main().catch(console.error);
Configuration
You can configure the tool using environment variables (via .env file) or by editing the config.js file directly.
Key Configuration Options
defaultSymbol: The default stock symbol to use if none is providedtradingSimulatorEndpoint: The API endpoint where the stock data will be sentyahooFinanceBaseUrl: The base URL for Yahoo FinancedataPoints: The specific data points to extract from Yahoo Financebrowser: Settings for the Puppeteer browser instanceretry: Settings for retry logic
How It Works
- The tool launches a headless browser using Puppeteer
- It navigates to the Yahoo Finance page for the specified stock symbol
- It extracts the relevant stock data using DOM selectors
- It sends the extracted data to the configured trading simulator API endpoint
- It logs the results and closes the browser
Customizing Data Extraction
You can customize which data points are extracted by modifying the dataPoints array in the config.js file. The tool will attempt to extract all specified data points from the Yahoo Finance page.
Error Handling
The tool includes robust error handling and will retry failed operations according to the configured retry settings. All errors are logged to the console and to log files.
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










