AkShare MCP Server
AkShare MCP Server
Local MCP server exposing AkShare tools for A-share and index data.
Features
Query single-stock latest data:
get_a_share_quoteQuery historical bars by date range:
get_a_share_historyQuery China index snapshot:
get_china_index_snapshotBuilt-in fallback logic for unstable realtime endpoints
Related MCP server: Stock Data MCP Server
Tool List
get_a_share_quote(symbol)Input example:
000001Output: realtime quote if available, otherwise latest daily fallback
get_a_share_history(symbol, start_date, end_date, period="daily", adjust="", limit=120)Date format:
YYYYMMDDperiod:daily | weekly | monthlyadjust:"" | "qfq" | "hfq"
get_china_index_snapshot(limit=20)Snapshot source: Sina
Fallback: recent bar from index daily endpoint
Install
python3 -m venv .venv
./.venv/bin/pip install -r requirements.txtRun Server
./.venv/bin/python server.pyServer runs via stdio transport and is ready for MCP clients.
OpenCode Configuration
Add this block to your ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"akshare-finance": {
"type": "local",
"enabled": true,
"command": [
"/ABSOLUTE/PATH/TO/.venv/bin/python",
"/ABSOLUTE/PATH/TO/akshare_mcp_server/server.py"
]
}
}
}Then verify:
opencode mcp listExpected: akshare-finance shows connected.
Claude Desktop Configuration
{
"mcpServers": {
"akshare-finance": {
"command": "/ABSOLUTE/PATH/TO/.venv/bin/python",
"args": ["/ABSOLUTE/PATH/TO/akshare_mcp_server/server.py"]
}
}
}Example Prompts
"用 akshare-finance 查 000001 最近 30 个交易日"
"用 akshare-finance 查中国主要指数快照"
"用 akshare-finance 查 600519 从 20240101 到 20240301 的日线"
Notes
get_a_share_quoteandget_a_share_historyinclude fallback to Sina daily when Eastmoney realtime/history endpoints are unstable.If your network is unstable, retry once before concluding endpoint failure.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
China A-share real-time stock quotes and major indices with dual-source fallback.
Provide access to Chinese stock market data including historical prices, real-time data, news, and…
Access real-time and historical market data for China A-shares and Hong Kong stocks, along with ne…
China A-share market data over MCP: 22 tools for quotes, K-line, financials, money flow, top-trader boards, sectors, macro, convertible bonds and factor screening. Five tools need no API key, so you can connect and try it immediately.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides comprehensive access to Chinese stock market data including real-time quotes, historical prices, financial statements, technical indicators, news, and macroeconomic data for A/B/H shares through multiple data sources.3061 PyPI47MIT
- AlicenseBqualityDmaintenanceProvides comprehensive data for A-shares, Hong Kong, and US stocks alongside cryptocurrency markets, supporting technical indicators, news, and financial statements. It features automatic failover across multiple data sources to ensure reliable access to real-time and historical market information.4734MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying real-time China A-share stock and major market index quotes by stock code or Chinese name, with automatic name resolution and dual free data sources.MIT
- AlicenseNot gradedqualityBmaintenanceEnables access to live A-share market data from the Shenzhen and Shanghai exchanges, including sector turnover rankings, index bars, full-market board snapshots, and company bulletins.154 npmMIT