Yfinance 交易者 Mcp 工具适用于 Claude 桌面版

创建者SaintDoreshSaintDoresh

一个MCP(模型上下文协议)工具,使用yfinance库提供股票市场数据和交易功能,特别为Claude Desktop进行了适配。

概览

什么是 YFinance-Trader-MCP-ClaudeDesktop?

YFinance-Trader-MCP-ClaudeDesktop 是一个为股市爱好者和交易者设计的强大工具。它利用 yfinance 库提供实时股市数据和交易功能。该工具专门为 Claude Desktop 进行了适配,使其对希望无缝分析和交易股票的用户友好且高效。

YFinance-Trader-MCP-ClaudeDesktop 的特点

  • 实时数据访问:即时获取股市数据,包括价格、历史数据和财务指标。
  • 交易功能:通过应用程序直接执行交易,基于实时数据快速做出决策。
  • 用户友好的界面:界面设计简洁直观,便于新手和经验丰富的交易者使用。
  • 可定制的警报:为特定股票的波动或价格变化设置警报,以便及时了解市场情况。
  • 全面的分析:使用各种指标和可视化工具分析股票表现,以做出明智的交易决策。

如何使用 YFinance-Trader-MCP-ClaudeDesktop

  1. 安装:从官方仓库下载并安装 YFinance-Trader-MCP-ClaudeDesktop 应用程序。
  2. 设置:配置您的账户设置并连接到您的交易平台。
  3. 探索功能:熟悉仪表板,在这里您可以查看股票数据、执行交易和设置警报。
  4. 开始交易:利用实时数据做出明智的交易决策,并直接从应用程序执行交易。
  5. 监控表现:跟踪您的投资,并使用内置分析工具分析表现。

常见问题解答

问:YFinance-Trader-MCP-ClaudeDesktop 是免费使用的吗?

答:是的,该工具是开源的,免费提供。您可以从 GitHub 仓库下载。

问:它支持哪些平台?

答:YFinance-Trader-MCP-ClaudeDesktop 专门为 Claude Desktop 设计,确保兼容性和最佳性能。

问:我可以自定义警报吗?

答:可以,用户可以为特定股票的波动或价格变化设置可定制的警报,以保持更新。

问:股票数据更新的频率是多少?

答:该应用程序提供实时数据,确保用户拥有最新的信息以做出交易决策。

问:我在哪里可以找到支持或报告问题?

答:支持和问题报告可以通过 GitHub 仓库的问题跟踪器进行,您还可以在这里找到社区讨论和更新。

详情

YFinance Trader MCP Tool for Claude Desktop

An MCP (Model Context Protocol) tool that provides stock market data and trading capabilities using the yfinance library, specifically adapted for Claude Desktop.

Credit: This project was inspired by mcp-stocks by Luigi Ajah, which is a similar implementation for Cursor. This adaptation modifies the original concept to work with Claude Desktop.

Tutorial

For a detailed guide on setting up and using this tool, check out our Medium tutorial: Tutorial: Using Claude Desktop with YFinance Trader MCP Tool to Access Real-Time Stock Market Data

Features

  • Real-time stock quotes
  • Company information and financial metrics
  • Historical price data
  • Symbol search functionality
  • Analyst recommendations
  • Insider transaction tracking

Setup

  1. Ensure you have Python 3.10 or higher installed

  2. Install dependencies:

pip install -r requirements.txt

Integration with Claude Desktop

  1. Configure your MCP settings in Claude Desktop by adding the following to your MCP configuration:
{
  "mcpServers": {
    "yfinance-trader": {
      "command": "py",
      "args": ["-3.13", "path/to/your/main.py"]
    }
  }
}
  1. Replace the path with the full path to your main.py file
  2. Restart Claude Desktop if needed

Available Tools

1. get_stock_quote

Get real-time stock quote information:

{
    "symbol": "AAPL",
    "price": 150.25,
    "change": 2.5,
    "changePercent": 1.67,
    "volume": 1234567,
    "timestamp": "2024-03-20T10:30:00"
}

2. get_company_overview

Get company information and key metrics:

{
    "name": "Apple Inc.",
    "sector": "Technology",
    "industry": "Consumer Electronics",
    "marketCap": 2500000000000,
    "peRatio": 25.4,
    "forwardPE": 24.2,
    "dividendYield": 0.65,
    "52WeekHigh": 182.94,
    "52WeekLow": 124.17
}

3. get_time_series_daily

Get historical daily price data:

{
    "symbol": "AAPL",
    "timeSeriesDaily": [
        {
            "date": "2024-03-20T00:00:00",
            "open": 150.25,
            "high": 152.30,
            "low": 149.80,
            "close": 151.75,
            "volume": 12345678
        }
        // ... more data points
    ]
}

4. search_symbol

Search for stocks and other securities:

{
    "results": [
        {
            "symbol": "AAPL",
            "name": "Apple Inc.",
            "type": "EQUITY",
            "exchange": "NASDAQ"
        }
        // ... more results
    ]
}

5. get_recommendations

Get analyst recommendations for a stock:

{
    "symbol": "AAPL",
    "recommendations": [
        {
            "period": "2024-03-15T00:00:00",
            "strongBuy": 15,
            "buy": 20,
            "hold": 8,
            "sell": 2,
            "strongSell": 0
        }
        // ... more periods
    ]
}

6. get_insider_transactions

Get insider trading information:

{
    "symbol": "AAPL",
    "transactions": [
        {
            "date": "2024-03-15T00:00:00",
            "insider": "John Doe",
            "position": "Director",
            "transactionType": "Buy",
            "shares": 1000,
            "value": 150250.00,
            "url": "https://finance.yahoo.com/...",
            "text": "Purchase of 1000 shares",
            "startDate": "2024-03-15",
            "ownership": "Direct"
        }
        // ... more transactions
    ]
}

Sample Queries

You can ask Claude Desktop questions like:

  • "What is the current stock price and daily change for AAPL?"
  • "Can you give me a company overview for Microsoft (MSFT)?"
  • "Show me the historical price data for Tesla (TSLA) over the last 3 months."
  • "Search for stocks related to 'NVDA'."
  • "What are the analyst recommendations for Amazon (AMZN)?"
  • "Have there been any recent insider transactions for Google (GOOGL)?"

Cryptocurrency Support

Limited cryptocurrency data is available using special ticker formats:

  • BTC-USD for Bitcoin
  • ETH-USD for Ethereum
  • DOGE-USD for Dogecoin

Error Handling

All tools include proper error handling and will return an error message if something goes wrong:

{
    "error": "Failed to fetch quote for INVALID_SYMBOL"
}

Troubleshooting

If the MCP server is not working in Claude Desktop:

  1. Make sure the server is running - you should see output when you start the script
  2. Verify the path in your settings is correct and absolute
  3. Make sure Python 3.10+ is in your system PATH
  4. Check that all dependencies are installed
  5. Try restarting Claude Desktop
  6. Check logs for any error messages

Differences from the original mcp-stocks project

  • Uses the MCP library directly instead of FastAPI
  • Adapted for Claude Desktop instead of Cursor
  • Modified error handling and response formats
  • Updated configuration approach

License

MIT License

Server配置

{
  "mcpServers": {
    "yfinance-trader-mcp-claude-desktop": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/metorial/mcp-container--saintdoresh--yfinance-trader-mcp-claudedesktop--yfinance-trader-mcp-claude-desktop",
        "python main.py"
      ],
      "env": {}
    }
  }
}

项目信息

作者
SaintDoresh
Category
金融
创建时间
Sept 9, 2025
收藏数
21
语言
Python
标签
-

Yfinance 交易者 Mcp 工具适... 替代方案

如果你需要 Yfinance 交易者 Mcp 工具适... 的一些替代方案,我们为你提供了按类别划分的网站。

一个MCP(模型上下文协议)工具,使用CoinGecko API提供加密货币市场数据,专门为Claude Desktop设计。

Coincap Mcp
@QuantGeekDev

一个 coincap mcp 服务器,用于访问来自 coincap API 的加密数据。

一个免费的MCP服务器,用于分析和提取公共文件、财报记录、财务指标、股市数据、私募市场交易以及在Claude Desktop和其他流行的MCP客户端中进行深度网络研究的洞察。

无缝地将AI代理与Chargebee集成,使用AgentKit实现更智能的计费和订阅工作流程。

查看更多 >>