JF

jinhongzou/finq4cn-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

28 stars 11 forks 质量 62 趋势 11MIT

适合国内使用的量化金融mcp server

概览

作为一款专为定量分析设计的MCP服务器工具,FinQ4Cn-mcp-server旨在为大型模型提供便捷、免费且开源的金融数据访问。该项目基于akshare库,专注于中国A股市场,为用户提供股票及相关金融产品的全面数据支持。它特别适合从事定量分析的专业人士以及对中国国内股市感兴趣的用户,满足他们对中国金融市场数据的需求。作为为国内投资者量身定制的理想选择,FinQ4Cn-mcp-server让用户轻松访问包括但不限于股价、金融指标和市场波动性的多维数据,助力精准决策。

概述(AI 翻译)

英语|简体中文

作为专为定量分析设计的专用MCP服务器工具,FinQ4Cn-mcp-server旨在为大型模型提供便捷、免费且开源的金融数据访问。该项目基于akshare库,专注于中国A股市场,为用户提供股票及相关金融产品的全面数据支持。它特别适合从事定量分析的专业人士以及对中国国内股市感兴趣的用户,满足他们对中国金融市场数据的需求。作为为国内投资者量身定制的理想选择,FinQ4Cn-mcp-server让用户轻松访问多维数据,包括但不限于股价、金融指标和市场波动性,助力精准决策。

未来实施

时间线

  • 丰富库存指标数据并改进数据分类
  • 提供技术分析能力
  • 支持基金、期货等
  • 支持回测模块

特色

股票风险警报

  • 获取指定股票代码上市公司的波动率详细信息。

股票 通用指标

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

FinQ4Cn MCP Server

English| 简体中文

A dedicated MCP server tool designed for quantitative analysis, FinQ4Cn-mcp-server aims to provide large models with convenient, free, and open-source access to financial data. Built on the akshare library, the project focuses on China’s A-share market, offering users comprehensive data support for stocks and related financial products. It is particularly well-suited for professionals engaged in quantitative analysis as well as users interested in China’s domestic stock market, meeting their needs for data from China’s financial markets. As an ideal choice tailored to domestic investors, FinQ4Cn-mcp-server allows users to effortlessly access multi-dimensional data, including but not limited to stock prices, financial indicators, and market volatility, empowering precise decision-making.

Future Implementation

Timeline

  • Enrich stock metrics data and improve data categorization
  • Provide technical analysis capabilities
  • Support funds, futures, and more
  • Support backtesting modules

Features

Stocks Risk Alert

  • Retrieve the volatility details of the specified stock code’s listed company.

Stocks Common Metrics

  • Retrieve the main business composition of the listed company with the specified stock code
  • Obtain historical price data for the stock within the specified time period
  • Retrieve the financial summary data of the specified stock
  • Obtain the margin trading and short selling details of the specified stock within the specified time range
  • Retrieve the historical dividend and rights issue details of the specified stock

News Report

  • Fetch the latest financial news and market trends within a specified date range.
  • Fetch the latest news articles and information related to a specific stock within a specified date range.

Back Testing

  • Perform backtesting on historical stock data using the specified trading strategy to evaluate its performance. The strategy is as follows: if the stock is not currently held, buy the stock based on the specified holding percentage (percent) and set a profit-taking percentage (stop_profit_pct).

Project Structure

mcp-server/
├── utils    
├── |──modules.py # 数据校验模块
├── |──stocks_common_metrics.py # 常用指标数据
├── |──stocks_risk_alert.py     # 股票风险提示信息
├──fs_server.py # mcp server启动文件

Dependencies

Required Dependencies

  • FastMCP
  • Pydantic
  • akshare

To install dependencies:

pip install -r requirements.txt

It is recommended to install the backtesting package using the following method:

pip install lib-pybroker -i https://pypi.tuna.tsinghua.edu.cn/simple

Setup

  1. Clone the repository:
git clone https://github.com/jinhongzou/FinQ4Cn-mcp-server.git
cd FinQ4Cn-mcp-server
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector python ./mcp-server/fs_server.py
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "FinQ4Cn-mcp-server": { "name": "FinQ4Cn", "command": "your_path/python.exe", "args": [ "your_path/FinQ4Cn-mcp-server/mcp-server/fs_server.py" ] } } }