MM

maxscheijen/mcp-yahoo-finance

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

29 stars 15 forks 质量 82 趋势 20MIT

雅虎财经的模型上下文协议(MCP)服务器。

概览

雅虎财经的模型上下文协议(MCP)服务器。它提供价格、公司信息、历史数据、财务报表、新闻、推荐、盈利、股息和期权等工具。 MCP-Yahoo-Finance 目前处于早期开发阶段。工具名称和响应字段可能会在不同版本之间发生变化。 你可以用 uvx 运行 mcp-yahoo-finance,无需单独安装。 你也可以在将仓库克隆到你的机器后安装该软件包。 把这点记到你的claude_desktop_config.json里: 1. “苹果的股价是多少?”2. “给我一个AAPL的详细报价,包括之前的收盘价、盘中区间和市场状况。”3. “给我看英伟达的公司概况。”4. “苹果和谷歌的股价差异是多少?”5. “苹果股价在2024-01-01和2025-01-01之间变化了多少?”6. “AAPL可用的期权到期日是什么?”7. “显示AAPL将于2024-01-19到期的期权链” 8.

概述(AI 翻译)

MCP Yahoo Finance 是一个模型上下文协议(MCP)服务器。它从雅虎财经获取数据。你可以用它获取股票价格、公司数据、过去价格、财务报告、新闻、分析师评级、财报日期、股息和期权数据。

该项目处于早期开发阶段。工具名称和响应字段在不同版本之间可能会发生变化。

安装

你可以运行mcp-yahoo-finance,无需单独安装。使用uvx。

用点数

用 Git

克隆仓库。然后安装开发环境:

配置

克劳德桌面

将此条目添加到您的claude_desktop_config.json文件中:

你也可以用 Docker。用 Docker 镜像名替换 IMAGE :

VS 代码

将此条目添加到您的.vscode/mcp.json文件中:

示例问题

你可以提出以下问题:

  1. “苹果的股价是多少?”
  2. “给我一份AAPL的丰富报价,结合之前收盘价、盘中区间和市场状况。”
  3. “给我看英伟达的公司概况。”
  4. “苹果和谷歌的股价差异是多少?”
  5. “苹果股价在2024-01-01至2025-01-01之间涨幅了多少?”
  6. “AAPL可用的期权到期日期是什么?”

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Yahoo Finance

MCP Yahoo Finance is a Model Context Protocol (MCP) server. It gets data from Yahoo Finance. You can use it to get stock prices, company data, past prices, financial reports, news, analyst ratings, earnings dates, dividends, and options data.

This project is in early development. Tool names and response fields can change between releases.

Install

You can run mcp-yahoo-finance without a separate install. Use uvx.

Use pip

pip install mcp-yahoo-finance

Use Git

Clone the repository. Then install the development environment:

git clone [email protected]:maxscheijen/mcp-yahoo-finance.git
cd mcp-yahoo-finance
uv sync

Configure

Claude Desktop

Add this entry to your claude_desktop_config.json file:

{
    "mcpServers": {
        "yahoo-finance": {
            "command": "uvx",
            "args": ["mcp-yahoo-finance"]
        }
    }
}

You can also use Docker. Replace IMAGE with the Docker image name:

{
    "mcpServers": {
        "yahoo-finance": {
            "command": "docker",
            "args": ["run", "-i", "--rm", "IMAGE"]
        }
    }
}

VS Code

Add this entry to your .vscode/mcp.json file:

{
    "servers": {
        "yahoo-finance": {
            "command": "uvx",
            "args": ["mcp-yahoo-finance"]
        }
    }
}

Example questions

You can ask questions like these:

  1. “What is the stock price of Apple?”
  2. “Give me a rich quote for AAPL with the previous close, intraday range, and market status.”
  3. “Show me the company overview for Nvidia.”
  4. “What is the difference in stock price between Apple and Google?”
  5. “How much did the stock price of Apple change between 2024-01-01 and 2025-01-01?”
  6. “What are the available options expiration dates for AAPL?”
  7. “Show me the options chain for AAPL expiring on 2024-01-19.”
  8. “What are the call and put options for Tesla?”

Response data

Tools return data in JSON format. This is an example of a rich quote:

{
  "symbol": "AAPL",
  "currentPrice": 243.5822,
  "previousClose": 241.33,
  "absoluteChange": 2.2522,
  "percentChange": 0.9331,
  "open": 242.1,
  "dayHigh": 244.2,
  "dayLow": 241.9,
  "volume": 45678901,
  "marketStatus": "REGULAR",
  "currency": "USD",
  "exchange": "NMS",
  "timestamp": "2025-01-02T15:30:00+00:00",
  "source": {
    "provider": "Yahoo Finance",
    "endpoint": "info",
    "fetchedAt": "2025-01-02T15:30:01+00:00"
  }
}

Errors use the same format for all tools. An error includes an error code and a message:

{
  "error": {
    "code": "NO_DATA",
    "message": "No historical data found for AAPL"
  }
}
在 GitHub 查看完整 README

安装

uvx mcp-yahoo-finance
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "yahoo-finance": { "command": "uvx", "args": ["mcp-yahoo-finance"] } } }