Financial Datasets MCP Server

Financial Datasets MCP Server

site icon
2025.03.29 203
Python金融数据服务股票市场数据金融服务
Financial Datasets MCP Server 是一个基于模型上下文协议(MCP)的服务,专门用于提供股票市场数据的访问。它允许Claude和其他AI助手通过MCP接口直接检索收入报表、资产负债表、现金流量表、股票价格和市场新闻。该服务适用于金融数据分析、投资研究和市场监控等场景。
View on GitHub

Overview

基本能力

产品定位

Financial Datasets MCP Server 是一个金融数据服务,专注于提供股票市场的详细数据和分析工具。

核心功能

  • get_income_statements: 检索股票的收益报表
  • get_balance_sheets: 检索股票的资产负债表
  • get_cash_flow_statements: 检索股票的现金流量表
  • get_current_price: 获取股票的最新价格信息
  • get_prices: 获取可自定义日期范围和间隔的历史股票价格
  • get_news: 获取股票的最新新闻

适用场景

  • 金融数据分析
  • 投资研究
  • 市场监控

工具列表

  • get_income_statements: 提供股票的收益报表数据
  • get_balance_sheets: 提供股票的资产负债表数据
  • get_cash_flow_statements: 提供股票的现金流量表数据
  • get_current_price: 提供股票的最新价格
  • get_prices: 提供历史股票价格数据
  • get_news: 提供股票的最新新闻

使用教程

使用依赖

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

安装教程

  1. 克隆仓库: bash git clone https://github.com/financial-datasets/mcp-server cd mcp-server

  2. 安装uv: ```bash # macOS/Linux curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows curl -LsSf https://astral.sh/uv/install.ps1 | powershell ```

  1. 安装依赖: ```bash # 创建虚拟环境并激活 uv venv source .venv/bin/activate # Windows: .venv\Scripts\activate

# 安装依赖 uv add "mcp[cli]" httpx # Windows: uv add mcp[cli] httpx ```

  1. 设置环境变量: ```bash # 创建.env文件 cp .env.example .env

# 设置API密钥 FINANCIAL_DATASETS_API_KEY=your-financial-datasets-api-key ```

  1. 运行服务器: bash uv run server.py

调试方式

  1. 确保服务器运行: bash uv run server.py

  2. 在Claude Desktop中测试工具:

  3. "What are Apple's recent income statements?"
  4. "Show me the current price of Tesla stock"
  5. "Get historical prices for MSFT from 2024-01-01 to 2024-12-31"

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。