Skip to main content
Glama
ngwddd

trend-radar-mcp

by ngwddd

trend-radar-mcp

ci

把 trend-radar 那个 skill 的确定性部分拆出来,做成一个有状态、可并发、按需读取的 MCP 工具。

原版 skill 保留不动,作为「判断协议 + 采集引擎」的历史版本;这个仓库是分支重写版。

一句话:原版让模型照着 1,800 行说明书跑八个阶段;这一版把取数、打分、分桶、记忆交给工具, 模型只负责判断与写作——两次调用完成一份简报。


v0.3(2026-10-19)· 两轮完成

改动

之前

现在

模型轮次(典型)

判类 → scan → entries → 写(4 轮)

scan → 写(2 轮)

工具数

6

3(scan / pack / check)

判 scope

模型先判,判不了才 broad

工具内自动判;判不进/跨类 → broad

摘要

单独再调一次 entries

scan 内联 core/watch 前 3 条(briefs)

传播分

按独立源数量阶梯

按独立源质量加权(低质转载不抬分)

真值分

corroboration 同时加 truth 和 comm

只加 comm(去掉双重计数)

边界样本

0.59 / 0.61 处置相反

borderline 带(0.55–0.65)标出来

arXiv API

每轮都抓(18 s 量级)

默认跳过,deep=true 才抓

实测:单类冷启 5–9 s(墙钟 = 最慢的源)、broad 冷启 ~13 s、缓存命中 0.07 s;扫描响应 5.9–7.3 KB(含 3 条摘要)。 没有后台任务:缓存只在请求路径上读写,超过 5 分钟就重新抓;不做定时刷新、不做启动预热。

完整设计说明:docs/design-v0.3.md · 上一版:docs/design-v0.2.md


Related MCP server: CTC Monitor MCP

架构

pipeline

radar_scan(query)
        │
        ├─ 自动判 scope(三类 / broad)· 选源(跳过 dead / 空源 / 慢源)
        ├─ 16 线程并发 + 按主机限速(arXiv 3s / Crossref 0.35s)
        ├─ 源级缓存 5 分钟 → 命中 0.07s(无后台刷新)
        ├─ 归一化 → 时间窗 → 事件级去重 → 勘误过滤
        ├─ SQLite:first_seen / times_seen / source_health
        ├─ truth = 0.4·源层级 + 0.6·证据层级
        │  comm  = 独立源质量加权 → 0.6 闸门 → 5 桶(含 borderline 标记)
        └─ digest ≤8 KB + 内联 briefs(core/watch 各前 3 条摘要)

状态与缓存都在 ~/.trend-radar/(可用 TREND_RADAR_HOME 覆盖):

~/.trend-radar/
├── state.db          # items(first_seen) + runs + source_health
├── runs/<run_id>.json# 一次扫描的全部条目与统计
└── cache/            # HTTP 响应 + 源级解析结果

工具(3 个)+ 资源

工具

作用

硬限制

radar_scan

自动判 scope + 采集 + 评分 + 分桶 + digest + 内联摘要

响应 ≤8 KB;briefs ≤8;top ≤10/桶

radar_pack

按 id / bucket 取正文与细节

ids ≤12;limit ≤20;摘要 ≤600 字

radar_check

发布前关联度 + 补搜条目打分

条目 ≤30;关键词 ≤8;补搜 ≤10

资源:radar://registry、radar://history、radar://runs、radar://runs/{run_id}、radar://runs/{run_id}/entries。

分桶语义(写简报前必须看)

bucket

含义

怎么用

core

双项达标,或单源硬证据(peer-reviewed)

可作结论主体;单源必须标出来

watch

可信但还没传开

不是噪声,往往是刚出来的论文

suspect

传得广但不可信

必须标出来,不许当事实

calibration

热榜

只校准传播度/发现遗漏,永不作内容源

discarded

双项未达标

可查,不作依据


安装

无第三方依赖,Python ≥ 3.10。

git clone https://github.com/ngwddd/trend-radar-mcp.git
cd trend-radar-mcp
python -m unittest discover -s tests      # 25 tests, no network

接到 DeepSeek Harness

在 profile 的 cordis.patch.yml 里追加(和现有 MCP 服务同一写法):

- insert:
    - id: trend-radar-mcp
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: trend-radar
        transport: stdio
        command: 'python'
        args:
          - '-m'
          - 'trend_radar_mcp'
        env:
          PYTHONIOENCODING: utf-8
          PYTHONUNBUFFERED: '1'
          TREND_RADAR_HOME: 'C:\Users\ggg\.trend-radar'
        toolCallTimeoutMs: 180000
        failOnStartupError: false

radar_scan 首轮约 5–13 秒(看是否命中缓存),失败源会逐条报出来,不会静默。

接到 Claude Desktop / 其他 MCP 客户端

{
  "mcpServers": {
    "trend-radar": {
      "command": "python",
      "args": ["-m", "trend_radar_mcp"],
      "env": { "PYTHONIOENCODING": "utf-8" }
    }
  }
}

用法(模型侧契约)

  1. 直接调 radar_scan(query="用户原话")。不要先自己判类 —— 工具会判; 判不进会自动 broad,返回 scope_source 可审计。显式 domain 永远优先。

  2. truth / comm 是引擎算的固定分,不要自己估,也不要把两个分合成一个。

  3. borderline=true(0.55–0.65)必须复核后再引用。

  4. 「新」看 new / first_seen,不要凭印象。

  5. 写完用 radar_check(bucket="core") 量关联度;<0.6 必须换角度重查。

  6. 写简报:每条必须有 URL 与日期;预印本不许写成已发表;厂商自述不算独立验证; 「本次覆盖」必须如实写失败源、降级流、跳过的空源。

这六条同时写在 MCP initialize 的 instructions 里,客户端会自动拿到。


与 v1 的行为差异

只列有意的差异:

  • 自动判 scope:关键词分类器命中单一类且置信度 ≥0.7 才用,否则 broad。

  • 质量加权传播:两个低质站互转不再等于“两家印证”;单源永远是 0.30。

  • 真值不再叠加印证加成:印证只影响传播分。

  • borderline 带:0.55–0.65 标出来,不再一刀切。

  • 默认跳过 arXiv API:deep=true 恢复(4 分类 × 3s 礼貌间隔)。

  • 状态:first_seen 写入 SQLite;is_new = 首次见到发生在窗口内。

  • 空源:连续 3 次 0 条 → 12 小时跳过,恢复自动解除。

判据没有放松:0.6 闸门、单源硬证据通道、撤稿短路、热榜封顶、front-matter、 身份去重全部保留。


测试

python -m unittest discover -s tests -v
python tests/smoke_stdio.py      # 真启一个 stdio server,跑握手/工具/资源

tests/test_scan.py 用 fixture 替掉网络层,验证分桶、is_new、first_seen 稳定性、 broad 与 stream fallback;tests/test_core.py 覆盖权重、身份、front-matter、去重、关联度、 质量加权的传播分。


路线

  • ETag / If-Modified-Since 条件请求

  • since_run 增量:只回上次之后的新事件

  • 同一 event_id 的演进时间线

  • 状态库样本 ≥20/源后,开 source 权重校准

  • 采集适配器拆成 sources/,每个 kind 一个文件

License

MIT · 与原版 skill 同作者、同许可。判据与权重的出处见源码注释。

Available Tools

3 tools
radar_checkA

发布前自检:关联度(方向性覆盖)+ 补搜条目打分,一次调用。 硬约束:量的是准备发布的条目(bucket=core 或显式 entries),不要传全池;关键词 ≤ 8;补搜条目 ≤ 10 且必须带 url;<0.6 必须重查后再写。

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNo
bucketNocore
domainNobroad
run_idNo
entriesNo
externalNo
keywordsNo

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden. It usefully reveals the score gate behavior ('<0.6 must re-verify before writing') and the scoping constraints, which is genuine behavioral value. But it never states whether the call mutates state or is a safe read, nor what it returns, leaving important behavior inferred rather than stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tightly packed sentences: the purpose is front-loaded, then the hard constraints follow in a labeled clause. Very little waste, though the compressed constraint block assumes prior familiarity with the surrounding workflow vocabulary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations, no output schema, and 7 params at 0% schema coverage, the description should carry heavy load. It covers the operationally critical constraints well but omits query/domain/run_id semantics and any hint of the response shape, leaving the definition only partially complete for a tool this parameterized.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does explain bucket (bucket=core), entries (explicit entries), keywords (≤ 8), and the supplementary/external list (≤ 10, must include url). But query, domain, and run_id are left entirely undocumented, so only part of the 7-parameter surface gains meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific operation (发布前自检 = pre-publication self-check) and enumerates its two outputs: relevance/directional coverage and scoring of supplementary entries. It clearly reads as a measurement/validation tool, but it never distinguishes itself from the sibling tools radar_scan or radar_pack, so an agent cannot tell them apart without external context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete usage context (pre-publication) and explicit exclusions such as 'measure the entries about to be published (bucket=core or explicit entries), do not pass the whole pool'. These are real when/when-not constraints. However, it does not name an alternative tool or state which situations should route to radar_scan/radar_pack instead, so it stops short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

radar_packA

按 id / bucket 取正文与细节。只在 digest 不够写的时候用。 硬约束:ids ≤ 12;limit ≤ 20;默认只给 scores+flags,要正文必须显式 fields=['summary'];摘要默认 240 字。

ParametersJSON Schema
NameRequiredDescriptionDefault
idsNodigest 里的 id(支持前缀)。给了 ids 就忽略 bucket。
limitNo
bucketNo
fieldsNo
offsetNo
run_idYes
summary_charsNo

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It usefully discloses that the default return is only scores+flags and that summary text requires explicitly setting fields=['summary'], which is a real calling gotcha. However, the stated caps (ids ≤ 12, limit ≤ 20, 240-char summary) merely restate schema limits, and it never states the read-only nature, pagination/offset behavior, or what 'digest' refers to.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense clauses with zero filler: purpose first, then usage condition, then hard constraints. Every sentence is front-loaded and carries information relevant to invocation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter tool with no annotations, no output schema, and 14% schema coverage, the description covers purpose, usage, and the key default-fields behavior but leaves several parameters and the response structure under-specified. Adequate to call it, but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 14%, so the description must compensate, and it partially does by explaining ids/limit/fields/summary_chars constraints and the id-vs-bucket selection modes. But it leaves bucket semantics, offset, and run_id unexplained, and most of what it says about ids/limit duplicates the schema's own maxItems/maximum values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: fetch body text and details (取正文与细节) by id or bucket. This is clearly distinct from a scan/check operation, but it never names the siblings radar_scan or radar_check, and instead references a 'digest' that is not a listed tool, so sibling differentiation is only implied.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit usage condition: use only when the digest is not enough for writing (只在 digest 不够写的时候用). This tells the agent when to reach for this tool versus staying with summary-level output, though it never names the actual alternative tools (radar_scan / radar_check), leaving routing partly to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

radar_scanA

采集 + 评分 + 分桶,一次调用给出可写简报的材料。

scope 自动判定:不给 domain 时按 query 判三类;判不进(或跨类)→ broad 全量 42 源。显式 domain 永远优先。返回 scope_source 说明是 auto / explicit / auto-broad。

返回 digest(每桶 top N:id/标题/truth·comm/来源/日期/new),并对 core、watch 的前 briefs 条内联摘要(默认 3 条 × 240 字)。多数情况下一次调用就够写;要更多正文再用 radar_pack。

硬约束:truth/comm 由引擎算,0.6 是闸门,禁止自己估;borderline=true 表示分数在 0.55–0.65,必须复核后再引用;calibration 桶只校准传播度,永不作内容源。

ParametersJSON Schema
NameRequiredDescriptionDefault
topNo
daysNo
deepNotrue 才抓 arXiv API(4 分类 × 3s 礼貌间隔,最慢的源)。默认跳过,用它的 RSS 代替。
queryYes用户原话。用于自动判 scope 与关联度,不要改写。
briefsNo内联多少条摘要(core 优先,再 watch)。0=只要 digest。
domainNoauto=按 query 判;判不进自动 broad。显式给则覆盖。auto
streamsNo默认三路。只查一路时给,省时间。
externalNoweb_search 补搜条目(title/url/source/date/summary)。
keywordsNo
major_daysNo重大事件宽窗。进来的条目 in_window=false,引用必须写明日期不在基础窗口。
brief_charsNo
force_refreshNo
max_per_sourceNo

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations the description must carry the burden, and it does: it discloses engine-computed truth/comm with a 0.6 gate, the 0.55–0.65 borderline flag requiring review, and that the calibration bucket is never a content source. These are real behavioral constraints an agent cannot get elsewhere. Minor gaps around performance/cost are not covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core pipeline and output promise, then layers scope logic and hard constraints in short, dense lines with no filler sentences. Tightly organized despite the volume of caveats.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description must describe returns, and it does: digest fields (id/标题/truth·comm/来源/日期/new), inline summary depth, and scope_source. Combined with the constraint notes this is nearly complete for a 13-param orchestration tool, with only peripheral params left undocumented.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 54% across 13 params. The description adds meaning for domain (auto/explicit/broad fallback), briefs, and major_days ('in_window=false 需写明日期'), but leaves top, days, streams, brief_chars, force_refresh, and max_per_source to the schema. Partial compensation, so baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific three-step pipeline (采集 + 评分 + 分桶) and its output (可写简报的材料), so the verb+resource is unambiguous. It explicitly distinguishes itself from radar_pack ('要更多正文再用 radar_pack'), but the third sibling radar_check is never mentioned. Strong, though not fully sibling-differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a concrete default-use rule ('多数情况下一次调用就够写') and names the alternative (radar_pack) plus the condition that selects it (need more body text). Also explains scope auto-detection behavior to guide invocation. No explicit when-not-to-use against radar_check, so not a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.3.1
    • First observedradar_check
    • First observedradar_pack
    • First observedradar_scan

TDQS

A4/5.0

Scored across 3 tools

Disambiguation5/5

The three tools form a clear pipeline: radar_scan for discovery/scoring, radar_pack for detail retrieval when the digest is insufficient, and radar_check for pre-publish verification. Each has a distinct role and explicit usage conditions, so an agent can easily tell them apart.

Naming Consistency5/5

All tool names follow the same consistent pattern: the `radar_` prefix followed by a verb (`scan`, `pack`, `check`) in snake_case. There is no mixing of conventions or vague naming.

Tool Count5/5

Three tools is well-scoped for a focused trend-scouting pipeline. Each tool corresponds to a distinct stage (collect/score, fetch details, verify) and none feels redundant or extraneous.

Completeness4/5

The set covers the core workflow: discovering trends, retrieving details, and validating before publication. A minor gap exists in source management (e.g., no explicit tool to list available domains or sources), but this does not block the primary purpose of preparing brief material.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Aggregates news from 7 APIs and unlimited RSS feeds with AI-powered bias removal and synthesis. Provides over 7,300 free daily requests with conversation-aware caching and 25 comprehensive news analysis tools.
    1
    -
  • A
    license
    A
    quality
    D
    maintenance
    Provides AI agents with global tech news from 500+ sources across regions, with translated titles, scoring, and clustering tools for real-time intelligence.
    8
    22 npm
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides AI assistants with access to TrendRadar's aggregated news feeds, enabling intelligent analysis, personalized filtering, and multi-channel notifications for real-time hot topics.
    27
    GPL 3.0
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to ingest AI-related content from RSS/Atom feeds, Hacker News, and GDELT, then cluster items into curated stories and retrieve a ranked feed through MCP tools.
    MIT