Dev.to AI 🤖 Ai 👁 0 📖 6 min read

How AI Agents Pull A-Share Heat Data via MCP in About Five Minutes

Most LLM agents that touch Chinese equities hit the same wall: the model can reason about a sector, but it has no structured, timely view of what the market is actually talking about. Scraping forums and news sites is br

Most LLM agents that touch Chinese equities hit the same wall: the model can reason about a sector, but it has no structured, timely view of what the market is actually talking about. Scraping forums and news sites is brittle, slow, and full of raw text you probably should not be redistributing.

Lava (熔岩) is a read-only data service that turns A-share news flow into structured heat signals for stocks and concept boards, exposed over both MCP and REST. This post walks through what the data means, which tools exist, and how to wire an agent to it quickly.

Lava returns attention/heat data only. No bullish/bearish labels, no original text, no price targets, and nothing in this article is investment advice.

What "heat" means in Lava

Lava counts and weights mentions of A-share stocks and concept boards across institutional notes, commentators, and mainstream financial news. Sources are anonymized into stable IDs (for example an agency ID), so you can track source quality without seeing names or source text.

Three data categories matter most for agents:

1. Heat (stock and board level)

  • Raw heat: how often a stock or concept was mentioned in a time window (1h to 7d).
  • Weighted heat: mentions weighted by the historical score of the source. A mention from a high-scoring source counts more than one from a noisy account.
  • Acceleration: change in heat versus the previous window, i.e. "what is suddenly getting hotter".

2. Concept rotation

A-share narratives move through concept boards (AI computing, solid-state batteries, low-altitude economy, etc.). Lava tracks:

  • which concepts are hottest market-wide right now;
  • which stocks drive the heat inside a concept;
  • which concepts a given stock is currently most associated with.

Comparing those across windows gives you a rotation view: attention leaving one board and arriving at another.

3. First-mention

A first-mention is a stock that had zero mentions in the previous 7 days and just got its first one. It is a novelty signal: useful for "what entered the conversation today" digests, and a natural input for research triage.

The tool surface

The MCP server and the REST API share one schema. Tool names below match the OpenAPI operationIds, so an agent can resolve them deterministically.

Market-wide lists

Tool (operationId) Path Key params Returns
listHotStocks GET /hot/stocks window, market, min_score, limit Most-mentioned stocks in window
listHotConcepts GET /hot/concepts window, min_score, limit Hottest concept boards
listWeightedHotStocks GET /hot/weighted as_of_date, days, min_score, order, market, limit Heat weighted by source score
listAcceleratingHotStocks GET /hot/accelerating window, order, min_mentions, market, limit Momentum-sorted heat changes
listFirstMentions GET /hot/first-mentions hours, min_score, limit Stocks first mentioned after 7 quiet days

Single stock / single concept

Tool Path Key params Returns
getStockHeatWindows GET /heat/windows stock_name or ts_code, min_score Heat for 1h…7d windows + hourly last 24h
listOpinionsByStock GET /opinions ts_code, days, start_date, end_date, only_this_stock, limit Mention records (structured, no text)
listConceptStocks GET /concepts/stocks concept, days, limit Top-mentioned stocks inside a concept
listStockConcepts GET /concepts/by-stock ts_code, days, limit Hottest concepts linked to a stock
getStockAgencyCoverage GET /coverage/stocks ts_code, days, min_score Source-coverage time series
listNewsStockHits GET /news/hits ts_code, hours, src, limit Stocks named in mainstream news

History and source quality

Tool Path Key params Returns
getDailyHeatPanel GET /panel/daily type, codes, names, from, to Daily panel (mentions, source count, weighted heat) for backtests
listAgencyRanking GET /agencies/ranking order, min_score, limit, offset Current source scores
listAgencyPit GET /agencies/pit as_of_date, agency_id, min_score Point-in-time source scores
getAgencyHistory GET /agencies/{agency_id}/history start_date, end_date Score history of one source
searchOpinions GET /opinions/search keyword, since, limit Keyword search over mention records
getAccount GET /account — Balance and usage (free call)

ts_code uses the Tushare-style format, e.g. 300750.SZ, 688256.SH.

Point-in-time (PIT) scores matter if you backtest: listAgencyPit gives source scores as they were on as_of_date, so weighted heat in your backtest does not leak future information.

Five-minute setup

Step 1: get a key

Sign up, copy your API key (format lvk_…), and note the MCP endpoint URL from the docs. Keys go in a header:

Authorization: Bearer lvk_xxxxxxxx

Never commit the key; read it from an environment variable.

Step 2: register the MCP server

Most MCP clients (Claude Desktop, Cursor, Cline, custom agents) accept a remote HTTP server entry like this:

{
  "mcpServers": {
    "lava": {
      "url": "<LAVA_MCP_URL>",
      "headers": {
        "Authorization": "Bearer ${LAVA_API_KEY}"
      }
    }
  }
}

Restart the client; it should list the tools above.

Step 3: sanity check

Call getAccount first. It costs nothing and confirms auth. Then try:

listHotConcepts(window="24h", limit=10)

Step 4: REST fallback

If your agent framework does not speak MCP, the same data is plain HTTP:

curl -s "$LAVA_BASE/hot/first-mentions?hours=24&min_score=60&limit=20" \
  -H "Authorization: Bearer $LAVA_API_KEY"
import os, requests

BASE = os.environ["LAVA_BASE"]
H = {"Authorization": f"Bearer {os.environ['LAVA_API_KEY']}"}

def lava(path, **params):
    r = requests.get(f"{BASE}{path}", headers=H, params=params, timeout=20)
    r.raise_for_status()
    return r.json()

concepts = lava("/hot/concepts", window="24h", limit=10)

Three agent patterns that work

Pattern A: morning attention digest

Goal: a short brief of "what the market is discussing", generated before the open.

  1. listHotConcepts(window="24h", limit=10) → top boards.
  2. For the top 3 boards: listConceptStocks(concept=..., days=1, limit=5).
  3. listFirstMentions(hours=24, min_score=60, limit=10) → new names.
  4. listAcceleratingHotStocks(window="24h", min_mentions=3, limit=10) → movers in attention.

Prompt the model to describe attention only: "rank by heat, note rotation versus yesterday, list first-mentions". Instruct it explicitly not to produce buy/sell language.

Pattern B: concept rotation tracker

Run listHotConcepts at window="24h" and window="7d" and diff the ranks. A concept high on 24h but low on 7d is newly rotating in; the reverse is cooling off. Store daily snapshots, or skip the bookkeeping and pull getDailyHeatPanel(type="concept", names=...) for history.

Pattern C: single-stock context for a research agent

When a user asks about a ticker, have the agent fetch:

  • getStockHeatWindows(ts_code=...) for the 1h–7d curve;
  • listStockConcepts(ts_code=..., days=7) for which narratives it is riding;
  • getStockAgencyCoverage(ts_code=..., days=30, min_score=60) to see if coverage breadth is growing or shrinking.

This gives the model grounded context ("heat is concentrated in the last 6 hours, mainly via the AI computing board, with coverage from more high-score sources than last week") instead of hallucinated sentiment.

Practical notes

  • Use min_score on most calls. Filtering to higher-scored sources removes a lot of noise.
  • Prefer ts_code over names to avoid ambiguity.
  • Cache market-wide lists for a few minutes; agents tend to call them repeatedly in one session.
  • Pricing is per call (roughly 1,000 calls for 5 RMB), so cap limit and avoid loops that fan out over every stock in a board.
  • Compliance by design: no raw text and anonymized sources make it easier to show outputs to end users without redistribution issues.

Example: what a board heat page looks like

If you want to see the data before writing code, the AI board heat monitor (https://lava.ai-dolphin.com/monitor/board-ai-heat) shows a concept heat series built from these same endpoints.

Wrap-up

An agent with Lava attached can answer "what is the A-share market paying attention to, and how is that changing?" with structured numbers instead of guesses. Setup is one header and one server entry; the useful part is combining heat, concept rotation, and first-mention into workflows.

Research notes, methodology, and worked examples are here: https://lava.ai-dolphin.com/research

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.