A FastMCP-based service that provides stock data including historical prices, fundamental information, and financial news.
这是一个基于 FastMCP 的股票数据服务,提供了股票历史数据、基本面信息、新闻资讯等功能。
stock-info/
├── src/
│ ├── config/ # 配置管理
│ │ └── settings.py
│ ├── core/ # 核心功能
│ │ └── exceptions.py
│ ├── models/ # 数据模型
│ │ └── stock.py
│ ├── repository/ # 数据访问层
│ │ └── stock_repository.py
│ ├── service/ # 业务逻辑层
│ │ └── stock_service.py
│ └── server.py # 服务入口
├── pyproject.toml # 项目配置
└── README.md # 项目文档
{ "mcpServers": { "stock-info": { "isActive": true, "command": "uv", "args": [ "--directory", "\\path\\to\\sock_info\\src", "run", "server.py" ] } }
python -m venv .venv
# Windows .venv\Scripts\activate # Linux/macOS source .venv/bin/activate
pip install -e .
# 使用默认配置启动 python src/server.py # 使用 HTTP 传输协议启动 python src/server.py --transport http --port 8080 # 设置日志级别 python src/server.py --log-level debug
get_stock_info
: 获取指定股票代码、指定日期范围的股价信息get_stock_price_monthly
: 获取指定股票最近30天的股价信息stock_individual_basic_info
: 获取指定股票的基本信息risk_stocks
: 获取风险警示板股票列表stock_merito_data
: 获取指定股票的主营业务信息get_stock_news
: 获取指定股票的新闻资讯get_finance_news
: 获取财经精选新闻(支持分页)服务统一返回以下格式的错误信息:
{ "error": "错误代码", "message": "错误描述", "details": { "额外信息": "值" } }
STOCK_NOT_FOUND
: 股票代码不存在INVALID_DATE_FORMAT
: 日期格式错误DATA_FETCH_ERROR
: 数据获取失败INVALID_PAGINATION
: 分页参数错误SYSTEM_ERROR
: 系统内部错误Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!