MCP Yahoo Finance

Integrations

  • Provides a way to run the MCP Yahoo Finance server in a Docker container for more isolated deployment

  • References the original and current repositories, along with acknowledgments to the original creator and contributors

  • Includes configuration information for running on Linux systems with appropriate paths

MCP 雅虎财经

用于与雅虎财经交互的模型上下文协议(MCP) 服务器。该服务器提供获取定价、公司信息以及生成财务可视化图表的工具。

该项目是maxscheijen/mcp-yahoo-finance的一个分支和扩展,增加了可视化功能。

特征

  • 财务数据:获取当前股票价格、历史价格、股息、损益表等
  • 可视化分析:为市场情绪、投资组合跟踪和技术分析生成精美的可视化效果
  • 轻松集成:可与 Claude Desktop、VS Code、Cursor 和其他 MCP 客户端配合使用

设置说明

1.克隆存储库

将此存储库克隆到您的本地机器:

git clone https://github.com/leoncuhk/mcp-yahoo-finance.git cd mcp-yahoo-finance

2.安装依赖项

使用 pip 安装所需的依赖项:

pip install -r requirements.txt

如果缺少requirements.txt文件,可以直接安装依赖项:

pip install mcp yfinance pandas matplotlib seaborn plotly kaleido numpy pillow base64io

3. 配置 MCP 客户端

克劳德桌面

将其添加到您的claude_desktop_config.json (如果不存在则创建它):

  • macOS/Linux~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows%APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "yahoo-finance": { "command": "uvx", "args": ["mcp-yahoo-finance"] } } }

您还可以使用 docker:

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

将其添加到您的.vscode/mcp.json

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

将其添加到您的 Cursor MCP 配置中:

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

4. 重启 MCP 客户端

配置完成后,重新启动 Claude Desktop 或您首选的 MCP 客户端以加载服务器。

可用工具

基本财务数据

  • get_current_stock_price :获取某个符号的当前股票价格
  • get_stock_price_by_date :获取特定日期的股票价格
  • get_stock_price_date_range :获取某个日期范围内的股票价格
  • get_historical_stock_prices :获取可自定义时间段的历史股票数据
  • get_dividends :获取股票的股息信息
  • get_income_statement :获取损益表数据
  • get_cashflow :获取现金流量表数据
  • get_earning_dates :获取收入日期信息
  • get_news :获取股票的最新消息

可视化工具

  • generate_market_dashboard :创建具有实时指数表现的市场情绪仪表板
  • generate_portfolio_report :生成投资组合绩效跟踪报告
  • generate_stock_technical_analysis :为股票创建技术分析报告

可视化示例

市场情绪仪表盘

投资组合追踪

股票技术分析

示例提示

以下是一些可以与 Claude 一起尝试的示例提示:

基本财务数据

  1. “苹果目前的股价是多少?”
  2. “苹果和谷歌的股价有什么区别?”
  3. “2025 年 1 月 1 日至 2025 年 3 月 31 日期间苹果公司的股价变化了多少?”

可视化请求

  1. “生成一个显示主要指数表现的市场情绪仪表板。”
  2. “为科技股 AAPL、MSFT、GOOGL、AMZN 和 NVDA 创建投资组合跟踪报告。”
  3. “向我展示特斯拉股票的技术分析图表,其中包含移动平均线和支撑/阻力位。”
  4. “使用标准普尔 500、道琼斯和纳斯达克生成市场情绪仪表板。”
  5. “您能为我的能源股 XOM、CVX、BP、COP 和 SLB 创建投资组合报告吗?”
  6. “我需要一份 NVDA 股票的详细技术分析,显示 RSI 和成交量模式。”

测试

测试可视化功能:

cd tests python test_visualization.py

这将在examples目录中生成示例可视化图像。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

致谢

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

提供获取财务数据(股票价格、公司信息)并通过模型上下文协议生成财务可视化的工具。

  1. Features
    1. Setup Instructions
      1. 1. Clone the Repository
      2. 2. Install Dependencies
      3. 3. Configure MCP Client
      4. 4. Restart your MCP client
    2. Available Tools
      1. Basic Financial Data
      2. Visualization Tools
    3. Visualization Examples
      1. Market Sentiment Dashboard
      2. Portfolio Tracking
      3. Stock Technical Analysis
    4. Example Prompts
      1. Basic Financial Data
      2. Visualization Requests
    5. Testing
      1. License
        1. Acknowledgements

          Related MCP Servers

          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server that provides tools to search and retrieve economic data series from the Federal Reserve Economic Data (FRED) API.
            Last updated -
            2
            3
            TypeScript
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables Claude Desktop to access and analyze Chinese and global financial market data through the AKShare library.
            Last updated -
            3
            Python
            • Linux
            • Apple
          • -
            security
            A
            license
            -
            quality
            A web scraper for financial table data that implements the Model Context Protocol, allowing users to query stock data from multiple Chinese financial websites including THS, TDX, and EastMoney.
            Last updated -
            13
            Python
            MIT License
            • Linux
            • Apple
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables AI assistants like Claude to programmatically access financial data from Financial Modeling Prep API, including company profiles, financial statements, metrics, SEC filings, and market data.
            Last updated -
            5
            Python
            MIT License

          View all related MCP servers

          ID: h1x8swudcp