yfinance
Unofficial MCP server for Yahoo Finance stock data.
claude mcp add --transport stdio onori-yfinance-mcp-server npx @onori/yfinance-mcp-server
How to use
The yfinance MCP server exposes a simple interface to fetch historical Yahoo Finance data via the getStockHistory tool. It runs as an MCP server instance that you can connect to with any MCP client. The primary capability is to request historical stock data for a given symbol over a specified period with a chosen data interval. The server is started via the npx command and uses the @onori/yfinance-mcp-server package to serve the endpoints. You can then issue MCP requests to get adjusted historical OHLCV data for symbols like AAPL, MSFT, or GOOGL over periods such as 1d, 1mo, 1y, or max, with intervals such as 1d, 1wk, or 1mo.
How to install
Prerequisites:
- Node.js and npm installed on your machine (Node >= 16 is recommended)
- Internet access to install npm packages
Installation steps:
- Install and run the MCP server via npx (no local install required):
npx @onori/yfinance-mcp-server
- If you prefer to install locally for development, you can install the package and run a local server (optional):
mkdir yfinance-mcp && cd yfinance-mcp
npm init -y
npm install @onori/yfinance-mcp-server
Then start the server (adjust the start script as needed by your setup):
npx @onori/yfinance-mcp-server
- Verify the server is running by connecting with an MCP client and issuing a getStockHistory request.
Additional notes:
- The README example uses npx to fetch the MCP server package on demand; this is common for MCP server setups to avoid a global install.
- If you prefer to pin a specific version, specify it in the command, e.g., npx @onori/yfinance-mcp-server@1.0.0.
Additional notes
Tips and considerations:
- The server fetches data from Yahoo Finance via the yfinance library, which may be subject to rate limits or data availability changes. Plan for occasional API changes or data gaps.
- Available parameters for getStockHistory: symbol (required), period (required), interval (optional). Common values: period: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max; interval: 1d, 1wk, 1mo.
- When using MCP clients, ensure your requests follow the MCP protocol for payload structure and response handling.
- If you need to customize behavior (e.g., default period or interval), you may extend or fork the MCP server package and adjust its configuration or code accordingly.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.