- Home
- MCP servers
- Stock Data
Stock Data
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"xj-bear-stockdata-mcp": {
"command": "python",
"args": [
"g:\\\\path\\\\to\\\\stockdata\\\\server.py"
],
"env": {
"MCP_MODE": "stdio"
}
}
}
}You run a Stock Data MCP Server to query historical financial data for stocks, indices, funds, and futures using the Model Context Protocol. It supports multiple data sources, two run modes, and works with MCP clients to deliver fast, structured data for analysis and tooling.
How to use
Connect to the Stock Data MCP Server from an MCP client to query historical data for A股, 港股, and 美股 stocks, as well as common indices, funds, and futures. You can perform fuzzy searches for stocks and use the server’s convenience endpoints to fetch information, indicators, news, and global market updates. Use the stdio mode for local development and the SSE mode when deploying in Docker or remote environments.
How to install
Prerequisites: ensure you have Python 3.10 or newer installed on your system.
pip install mcp akshare pandas starlette uvicorn httpx
Run the server in the common stdio mode. This starts the server using Python directly from your local environment.
python server.py
If you prefer to test with the MCP Inspector, you can run the server through the inspector tool.
npx @modelcontextprotocol/inspector python server.py
Optional: you can also run via Node.js tooling if you have a Node.js environment and a Python runtime available.
# At project root
npm install
npx stockdata-mcp
Additional configuration and usage notes
Cherry Studio integration: Stock Data MCP Server fully supports the Stdio mode for direct use in Cherry Studio. In Cherry Studio, add a new MCP Server configuration with the following settings to connect to your local Python server.
Name: Stock Data MCP
Type: Stdio
Command: python
Args: ["g:\\path\\to\\stockdata\\server.py"]
Make sure Python can import the required packages (akshare, etc.). If the connection fails, verify that Python can run the import without errors and that Cherry Studio has permission to access the server.py path.
Available tools
get_current_time
Retrieve the current system time from the server.
get_stock_info
Fetch basic information for a stock, supporting A股, 港股, and 美股.
get_stock_indicators
Retrieve key financial indicators such as PE, PB, and ROE for a stock.
get_financial_report
Obtain a concise financial report snapshot for a stock.
get_trading_suggest
Provide simple trading suggestions based on technical indicators like MA and RSI.
get_stock_zt_pool
Get the list of stocks hitting涨停 for the day.
get_stock_lhb
Fetch 龙虎榜 data for market leaders and notable trades.
get_sector_fund_flow
Provide fund flow rankings by sector or industry.
get_stock_news
Retrieve news related to a specific stock.
get_global_news
Fetch global financial news from sources like 财联社.
query_stock_data
Query historical data for A股 stocks by name or code.
query_index_data
Query historical data for A股 indices.
query_fund_data
Query historical data for ETFs and fund products.
query_futures_data
Query domestic futures historical data.
query_us_stock_data
Query historical data for U.S. stocks by name or code.
query_us_fund_data
Query U.S. fund/ETF historical data.
query_foreign_futures_data
Query international futures historical data.
get_hk_stock_data
Query historical data for Hong Kong stocks.