yahu
一个用于与Yahoo Finance交互的Model Context Protocol (MCP) 服务器,提供获取定价、公司信息等功能。目前处于早期开发阶段。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"yahoo-finance": {
"args": [
"run",
"-i",
"--rm",
"IMAGE"
],
"command": "docker"
}
}
}
可用工具 (10 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
get_current_stock_price 1 个参数 需填 1 项
Get the current stock price based on stock symbol.
必填参数:symbol
get_stock_price_by_date 2 个参数 需填 2 项
Get the stock price for a given stock symbol on a specific date.
必填参数:symbol、date
get_stock_price_date_range 3 个参数 需填 3 项
Get the stock prices for a given date range for a given stock symbol.
必填参数:symbol、start_date、end_date
get_historical_stock_prices 3 个参数 需填 1 项
Get historical stock prices for a given stock symbol.
必填参数:symbol
get_dividends 1 个参数 需填 1 项
Get dividends for a given stock symbol.
必填参数:symbol
get_income_statement 2 个参数 需填 1 项
Get income statement for a given stock symbol.
必填参数:symbol
get_cashflow 2 个参数 需填 1 项
Get cashflow for a given stock symbol.
必填参数:symbol
get_earning_dates 2 个参数 需填 1 项
Get earning dates.
必填参数:symbol
get_news 1 个参数 需填 1 项
Get news for a given stock symbol.
必填参数:symbol
get_recommendations 1 个参数 需填 1 项
Get analyst recommendations for a given symbol.
必填参数:symbol
服务介绍
MCP Yahoo Finance
A Model Context Protocol (MCP) server for Yahoo Finance interaction. This server provides tools to get pricing, company information and more.
Please note that
mcp-yahoo-financeis currently in early development. The functionality and available tools are subject to change and expansion as I continue to develop and improve the server.
Installation
You don't need to manually install mcp-yahoo-finance if you use uv. We'll use uvx to directly run mcp-yahoo-finance.
I would recommend using this method if you simply want to use the MCP server.
Using pip
Using pip.
pip install mcp-yahoo-finance
Using Git
You can also install the package after cloning the repository to your machine.
git clone git@github.com:maxscheijen/mcp-yahoo-finance.git
cd mcp-yahoo-finance
uv sync
Configuration
Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"yahoo-finance": {
"command": "uvx",
"args": ["mcp-yahoo-finance"]
}
}
}
You can also use docker:
{
"mcpServers": {
"yahoo-finance": {
"command": "docker",
"args": ["run", "-i", "--rm", "IMAGE"]
}
}
}
VSCode
Add this to your .vscode/mcp.json:
{
"servers": {
"yahoo-finance": {
"command": "uvx",
"args": ["mcp-yahoo-finance"]
}
}
}
Examples of Questions
- "What is the stock price of Apple?"
- "What is the difference in stock price between Apple and Google?"
- "How much did the stock price of Apple change between 2024-01-01 and 2025-01-01?"
Build
Docker:
docker build -t [IMAGE] .
Test with MCP Inspector
npx @modelcontextprotocol/inspector uv run mcp-yahoo-finance