yfinance-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@yfinance-mcp-serverGet daily stock data for AAPL for the past month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
yfinance-mcp-server
Important Note: This is an unofficial MCP server.
A Message Control Protocol (MCP) server for accessing Yahoo Finance data. This server provides a simple interface to retrieve stock market data through yfinance.
Features
Get historical stock data with customizable periods and intervals
Easy to use with any MCP client
Built with TypeScript for type safety and better developer experience
Related MCP server: YFinance MCP Server
Usage
Example Cursor MCP Client.
{
"mcpServers": {
"yfinance": {
"command": "npx",
"args": [
"@onori/yfinance-mcp-server"
]
}
}
}getStockHistory
Retrieves historical stock data for a given symbol.
Parameters:
symbol(required): The stock symbol (e.g., "AAPL" for Apple Inc.)period(required): Time period to fetch data for (e.g., "1d", "5d", "1mo", "3mo", "6mo", "1y", "2y", "5y", "10y", "ytd", "max")interval(optional): Data interval ("1d", "1wk", "1mo")
Example MCP request:
> (Request)
Please use the `getStockHistory` tool to fetch the daily stock data for AAPL for the past week (`period`='1w', `interval`='1d'). Then, render the results as a markdown table.
> (Response Example)
I'll help you fetch Apple's stock data and format it nicely as a markdown table.
First, I'll call the getStockHistory tool to fetch the data:
Let me format this data into a more readable markdown table:
| Date | Open | High | Low | Close | Volume |
|------|------|------|-----|-------|---------|
| Mar 31, 2025 | $217.01 | $225.62 | $216.23 | $222.13 | 65.30M |
| Apr 1, 2025 | $219.81 | $223.68 | $218.90 | $223.19 | 36.41M |
| Apr 2, 2025 | $221.32 | $225.19 | $221.02 | $223.89 | 35.91M |
| Apr 3, 2025 | $205.54 | $207.49 | $201.25 | $203.19 | 103.42M |
| Apr 4, 2025 | $193.89 | $199.88 | $187.34 | $188.38 | 125.57M |
Some notable observations from this data:
- The stock showed significant volatility over this period
- There was a sharp decline in the last two trading days
- Trading volume increased substantially during the declining days, with the highest volume (125.57M shares) on April 4th
- The stock price range was from a high of $225.62 to a low of $187.34 during this period
Would you like any specific analysis of this data or would you like to see different metrics?Development
To set up the development environment:
Clone the repository
Install dependencies:
npm installStart the development server:
npm run devContributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
ISC License (ISC)
Available Tools
1 toolgetStockHistoryD
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| period | Yes | ||
| interval | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.0.3- First observed
getStockHistory
TDQS
Only one tool exists, so there is no risk of confusion between tools.
A single tool trivially follows its own naming pattern (camelCase verb_noun).
A single tool for a finance data server is far too few; expected at least 3-15 tools for basic coverage.
The tool surface is severely incomplete for stock market data, lacking any other essential operations (e.g., current price, dividends, financials).
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Finnhub MCP — wraps Finnhub Stock API (finnhub.io)
Unlock the power of real-time financial data with our Finance MCP. Easily retrieve the latest
- mcpOAuthcom.twelvedata
Twelve Data MCP: real-time & historical market data (stocks, crypto, forex, etc).
Alpha Vantage MCP — Stock market data, fundamentals, and earnings
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server that provides seamless access to Yahoo Finance stock market data, enabling retrieval of real-time quotes, historical data, charts, financial summaries, and market searches.38ISC
- FlicenseAqualityDmaintenanceProvides financial data from Yahoo Finance via MCP, enabling AI agents to access real-time stock info, historical prices, financial statements, and market analysis.1013-
- AlicenseAqualityDmaintenanceEnables querying stock data, financial information, news, and historical prices from Yahoo Finance through a set of MCP tools.5MIT
- AlicenseAqualityAmaintenanceMCP server that exposes Yahoo Finance data through tools for searching instruments, fetching quotes, history, company info, financials, dividends, news, recommendations, and options. Enables AI assistants to answer market-data questions using natural language.22MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/onori/yfinance-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server