ApocData MCP Server
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ApocData MCP Server贵州茅台最近5天行情"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@apocdata/mcp-server
The MCP (Model Context Protocol) server for 天启至数 ApocData. It wraps 46 authentication-free A-share data endpoints into MCP tools, ready to be called directly from any MCP client such as Claude Desktop / Cursor / Cline / Continue.
Data source:
https://data.tianqis.com/api/blade-dataplatform/open/data/*No API Key, no registration required (the gateway has
/open/**configured as authentication-free)Automatically passes through
X-Tdc-*metadata headers (rate-limit remaining / truncation flag / error code / cache policy)46 tools cover: quotes, valuation, financials, shareholders, money flow, limit up/down, sectors, announcements, macro, factors, and composite profiles
Installation
Method A: npx (recommended, zero installation)
Simply write npx -y @apocdata/mcp-server in the client configuration; no manual install is needed.
Method B: Global installation
npm install -g @apocdata/mcp-server
apocdata-mcp # 可执行命令Related MCP server: sfc-data-mcp
Client configuration examples
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"apocdata": {
"command": "npx",
"args": ["-y", "@apocdata/mcp-server"]
}
}
}Cursor
~/.cursor/mcp.json:
{
"mcpServers": {
"apocdata": {
"command": "npx",
"args": ["-y", "@apocdata/mcp-server"]
}
}
}Cline / Continue / other stdio MCP clients
Same as above; pass command=npx, args=["-y","@apocdata/mcp-server"].
CLI flags
apocdata-mcp --version # 打印版本号
apocdata-mcp --help # 显示完整用法Signals
SIGTERM/SIGINT: graceful shutdown. Wait for in-flight requests to complete (up to 5 seconds), then close the transport and exit.
Debug mode
The environment variable APOCDATA_DEBUG=1 writes the path/status/meta of every HTTP call to stderr:
{
"mcpServers": {
"apocdata": {
"command": "npx",
"args": ["-y", "@apocdata/mcp-server"],
"env": { "APOCDATA_DEBUG": "1" }
}
}
}Custom BASE URL
The environment variable APOCDATA_BASE_URL can point to an intranet/private deployment:
"env": { "APOCDATA_BASE_URL": "https://intranet.example.com/api/blade-dataplatform/open/data" }Timeout and retry
Environment Variable | Default | Description |
|
| Single request timeout (ms); AbortController aborts when it expires |
|
| Retry count for 5xx or network errors (excluding the first attempt); exponential backoff 500→1000→2000ms |
4xx is not retried (retrying business errors is pointless). When retries are exhausted, return the last 5xx response, or throw NetworkError (network anomaly).
Tool list (46)
Category | Tools |
A. Quotes & Valuation (10) |
|
B. Financials & Shareholders (8) |
|
C. Money Flow (8) |
|
D. Limit Up/Down & Sectors (4) |
|
E. Announcements / Surveys (2) |
|
F. Sector Constituents (4) |
|
G. Convertible Bonds (2) |
|
H. Factors (2) |
|
I. Macro (3) |
|
J. Calendar (1) |
|
K. Comprehensive (2) |
|
Each tool's inputs/outputs/defaults are exposed via JSON Schema at the MCP protocol layer; the client displays them automatically.
MCP Resources
In addition to tools, 3 markdown documents are exposed. Agents fetch them through resources/list and resources/read:
URI | Content |
| Global integration guide: 46 tool groups, symbol format, latency/rate-limit/error protocol, metadata header explanation |
| Scenario quick reference: mapping of common user intents to tool combinations + anti-patterns (avoid chaining 8 endpoints) |
| limit/fields/compact quick reference: default values/caps/field-filtering support per tool |
Usage examples (ask Claude directly)
> 帮我看下贵州茅台最近 5 天行情
(Claude 调用 daily(symbol="600519", limit=5))
> 现在涨幅榜前 10 是哪些股票?
(Claude 调用 ranking(type="gainers", limit=10))
> 整理一下平安银行的综合画像
(Claude 调用 profile-full(symbol="000001"))
> CPI 最近一次数据是多少?
(Claude 调用 macro-latest(type="cpi"))Performance and rate limiting
Per-IP rate limit: 60 req/min (the
X-Tdc-RateLimit-Remainingresponse header reports the remaining quota)Cache policy: intraday realtime data 5s, post-close daily updates 5min, metadata 1h (the
Cache-Controlheader is set automatically)The
limitparameter cap is 50; exceeding it is silently truncated (see theX-Tdc-Truncatedresponse header)For large data batches, use
format=compactcolumnar output to save 60-70% tokensInterfaces with many fields (e.g., financial, announcements) support
fields=...filtering
For detailed behavior, see the main SKILL document: https://github.com/ApocData/ApocData-skill
Development
git clone https://github.com/ApocData/ApocData-skill.git
cd ApocData-skill/mcp-server
npm install
npm run build
npm startSource tree:
src/
index.ts # MCP server 入口,stdio transport
client.ts # HTTP client,BASE_URL 调用 + meta 头提取
tools.ts # 46 个工具的配置表(声明式)To add a new endpoint, add a ToolDef to the corresponding group in tools.ts and rebuild; no other code changes are needed.
Testing
npm test # build + 6 类测试全跑(需在 tianqi-mcp 目录执行)
npm run test:unit # client 单测:超时/重试/URL 构造,不打外网
npm run test:contract # 46 工具逐个真实 HTTP 调用(happy path)
npm run test:errors # 错误路径:非法参数 / 不存在 symbol / 日期格式
npm run test:coverage # 限流头/截断头/所有枚举值遍历
npm run test:e2e # MCP 协议层:stdio JSON-RPC + isError + compact
npm run test:integration # 集成:mock HTTP + 子进程 server,验证 retries / timeout / --version / SIGTERMThe six scripts correspond to six types of verification:
Script | Verification |
| Client does not retry 4xx, retries 5xx until success/exhausted, timeout normalization, meta header extraction, URL construction (mock fetch) |
| All 46 endpoints' parameter names/required flags match the backend |
| Business errors are expressed as HTTP 200 + |
| Rate-limit header / truncation header passthrough; all valid values of every enum tool (ranking / limit-list / sector-flow / hot-rank / margin / macro) are enumerated |
| MCP protocol correctness: tools/list has 46 items, isError is correctly marked on both HTTP 4xx and |
| Real backoff duration verification; real timeout triggering; |
Private deployment: APOCDATA_BASE_URL=http://your.host/path npm test
Known LAG (pending online release)
The following capabilities are already implemented in the source (roadmap §2.1 / §5.1 / §5.3), but the version currently deployed on data.tianqis.com is not yet effective. After the backend is redeployed, no changes to the MCP server are needed and the behavior automatically recovers:
Invalid enum validation for
ranking/macro/macro/latest/macro/definition/sector-flow/hot-rank/marginX-Tdc-Error-Coderesponse headerX-Tdc-RateLimit-Remainingresponse header (remaining rate-limit quota)X-Tdc-Truncatedresponse header (notification when limit exceeds the cap; note thesafeLimittruncation inside the controller is already active, only the header notification is missing)format=compactcolumnar outputThe
/profile/fulland/factor-categoriesendpoints themselves
License
Apache-2.0
This server cannot be deployed
Maintenance
Related MCP Connectors
China A-share market data for research, backtesting and AI agents via MCP.
A-share market data over MCP: quotes, K-line, financials, money flow, boards, sectors, macro.
Provide access to Chinese stock market data including historical prices, real-time data, news, and…
Read-only China A-share data for AI agents: market, limit-up, capital flow and disclosures.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides real-time stock market data and analysis from Chinese markets through 34 MCP tools, including K-line charts, technical indicators, fundamental analysis, financial metrics, and market insights without requiring authentication or API tokens.3454MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that wraps SFC financial data API into 32 tools for comprehensive A-share market data, including real-time quotes, rankings, limit-up statistics, news, themes, financials, charts, research reports, and watchlists.-
- AlicenseNot gradedqualityFmaintenanceProvides access to Chinese mainland financial data including A-stock quotes, financial statements, industry analysis, and macroeconomics through 42 MCP tools, with automatic data source fallback and no API key required.42Apache 2.0
- AlicenseNot gradedqualityDmaintenanceProvides 11 MCP tools for querying A-share market data, financial reports, stock screening, hot topics, self-selected stocks, and LOF arbitrage using natural language, powered by East Money / Miaoxiang APIs.MIT