一个用于Yahoo Finance交互的Model Context Protocol (MCP)服务器。此服务器提供了获取定价、公司信息以及生成财务可视化工具的功能。
该项目是maxscheijen/mcp-yahoo-finance的一个分支和扩展,增加了可视化能力。
将此仓库克隆到本地机器:
git clone https://github.com/leoncuhk/mcp-yahoo-finance.git
cd mcp-yahoo-finance
使用pip安装所需依赖:
pip install -r requirements.txt
如果缺少requirements.txt文件,可以直接安装依赖:
pip install mcp yfinance pandas matplotlib seaborn plotly kaleido numpy pillow base64io
在你的claude_desktop_config.json中添加以下内容(如果不存在则创建):
~/Library/Application Support/Claude/claude_desktop_config.json%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/mcp.json中添加以下内容:
{
"servers": {
"yahoo-finance": {
"command": "uvx",
"args": ["mcp-yahoo-finance"]
}
}
}
在你的Cursor MCP配置中添加以下内容:
{
"mcp-servers": {
"yahoo-finance": {
"command": "uvx",
"args": ["mcp-yahoo-finance"]
}
}
}
配置完成后,重启Claude Desktop或你首选的MCP客户端以加载服务器。



这里有一些示例提示可以尝试使用Claude:
要测试可视化功能:
cd tests
python test_visualization.py
这将在examples目录中生成示例可视化图像。
本项目采用MIT许可证——详情见LICENSE文件。