FinQ4Cn
适合国内使用的量化金融mcp server
claude mcp add --transport stdio jinhongzou-finq4cn-mcp-server python mcp-server/fs_server.py
How to use
FinQ4Cn MCP Server is a Python-based MCP server built on top of the akshare library to provide open-source access to financial data for China's A-share market. It exposes tools for common stock metrics, news data, and backtesting strategies, enabling quantitative analysts and domestic investors to retrieve stock fundamentals, historical prices, margins, dividends, and related market insights. Users can interact with the server through MCP integration guides or the MCP inspector to run queries against the available modules such as stocks_common_metrics, news report, and BackTesting, then analyze results within Cherry Studio or via the MCP inspector interface.
To use the server, start it via the configured Python entry point and connect through your MCP tooling. The available tools include:
- stocks_common_metrics: pull stock codes by name, obtain a company’s main business structure, fetch historical price data, retrieve financial abstracts, margin trading details, and dividend history.
- news report: fetch latest financial news and stock-specific articles within a date range.
- BackTesting: run a backtesting strategy such as buying when not held with a specified holding percentage and stop-profit target. The example strategy demonstrates evaluating performance on historical stock data using the provided parameters. You can invoke these tools within your MCP client (e.g., Cherry Studio or MCP inspector) and receive structured results suitable for further analysis, charting, or reporting.
How to install
Prerequisites:
- Python 3.8+
- Git
- Internet access to install dependencies from PyPI
Step-by-step installation:
-
Clone the repository: git clone https://github.com/jinhongzou/FinQ4Cn-mcp-server.git cd FinQ4Cn-mcp-server
-
Set up a virtual environment: python -m venv venv
On Windows:
venv\Scripts\activate
On macOS/Linux:
source venv/bin/activate
-
Install required Python packages: pip install -r requirements.txt
-
(Optional) Install backtesting package recommended by the project: pip install lib-pybroker -i https://pypi.tuna.tsinghua.edu.cn/simple
-
Run the MCP server: python mcp-server/fs_server.py
Notes:
- Ensure you have network access to fetch data via akshare. Some data sources may require additional configuration or API keys depending on the akshare backend.
- If you modify code, re-run the server to apply changes.
Additional notes
Common issues and tips:
- Python environment: Use a dedicated virtual environment to avoid conflicts with system packages.
- Dependency availability: The server relies on akshare and related data sources; if data retrieval fails, verify network access and upstream data source status.
- Performance: For backtesting and large data ranges, consider running on a machine with adequate RAM and CPU resources.
- Configuration: The default MCP integration uses the built-in Python entry and fs_server.py; if you restructure paths, update the mcp_config accordingly.
- Debugging: When using MCP inspector, you should see startup messages and a listening proxy; ensure port 6277 (proxy) and 6274 (Inspector) are not blocked by firewalls.
Related MCP Servers
ai-engineering-hub
In-depth tutorials on LLMs, RAGs and real-world AI agent applications.
MAI-UI
MAI-UI: Real-World Centric Foundation GUI Agents ranging from 2B to 235B
5-Day-AI-Agents-Intensive-Course-with-Google
5-Day Gen AI Intensive Course with Google
sparql-llm
🦜✨ Chat system, MCP server, and reusable components to improve LLMs capabilities when generating SPARQL queries
pydata-london-2025
Multi-Agent AI Orchestration Workshop
jupyter
🪐 Model Context Protocol (MCP) Server for Jupyter