Skip to main content
Glama

Horizon MCP

面向 Horizon 的 MCP Server。

服务直接复用 Horizon 原生 Python 实现,按阶段暴露工具,不重复造业务逻辑。

1. 能力概览

工具(Tools)

  • hz_validate_config:校验 Horizon 配置有效性与关键环境变量是否齐全。

  • hz_fetch_items:抓取并去重新闻内容,写入 raw 阶段。

  • hz_score_items:调用 AI 对指定阶段内容打分,写入 scored 阶段。

  • hz_filter_items:按分数阈值过滤并做主题去重,写入 filtered 阶段。

  • hz_enrich_items:对高分内容执行背景富化,写入 enriched 阶段。

  • hz_generate_summary:从指定阶段内容生成 Markdown 摘要。

  • hz_run_pipeline:一键执行抓取、打分、过滤、富化、摘要全流程。

  • hz_list_runs:列出最近 run 记录及各阶段产物状态。

  • hz_get_run_meta:读取指定 run 的元数据。

  • hz_get_run_stage:读取指定 run 的阶段内容(raw/scored/filtered/enriched)。

  • hz_get_run_summary:读取指定 run 的摘要内容。

  • hz_get_metrics:读取服务内存指标与调用统计。

资源(Resources)

  • horizon://server/info

  • horizon://metrics

  • horizon://runs

  • horizon://runs/{run_id}/meta

  • horizon://runs/{run_id}/items/{stage}

  • horizon://runs/{run_id}/summary/{language}

  • horizon://config/effective

Related MCP server: mult-fetch-mcp-server

2. 前置要求

  1. Python 3.11+

  2. 本地可访问 Horizon 仓库(自动发现顺序)

  • $HORIZON_PATH

  • ./Horizon

  • ../Horizon

  • /Users/Zhuanz/work-space/Horizon

  • /tmp/Horizon

  1. Horizon 配置文件存在:<horizon_path>/data/config.json

  2. (可选)MCP 密钥配置文件(避免手动 export):

  • .cursor/mcp.secrets.json

  • .cursor/mcp.secrets.local.json

  • config/mcp.secrets.json

  • config/mcp.secrets.local.json

  • <horizon_path>/data/mcp.secrets.json

  • <horizon_path>/data/mcp-secrets.json

支持字段:

{
  "OPENAI_API_KEY": "sk-xxxx",
  "GITHUB_TOKEN": "ghp_xxxx"
}

也支持嵌套写法:

{
  "env": {
    "OPENAI_API_KEY": "sk-xxxx",
    "GITHUB_TOKEN": "ghp_xxxx"
  }
}

3. 安装与启动

cd /Users/Zhuanz/work-space/Horizon-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e .

# stdio 启动(给 MCP 客户端使用)
horizon-mcp

4. 运行产物

每次 run 会写入:data/mcp-runs/<run_id>/

  • meta.json

  • raw_items.json

  • scored_items.json

  • filtered_items.json

  • enriched_items.json

  • summary-<lang>.md

5. 设计原则

  1. 默认无外部副作用:不自动写 Horizon docs、不自动发邮件。

  2. 阶段可重入:同一 run_id 可分步执行。

  3. 保持主逻辑一致:抓取、评分、富化、总结全部复用 Horizon 原生模块。

6. 客户端接入

接入示例见:docs/integration.md

快速连通检查:

cd /Users/Zhuanz/work-space/Horizon-mcp
make check-mcp

7. Git 身份(当前仓库)

本仓库已设置:

  • user.name=henry-insomniac

  • user.email=lovedangdang@outlook.com

Available Tools

12 tools
hz_enrich_itemsC

对高分内容执行背景富化,写入 enriched 阶段。

Inputs: run_id (required), source_stage, horizon_path, config_path. Returns: object

hz_fetch_itemsC

抓取并去重内容,写入 run 的 raw 阶段。

Inputs: hours, run_id, horizon_path, config_path, +1 more. Returns: object

hz_filter_itemsC

按阈值过滤并做主题去重,写入 filtered 阶段。

Inputs: run_id (required), threshold, source_stage, topic_dedup, +2 more. Returns: object

hz_generate_summaryC

从某阶段内容生成 Markdown 摘要。

Inputs: run_id (required), language, source_stage, horizon_path, +2 more. Returns: object

hz_get_metricsB

读取服务内存指标。

Inputs: no named parameters. Returns: object

hz_get_run_metaB

读取指定 run 的元数据。

Inputs: run_id (required). Returns: object

hz_get_run_stageC

读取指定 run 的某一阶段内容。

Inputs: run_id (required), stage (required), max_items. Returns: object

hz_get_run_summaryC

读取指定 run 的摘要内容。

Inputs: run_id (required), language. Returns: object

hz_list_runsC

列出最近运行记录与阶段状态。

Inputs: limit. Returns: object

hz_run_pipelineC

一键执行抓取->打分->过滤->富化->摘要。

Inputs: hours, languages, threshold, horizon_path, +5 more. Returns: object

hz_score_itemsC

对指定阶段内容执行 AI 打分,写入 scored 阶段。

Inputs: run_id (required), source_stage, horizon_path, config_path. Returns: object

hz_validate_configC

校验 Horizon 配置和关键环境变量。

Inputs: horizon_path, config_path, sources, check_env. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no ambiguity. Tools like hz_fetch_items, hz_score_items, hz_filter_items, hz_enrich_items, and hz_generate_summary represent sequential stages in a content processing pipeline, while others handle metadata, metrics, configuration, and pipeline execution, all with non-overlapping functions.

    Naming Consistency5/5

    All tool names follow a consistent hz_verb_noun pattern with snake_case throughout. The naming is predictable and readable, making it easy to understand each tool's function at a glance, such as hz_list_runs, hz_get_metrics, and hz_run_pipeline.

    Tool Count5/5

    With 12 tools, the count is well-scoped for a content processing pipeline server. Each tool earns its place by covering distinct aspects like pipeline stages, metadata access, metrics, configuration validation, and full pipeline execution, without being excessive or insufficient.

    Completeness5/5

    The tool set provides complete coverage for the content processing domain. It includes all pipeline stages (fetch, score, filter, enrich, summarize), metadata and summary retrieval, run listing, metrics monitoring, configuration validation, and a full pipeline execution tool, leaving no obvious gaps for agent workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      A content exploration MCP server that helps LLMs surface high-signal, unsummarized web content through clean APIs and Markdown conversion, with intelligent frontmatter steering and citation tracking.
      13
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      An MCP server that enables AI assistants to fetch web content in multiple formats (HTML, JSON, text, Markdown) with intelligent content extraction, chunk management, and browser automation support.
      6
      165 npm
      15
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that fetches web pages and extracts clean, AI-usable context from them, enabling tools for link discovery, content search, and integrated fetch-and-search operations.
      5
      14 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A production-grade MCP server providing four tools for URL summarization, content repurposing, news digests, and competitor analysis, with cost telemetry and dual transport support.
      MIT