Connect your AI Agent (MCP)
MCP is the protocol that lets an AI Agent call external tools. Set it up once, then ask “how is the money flow on 太极实业 today” and the AI looks it up itself.
Your AI Agent (Claude Code / Codex and others) connects to our service over MCP and turns your plain-language questions into API calls. You write no code — the AI does that part.
Copy the instruction below to your AI Agent. It reads the install workflow, configures your client, and verifies the connection.
请先获取以下工作流的完整内容:
https://ashareapi.com/install-mcp-workflow.md
然后严格按照工作流,帮我完成 ashareapi MCP 的安装和验证。
我的客户端:<填写 Claude Code / Cursor / VS Code / Codex / WorkBuddy 等>
我的 API Key:<没有就写“无,先用免费工具”>
要求:
1. 不要使用 OAuth;ashareapi 使用 API Key 或免费模式。
2. 不要跳过验证。
3. 配置失败时按工作流给出具体原因和修复建议,不要猜。{
"mcpServers": {
"ashareapi": {
"type": "http",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}No key? Remove the headers line to use the free tools (quote / kline / hot / market overview / breadth / doc search). Add a key for all tools.
Setup (3 steps)
.mcp.json.cursor/mcp.json.vscode/mcp.json~/.codex/config.tomlopencode.json~/.gemini/settings.json~/.cline/mcp.jsonmcp_config.json~/.codebuddy/.mcp.json~/.workbuddy/mcp.json设置 → MCP → 手动配置~/.kimi/mcp.json~/.zcode/cli/config.jsonmimocode.jsonkilo.jsonc设置 → 集成 → 自定义 MCP~/.config/devin/mcp_config.json~/.openclaw/openclaw.json~/.hermes/config.yamlChina platforms (same URL + header, nothing to install)
Plugins · Skills · Partners → Plugins → + Add → New custom pluginMCP management → Create MCP service → httpExtensions → MCP → Add custom MCP (paste JSON)MCP plugin → fill in the URLPlugin square → custom plugin → based on MCPResponses API → tools[type=mcp] + headersAdd the block below to your config file or settings (replace ct-your-key with your key; free tools only can drop the Authorization line).
{
"mcpServers": {
"ashareapi": {
"type": "http",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcpServers": {
"ashareapi": {
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"servers": {
"ashareapi": {
"type": "http",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}[mcp_servers.ashareapi]
url = "https://api.ashareapi.com/mcp"
http_headers = { Authorization = "Bearer ct-your-key" }{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"ashareapi": {
"type": "remote",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcpServers": {
"ashareapi": {
"httpUrl": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcpServers": {
"ashareapi": {
"type": "streamableHttp",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcpServers": {
"ashareapi": {
"serverUrl": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcpServers": {
"ashareapi": {
"type": "http",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcpServers": {
"ashareapi": {
"type": "http",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcpServers": {
"ashareapi": {
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcpServers": {
"ashareapi": {
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcp": {
"servers": {
"ashareapi": {
"type": "http",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}
}{
"mcp": {
"ashareapi": {
"type": "remote",
"url": "https://api.ashareapi.com/mcp",
"oauth": false,
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcp": {
"ashareapi": {
"type": "remote",
"url": "https://api.ashareapi.com/mcp",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}服务器名称:ashareapi
服务器 URL:https://api.ashareapi.com/mcp
身份验证:Bearer ct-your-key{
"mcpServers": {
"ashareapi": {
"url": "https://api.ashareapi.com/mcp",
"transport": "http",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}{
"mcp": {
"servers": {
"ashareapi": {
"url": "https://api.ashareapi.com/mcp",
"transport": "streamable-http",
"headers": { "Authorization": "Bearer ct-your-key" }
}
}
}
}mcp_servers:
ashareapi:
url: "https://api.ashareapi.com/mcp"
headers:
Authorization: "Bearer ct-your-key"Claude Desktop: its remote connections use OAuth (per the MCP spec), so this method is not supported yet — use one of the clients above. ChatGPT (web / desktop app) can take remote MCP servers too, but via Developer mode → Apps → Create custom connector (Business / Enterprise / Edu workspaces), which has nothing to do with config.toml. Any other client that supports remote MCP with custom request headers works the same way: fill in the URL and the Authorization header. If the client cannot send custom headers (e.g. ChatGPT web custom connectors), put the key in the URL instead: https://api.ashareapi.com/mcp?key=YOUR_KEY — same tools, same quota, same rate limits as the header method. Headers are still preferred in production (keeping the key out of the URL is safer).
After restarting, just ask in chat, for example:
- How is the money flow on 太极实业 (600667) today?
- Which sectors gained the most over the last 5 trading days?
- Find me stocks with PE under 20 and ROE above 15
- Is CSI 300 expensive right now?
- What did institutions buy on the top-trader boards today?
How to confirm it works: ask it “can you look up A-share data?”, or check that ashareapi shows up in your client’s MCP list.
Which tools it exposes
The AI calls them when it needs to. In your client they show up with an ashare_ prefix (e.g. ashare_quote); you never have to remember these names.
- quote snapshot
- kline candles
- hot heat board (stock / wx whole-market / news / sector / etf) ⚠️ 5 types, different fields
- changedist breadth
- market_overview
- wiki_search doc search
- agent_search one-question data fetch (natural language -> data + evidence chain; explicitly refuses when unsupported)
- news latest news for a symbol
- flash 7x24 market-wide financial news flash
- evidence multi-source evidence (filings + news, deduped, with hashes)
- notice filings (list / detail, ~16 years back)
- orderbook five-level order book
- snapshot full profile (valuation / cap / shares / limit price)
- minute intraday (today / last 5 days)
- kline_full full-history candles (10y + optional adjustment)
- market_kline whole-market single-day candles (all A-shares in one call)
- abnormal abnormal moves / deviation (severe-move trigger / 10-day 100% deviation / watchlist)
- review market review (sector mainlines / limit-up ladder)
- limit_up limit-up pool or auction-sealed only (reason / seal amount / main-capital net)
- auction call auction (09:15–09:25 series + "touched limit-up" flag)
- market_mood market mood (break rate + 9-day money-making trend)
- limit_reason limit-up reasons (per stock, full reason text)
- broken_board broken-board history (limit-ups smashed open)
- tail_chase tail-end capital grab (whole-market ranking)
- northbound northbound holdings by sector (quarterly)
- new_high 100-day new highs (by theme)
- profile company profile (listing date / business / industry)
- finance statements
- technical indicators
- shareholder research
- dividend history
- events tags
- calendar corporate event calendar (dividends / lock-up / earnings / IPOs)
- chip chip distribution (profit ratio / avg cost / concentration)
- suspension (halted/resumed)
- buyback (A-shares / HK)
- consensus (target price + estimates)
- rating (HK/US)
- disclosure (earnings dates)
- fund flow + boards + block + margin
- lhb board split
- lhb_seats dragon-tiger seat detail (branches / hot money, Unlimited tier)
- lhb_agency institutional participation board (whole-market stock picking, net buy can be negative, Unlimited tier)
- bigorder L2 large-order flow (per-minute net amount, Unlimited tier)
- bigorder_flow L2 large-order fills (active/passive x buy/sell, Unlimited tier)
- bigorder_flow_full L2 large-order fills, full session (whole day in one call, Unlimited tier)
- bigorder_queue L2 large-order queue (cancel flags, Unlimited tier)
- bigorder_history L2 historical large-order net flow (per day, up to 100 trading days, Unlimited tier)
- bigorder_split L2 main-capital four-way split (active/passive x buy/sell + avg price, history supported, Unlimited tier)
- bigorder_rank L2 whole-market main-capital ranking (~5,568 stocks, 8 sort modes, Unlimited tier)
- margin_trade margin trading detail (balance / buy / repay)
- block_trade block trade detail (price / premium-discount / branches)
- fund_flow (A/HK money flow)
- fund_short (HK/US short selling)
- fund_south (southbound holdings)
- sector performance
- sector_valuation
- index_constituent (full constituent list)
- industry_chain industry chain (183 themes / graph / stock position)
- macro indicators
- screen factor screening
- bond convertibles
- index_list (all indices)
- score (5-dim rating)
- report (analyst reports)
- scanner (Stock Screener / scanner Agent) (natural-language conditions -> picks + citations + tool trace; BYOK; Pro)
- analyst (Analyst Agent) (snapshot -> return / benchmark / excess / hit rate; read-only)
- backtest (single stock / portfolio)
- backtest_batch (many stocks × many strategies)
- strategies list
- factors library
- playbooks library
- quote_batch many quotes (per-symbol status)
- kline_batch many K-lines (many symbols × one date range)
- snapshot_batch many full profiles (valuation / cap / shares; 300 symbols in ~0.4s)
- profile_batch many company profiles (listing date / business / industry; 100 symbols in ~6.8s)
- chip_batch many chip distributions (profit ratio / avg cost / concentration; 200 symbols in ~3.9s)
- shareholder_batch many shareholder tables (top-10 holders / float holders / holder count; 200 symbols in ~4.1s)
- finance_batch many financial statements (income / balance / cash flow; 10 symbols x 4 periods in ~4.2s)
- technical_batch many technical indicators (MA / MACD / KDJ / RSI / BOLL and 50 more — 55 fields; 500 symbols in ~1.2s)
- fund_batch many money-flow rows in one call
- ask_user ask the user when a symbol is ambiguous (returns 1-4 labelled options)
- stocks full A-share universe (code / name / listing date / industry, one call)
- etf data
- ipo calendar
- dehydrated research notes
- search
- watchlist_list list
- watchlist_add add
- watchlist_remove remove
- watchlist_quotes quotes
- usage
A classic data API makes you build the integration yourself (SDK + auth + error handling). MCP hands that job to the AI — you just describe what you want.For research-with-AI workflows, that is far less work than an SDK.
Free tools (quote / kline / hot / market overview / breadth / doc search) need no key; the rest need one (from ¥9.9 — all 92 tools unlocked).