Skip to main content
Glama

Finance Tools MCP

by VoxLink-org

finance-tools-mcp:财务分析MCP服务器

https://github.com/VoxLink-org/finance-tools-mcp

概述

finance-tools-mcp是一个模型上下文协议 (MCP) 服务器,旨在为大型语言模型 (LLM) 提供全面的财务洞察和分析能力。它由investor-agent修改而来,可与各种数据源和分析库集成,提供一套用于详细财务研究和分析的工具。

提供的工具

服务器通过 MCP 公开各种工具,允许连接的客户端(如 LLM)访问特定的财务数据并执行分析:

  • 股票数据工具:
    • get_ticker_data :提供给定股票代码的综合报告,包括概述、新闻、关键指标、表现、日期、分析师建议以及升级/降级。
    • get_options :检索股票代码未平仓合约最高的期权数据,并提供日期范围、执行价格和期权类型(看涨/看跌)的过滤选项。
    • get_price_history :获取指定时期的历史价格数据摘要,包括 OHLCV 样本、技术指标、风险指标和其他定量分析。
    • get_financial_statements :获取股票行情的财务报表(收入、余额、现金流),可按季度或年度获取。
    • get_institutional_holders :列出股票代码的主要机构和共同基金持有人。
    • get_earnings_history :提供股票盈利历史,包括估值和意外情况。
    • get_insider_trades :检索股票代码的近期内幕交易活动。
    • get_ticker_news_tool :获取特定股票代码的最新雅虎财经新闻。
  • 恐惧与贪婪指数工具:
    • get_current_fng_tool :获取当前 CNN 恐惧与贪婪指数得分和评级。
    • get_historical_fng_tool :检索指定天数的历史 CNN 恐惧与贪婪指数数据。
    • analyze_fng_trend :分析特定时期内 CNN 恐惧与贪婪指数的趋势。
  • 计算工具:
    • calculate :使用 Python 的数学语法和 NumPy 计算数学表达式。
  • 宏观数据工具:
    • get_current_time :提供当前时间。
    • get_fred_series :检索特定 FRED 系列 ID 的数据。
    • search_fred_series :按关键字搜索热门的 FRED 系列。
    • cnbc_news_feed :从 CNBC、BBC 和 SCMP 获取最新的世界新闻。

时间序列数据处理与优化

该服务器利用yfinance检索股票的历史价格数据(OHLCV,即开盘价、最高价、最低价、收盘价、成交量)。这些原始数据经过大量处理和分析,以提供有价值的见解,并特别针对法学硕士 (LLM) 的使用进行了优化。

时间序列数据处理的关键方面包括:

  • **全面分析:**使用ta-lib-python等库分析数据,计算各种技术指标。此外,自定义函数可计算基本统计数据、风险指标,识别常见图表模式,并计算斐波那契回撤位。
  • **结构化摘要:**此分析的结果被编译成易于 LLM 解析和理解的结构化摘要格式( generate_time_series_digest_for_LLM ),其中包括统计数据、摘要、技术指标、风险指标、模式、斐波那契水平和数据样本等部分。
  • **LLM 的智能采样:**为了向 LLM 提供具有代表性的历史数据视图,且不至于使上下文窗口过载,我们采用了“智能采样”策略 ( get_latest_data_sample )。此方法以不同的分辨率对数据进行采样:
    • **高分辨率:**每天都包含最新的数据点。
    • **中等分辨率:**每周对中间数据点进行采样。
    • **低分辨率:**每月对旧数据点进行采样。这种混合方法可确保 LLM 接收有关近期价格走势的详细信息,同时仍掌握长期趋势的背景信息,所有这些都在可控的数据点数量范围内。

这种对时间序列数据的优化处理和呈现使 LLM 能够快速掌握关键趋势、指标和模式,从而促进更明智的财务分析。

示例报告

替代文本

先决条件

  • Python: 3.10 或更高版本
  • 软件包管理器: uv

安装

首先,如果尚未安装uv ,请安装它:

curl -LsSf https://astral.sh/uv/install.sh | sh

然后,您可以使用uvx运行finance-tools-mcp MCP 服务器:

uvx finance-tools-mcp

如果您想使用自己的 FRED API 密钥,可以将其设置为环境变量:

FRED_API_KEY=YOUR_API_KEY uvx finance-tools-mcp

您还可以使用服务器发送事件(SSE)传输运行服务器:

uvx finance-tools-mcp --transport sse

或者使用 FRED API 密钥和 SSE 传输:

FRED_API_KEY=YOUR_API_KEY uvx finance-tools-mcp --transport sse

与 MCP 客户端一起使用

要将finance-tools-mcp与 MCP 客户端(例如 Claude Desktop)集成,请将以下配置添加到claude_desktop_config.json中:

{ "mcpServers": { "investor": { "command": "path/to/uvx/command/uvx", "args": ["finance-tools-mcp"], } } }

调试

您可以利用 MCP 检查器来调试服务器:

npx @modelcontextprotocol/inspector uvx finance-tools-mcp

或者

npx @modelcontextprotocol/inspector uv --directory ./ run finance-tools-mcp

对于日志监控,请检查以下目录:

  • macOS: ~/Library/Logs/Claude/mcp*.log
  • Windows: %APPDATA%\Claude\logs\mcp*.log

发展

对于本地开发和测试:

  1. 按照调试部分中的说明使用 MCP 检查器。
  2. 使用 Claude Desktop 进行以下配置测试:
{ "mcpServers": { "investor": { "command": "path/to/uv/command/uv", "args": ["--directory", "path/to/finance-tools-mcp", "run", "finance-tools-mcp"], } } }

执照

此 MCP 服务器采用 MIT 许可证。详情请参阅许可证文件。

示例

待办事项

  • [ ] 添加股票支撑位和阻力位
  • [x] 为股票添加斐波那契回撤位
  • [ ] 添加股票移动平均汇合水平
  • [ ] 添加选项模型进行预测
  • [ ] 使用财务表和其他功能添加预测模型

数据源

  • fintel.com
  • 投资网站
  • 雅虎
  • fred.stlouisfed.org
  • CNN、CNBC 和 Reddit
Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

MCP 服务器利用实时市场数据、新闻以及股票、期权、财务报表和经济指标的高级分析,提供全面的财务见解和分析。

  1. 概述
    1. 提供的工具
      1. 时间序列数据处理与优化
        1. 示例报告
          1. 先决条件
            1. 安装
              1. 与 MCP 客户端一起使用
                1. 调试
                  1. 发展
                    1. 执照
                      1. 示例
                        1. 待办事项
                          1. 数据源

                            Related MCP Servers

                            • -
                              security
                              A
                              license
                              -
                              quality
                              The MCP Trader Server conducts comprehensive technical analysis on stocks, offering insights into trends, momentum indicators, volatility metrics, and volume analysis to support stock trading decisions.
                              Last updated -
                              137
                              Python
                              MIT License
                              • Apple
                            • -
                              security
                              A
                              license
                              -
                              quality
                              An MCP server that integrates with the AlphaVantage financial data API, providing access to stock market data, technical indicators, and fundamental financial information.
                              Last updated -
                              Python
                              MIT License
                              • Linux
                              • Apple
                            • A
                              security
                              F
                              license
                              A
                              quality
                              An MCP server that provides real-time financial data integration with Alpha Vantage's API, enabling access to stock market data, cryptocurrency prices, forex rates, and technical indicators.
                              Last updated -
                              7
                              2
                              JavaScript
                            • A
                              security
                              A
                              license
                              A
                              quality
                              A 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 -
                              10
                              20
                              Python
                              MIT License

                            View all related MCP servers

                            MCP directory API

                            We provide all the information about MCP servers via our MCP API.

                            curl -X GET 'https://glama.ai/api/mcp/v1/servers/VoxLink-org/finance-tools-mcp'

                            If you have feedback or need assistance with the MCP directory API, please join our Discord server