Repository avatar
AI Tools
v0.4.3
active

whatshot-mcp

io.github.alisen39/whatshot-mcp

Chinese trending lists, newsflashes and their history from 400+ sites, for AI clients.

Documentation

🔥 WhatsHot MCP

Give Claude, Cursor, and any MCP client live access to trending lists, newsflashes, gold prices, and historical trends from 400+ Chinese & global tech sites.

Connect in 30 Seconds · What You Can Ask · Available Tools · Self-Host Locally · Architecture & Contract

PyPI License Python MCP Registry Glama Docs


whatshot-mcp is the official open-source Streamable HTTP MCP server for WhatsHot. It works in two ways:

  1. Hosted (Zero Setup): Point your AI client directly to https://mcp.whatshot.top/mcp with a free API key.
  2. Self-Hosted (Unlimited): Install whatshot-mcp from PyPI and connect it to your own local alisen39/whatshot backend.

What You Can Ask

Once connected to Claude Code, Cursor, OpenCode, or any Streamable HTTP MCP client, you can ask:

  • "What is trending right now across Weibo, Zhihu, Bilibili, and GitHub?"
  • "Track how long topic X stayed on hot lists over the last week, where it appeared first, and what rank it peaked at."
  • "Summarize the most important Chinese financial newsflashes from Cailian Press and Wallstreetcn in the last 3 hours."
  • "Compare today's retail gold prices across Chow Tai Fook, Lao Feng Xiang, and Lukfook."

Connect in 30 Seconds (Hosted)

No local installation required.

  1. Create a free API key at whatshot.top/account/developer (keys start with wh_live_; standard accounts include 50 free calls/day, resetting at 00:00 Asia/Shanghai).
  2. Add the remote MCP server to your client config (setup guide: whatshot.top/developers):
{
  "mcp": {
    "whatshot": {
      "type": "remote",
      "url": "https://mcp.whatshot.top/mcp",
      "enabled": true,
      "headers": {
        "Authorization": "Bearer {env:WHATSHOT_API_KEY}"
      }
    }
  }
}

Uses Streamable HTTP (https://mcp.whatshot.top/mcp) with Authorization: Bearer wh_live_.... Need higher volume or offline control? Self-host it in 3 commands below.


Self-Host Locally

Run whatshot-mcp against your own local alisen39/whatshot Core daemon with no daily quota.

Requirements: Python 3.12+. Standard installation has no optional extras.

# 1. Install
python -m pip install whatshot-mcp

# 2. Copy and edit config (point [backend] url to your local WhatsHot daemon, e.g. http://127.0.0.1:6690/api/v1)
cp config.example.toml config.toml

# 3. Validate backend contract & start Streamable HTTP server (default: http://127.0.0.1:6691/mcp)
whatshot-mcp backend check --config ./config.toml
whatshot-mcp serve --config ./config.toml

Useful operational CLI commands:

whatshot-mcp config validate --config ./config.toml
whatshot-mcp backend check --config ./config.toml   # exit codes: 0 ok, 2 bad config, 3 unavailable, 4 bad contract, 5 version mismatch
whatshot-mcp version

Available Tools

At startup, whatshot-mcp fetches the backend's capability snapshot and registers only the tools supported by that backend.

Real-time Hot Lists & Discovery

ToolWhat it does
whatshot_get_capabilitiesInspect backend version, enabled capabilities, and rate/result limits
whatshot_list_sourcesList available sites and boards
whatshot_get_source_schemaInspect parameters and board definitions for a specific site
whatshot_get_currentFetch the current hot list, newsflash stream, or gold prices for one board
whatshot_get_current_batchFetch multiple boards in a single call

History, Search & Event Analysis (requires backend history-read)

ToolWhat it does
whatshot_query_historyRead historical snapshots of a board by time range
whatshot_search_historySearch past hot-list items and newsflashes by keyword
whatshot_get_trend_seriesGet capture-by-capture rank/heat timeline for one item
whatshot_get_data_coverageCheck historical coverage windows and index availability
whatshot_analyze_hot_eventAggregate cross-platform appearances, peak rank, and lifecycle for a topic
whatshot_analyze_newsflash_coverageAnalyze newsflash coverage volume and timeline for a keyword

Cloud Navigation (registered automatically when backend reports navigation=true)

ToolWhat it does
whatshot_list_navigationCursor-paged category and site directory discovery
whatshot_fetch_category_hotlistsFetch bounded current boards for an entire category

Architecture & Contract v1

AI Client ─Streamable HTTP (/mcp)→ whatshot-mcp ─HTTP Contract v1→ Local Core Daemon or WhatsHot Cloud
  • Strict boundary: whatshot-mcp never imports Core and never touches DuckDB or PostgreSQL directly. All data flows through the versioned HTTP Contract v1 (src/whatshot_mcp/contracts/v1/).
  • Transport: Streamable HTTP only (GET /health is public; GET /ready checks backend reachability and requires a valid wh_live_ key in bearer_passthrough mode).
  • Per-request auth isolation: In hosted bearer_passthrough mode, each client sends its own Authorization: Bearer wh_live_... header. Credentials are bound strictly to the current request, never shared across concurrent requests, and never logged or exposed in tool inputs/outputs.
Deployment, Security & Contract Technical Reference

Reverse Proxy & Non-Loopback Security

Unauthenticated Streamable HTTP is restricted to loopback binds. Non-loopback deployments require:

  • server.auth.mode = "bearer_passthrough" (forbids static backend keys so requests cannot silently fall back to a shared deployment identity; oauth is reserved and fails closed).
  • server.allowed_hosts declaring the preserved public Host header for SDK DNS-rebinding protection:
[server]
allowed_hosts = ["mcp.whatshot.top"]
allowed_origins = []

Environment Variable Overrides

WHATSHOT_MCP_SERVER_BIND
WHATSHOT_MCP_SERVER_PORT
WHATSHOT_MCP_SERVER_PATH
WHATSHOT_MCP_SERVER_AUTH_MODE
WHATSHOT_MCP_BACKEND_URL
WHATSHOT_MCP_BACKEND_API_KEY
WHATSHOT_MCP_BACKEND_TIMEOUT_SECONDS
WHATSHOT_MCP_BACKEND_CAPABILITIES_TTL_SECONDS

Search, Analysis & Error Semantics

  • Keyword matching: Matches title/description — Chinese by substring characters, non-CJK scripts by whole words (GPT matches ChatGPT, AI does not match said).
  • Cloud search index: Returns one evidence record per hot-list item per day (observedAt/firstSeenAt, lastSeenAt, best rank) and one per newsflash for the last 90 days. Use whatshot_get_trend_series for every raw capture of one item.
  • Bounded analysis: whatshot_analyze_hot_event and whatshot_analyze_newsflash_coverage separate scanBudget (records examined) from evidenceLimit (records returned) and always report analysisComplete, scannedCount, and coverage.
  • Errors: Failed tool calls return isError=true with stable backend error codes (e.g. UNKNOWN_SOURCE, UPSTREAM_UNAVAILABLE, DAILY_QUOTA_EXCEEDED with Retry-After and resetsAt).

Contract v1 Invariants

  • Single source of truth: Pydantic models in src/whatshot_mcp/contracts/v1/ (no hand-maintained duplicate schemas).
  • Public JSON fields use camelCase, reject undeclared fields, and require timezone-aware timestamps.
  • Success envelopes use { "data": ..., "meta": ... }; failures use ErrorEnvelope.
  • boardKey uses the canonical algorithm shared across local Core and Cloud backends.
  • Capability snapshot is validated and frozen at startup; user scopes (data:read, live:fetch) are enforced per call by the backend and never alter tools/list.

Development & Release

python -m pip install -e .
pytest
python -m build

PyPI releases use GitHub Actions Trusted Publishing (publish.yml) triggered by pushing a SemVer v<version> tag.

License

MIT License · Owned by alisen39.

No installation packages available.

Remote