适用于 Claude 桌面的 YFinance Trader MCP 工具
一种 MCP(模型上下文协议)工具,使用 yfinance 库提供股票市场数据和交易功能,专门针对 Claude Desktop 进行调整。
图片来源:本项目灵感源自 Luigi Ajah 的mcp-stocks ,后者是 Cursor 的一个类似实现。本次改编修改了原始概念,使其能够与 Claude Desktop 兼容。
教程
有关设置和使用此工具的详细指南,请查看我们的 Medium 教程: 教程:使用 Claude Desktop 和 YFinance Trader MCP 工具访问实时股票市场数据
特征
- 实时股票报价
- 公司信息和财务指标
- 历史价格数据
- 符号搜索功能
- 分析师建议
- 内幕交易追踪
设置
- 确保安装了 Python 3.10 或更高版本
- 安装依赖项:
与 Claude Desktop 集成
- 通过将以下内容添加到您的 MCP 配置中,在 Claude Desktop 中配置您的 MCP 设置:
- 将路径替换为 main.py 文件的完整路径
- 如果需要,重新启动 Claude Desktop
可用工具
1. 获取股票报价
获取实时股票报价信息:
2. 获取公司概览
获取公司信息和关键指标:
3. 获取每日时间序列
获取历史每日价格数据:
4. 搜索符号
搜索股票和其他证券:
5. 获取建议
获取股票分析师的建议:
6. 获取内部交易
获取内幕交易信息:
示例查询
您可以向 Claude Desktop 询问以下问题:
- “AAPL 的当前股价和每日变化是多少?”
- “您能给我介绍一下微软(MSFT)的公司概况吗?”
- “显示过去 3 个月特斯拉 (TSLA) 的历史价格数据。”
- “搜索与‘NVDA’相关的股票。”
- “分析师对亚马逊(AMZN)的建议是什么?”
- “谷歌(GOOGL)最近有内幕交易吗?”
加密货币支持
有限的加密货币数据可通过特殊的股票代码格式获得:
- BTC-USD 比特币
- ETH-USD 代表以太坊
- DOGE-USD 为狗狗币
错误处理
所有工具都包含适当的错误处理,如果出现问题,将返回错误消息:
故障排除
如果 MCP 服务器在 Claude Desktop 中无法运行:
- 确保服务器正在运行 - 启动脚本时您应该看到输出
- 验证设置中的路径是否正确且绝对
- 确保 Python 3.10+ 位于你的系统 PATH 中
- 检查所有依赖项是否已安装
- 尝试重启 Claude Desktop
- 检查日志中是否有任何错误消息
与原始 mcp-stocks 项目的区别
- 直接使用 MCP 库,而不是 FastAPI
- 适用于 Claude Desktop 而非 Cursor
- 修改错误处理和响应格式
- 更新的配置方法
执照
MIT 许可证
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
使用 yfinance 库提供股票市场数据和交易功能
Related MCP Servers
- -securityFlicense-qualityA TypeScript-based MCP server that fetches real-time stock market data and company financial information through the Alpha Vantage API.Last updated -JavaScript
- AsecurityAlicenseAqualityA simple MCP server for Yahoo Finance using yfinance. This server provides a set of tools to fetch stock data, news, and other financial information.Last updated -1020PythonMIT License
- -securityFlicense-qualityProvides real-time access to global stock market data including current prices, historical charts, and company financial information through a Model Context Protocol (MCP) server for AI assistants.Last updated -TypeScript
- AsecurityAlicenseAqualityA Model Context Protocol server that enables interaction with Yahoo Finance to retrieve stock pricing, company information, and historical financial data through natural language queries.Last updated -92PythonMIT License
Appeared in Searches
- A platform for live probability option trading with indicators across multiple markets
- Live Option Recommendations for Trading or Investing
- A server for obtaining historical cryptocurrency market data
- A tool or service for checking cryptocurrency prices
- A platform for analyzing crypto narratives based on macroeconomic events and cultural trends