yfinance-mcp
by narumiruna·★ 135·综合分 49
雅虎财经 MCP 服务器,提供股票数据、财务报表、新闻、图表和期权数据。
概述
yfinance-mcp 服务器通过模型上下文协议为 AI 助手提供对雅虎财经数据的全面访问。它利用流行的 yfinance 库获取股票信息、财务报表、历史数据、新闻文章和期权数据。服务器提供多种工具以满足不同的金融数据需求,包括股票信息检索、财务报表分析、带有图表生成的价格历史记录和期权数据访问。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当您需要将全面的金融市场数据集成到 AI 助手中,特别是用于股票分析、新闻检索和技术图表生成时。
什么时候不要选它
当您需要实时交易功能或来自 Yahoo Finance 以外的金融数据源时,因为此服务器仅提供对 Yahoo 数据的只读访问。
此 server 暴露的工具
从 README 抽取出 9 个工具yfinance_get_ticker_infosymbol: stringRetrieve comprehensive stock data including company info, financials, trading metrics, and governance data.
yfinance_get_ticker_newssymbol: stringFetch recent news articles and press releases for a specific stock.
yfinance_searchquery: string, search_type: stringSearch Yahoo Finance for stocks, ETFs, and news articles.
yfinance_get_topsector: string, top_type: string, top_n?: numberGet top-ranked financial entities within a market sector.
yfinance_get_price_historysymbol: string, period?: string, interval?: string, chart_type?: string, prepost?: booleanFetch historical price data and optionally generate technical analysis charts.
yfinance_get_financialssymbol: string, frequency?: stringFetch financial statements (income statement, balance sheet, and cash flow) with historical data.
yfinance_get_holderssymbol: string, max_rows?: numberFetch major holders, institutional holders, mutual fund holders, and insider data.
yfinance_get_option_datessymbol: stringFetch available option expiration dates for a stock.
yfinance_get_option_chainsymbol: string, expiration_date?: string, option_type?: stringFetch option chain data (calls and puts) for a stock with available strike prices.
可对比工具
安装
安装
使用 uv(推荐)
- [安装 uv](https://docs.astral.sh/uv/getting-started/installation/)
- 将以下内容添加到您的 MCP 客户端配置中:
{
"mcpServers": {
"yfmcp": {
"command": "uvx",
"args": ["yfmcp@latest"]
}
}
}使用 Docker
{
"mcpServers": {
"yfmcp": {
"command": "docker",
"args": ["run", "-i", "--rm", "narumi/yfinance-mcp"]
}
}
}从源代码安装
- 克隆仓库并安装依赖项:
git clone https://github.com/narumiruna/yfinance-mcp.git
cd yfinance-mcp
uv sync- 将以下内容添加到您的 MCP 客户端配置中:
{
"mcpServers": {
"yfmcp": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/yfinance-mcp",
"yfmcp"
]
}
}
}请将 /path/to/yfinance-mcp 替换为您克隆仓库的实际路径。
FAQ
- 通过这个 MCP 服务器可以访问哪些金融数据?
- 服务器提供全面的金融数据,包括股票信息、财务报表(损益表、资产负债表、现金流量表)、公司详情、带有技术图表的价格历史记录、金融新闻、行业排名、期权数据和所有权信息。
- 我可以用这个 MCP 服务器生成图表吗?
- 是的,服务器可以生成专业金融图表,包括带有成交量柱状图的K线图、VWAP叠加图和成交量分布图。图表以 Base64 编码的 WebP 格式返回,以提高令牌使用效率。
yfinance-mcp 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。