Skip to main content
Glama
agentladle

mcp-hkexnews

by agentladle

AgentLadle MCP HKEXnews

English | 中文

🇨🇳/🇭🇰 云端托管的 MCP,适用于 A 股及港股上市公司(近 3 年年报及最新中期报告)。了解更多 | 获取 API Key

一个 MCP(模型上下文协议) 服务器,提供用于从 HKEXnews 发现、下载、解析和搜索香港上市公司公告的工具。

它使 AI 助手(Claude、Cursor 等)能够通过 6 个结构化工具访问 HKEXnews 公告数据——从发现可用公告到在其页面内进行关键词搜索。

范围(v0.1): 公告及披露,但不包括完整定期报告 PDF(t1=40000 下的年报 / 中期报告 / 季度报告及 ESG 报告)。业绩公告(全年 / 中期 / 季度业绩)包含在内。

功能特性

  • 6 个 MCP 工具,用于 HKEXnews 公告数据:状态驱动的检索(直接搜索,仅在需要时回退到下载/解析)

  • PDF 文档解析,使用 PyMuPDF——将物理页面提取为按页拆分的 JSON

  • 本地关键词搜索,采用 TF + 位置加权评分,零外部搜索依赖

  • 幂等——已下载/解析的文件会自动跳过

  • 零配置安装——只需在 MCP 客户端中添加一行,无需克隆或手动设置

  • 纯 Python,跨平台(Windows / macOS / Linux)

Related MCP server: sfc-data-mcp

前置要求

注意: 安装 uv 后,请重启终端和 MCP 客户端(如 Cherry Studio),以确保 uv 命令可被识别。

快速开始

添加到您的 MCP 客户端配置(Claude Desktop、Cursor 等):

{
  "mcpServers": {
    "mcp-hkexnews": {
      "command": "uvx",
      "args": ["agentladle-mcp-hkexnews"]
    }
  }
}

就这样。uvx 会自动从 PyPI 下载该包及其依赖项——无需克隆、无需手动安装、无需路径配置。

备选方案:pip 安装

如果您更倾向于自行管理环境:

pip install agentladle-mcp-hkexnews

然后配置:

{
  "mcpServers": {
    "mcp-hkexnews": {
      "command": "agentladle-mcp-hkexnews"
    }
  }
}

备选方案:从源码运行(本地开发)

克隆仓库并直接运行:

git clone https://github.com/agentladle/mcp-hkexnews.git

然后配置您的 MCP 客户端:

{
  "mcpServers": {
    "mcp-hkexnews": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/mcp-hkexnews", "agentladle-mcp-hkexnews"]
    }
  }
}

/path/to/mcp-hkexnews 替换为克隆仓库的实际路径。

数据流

HKEXnews API                      Local Files (~/.agentladle/mcp-hkexnews/data/)
──────────────                    ──────────────────────────────
activestock_sehk_e.json  ──→     companies.json               (stock_code→stockId mapping)
ListOfSecurities.xlsx      ──→         │
tierone/tiertwo JSON       ──→     tiers.json                   (headline category mapping)
                                     │
titleSearchServlet.do    ──→        pdf/{LOCAL_KEY}/            (Tool 2: primary PDF/HTML + manifest)
                                     │
PyMuPDF parsing          ──→        json/*.json                 (Tool 3: parse, page-split)
                                     │
Local TF search          ──→        search results              (Tool 4: keyword search)
Page range read          ──→        page content                (Tool 5: read pages)

工具

#

工具

描述

1

list_hkexnews_announcements

发现某家公司的可用 HKEXnews 公告

2

download_hkexnews_announcement

下载公告 PDF(HTML 回退);幂等

3

parse_hkexnews_announcement

使用 PyMuPDF 将 PDF/HTML 解析为按页拆分的 JSON

4

keyword_search

全文关键词搜索,采用 TF 相关性评分

5

get_announcement_pages

按页码范围读取公告内容

6

lookup_stock_code

诊断:在解析失败时查找 stock_code→stockId 映射

工具 1:list_hkexnews_announcements

列出某家公司的可用 HKEXnews 公告。仅当用户未指定确切日期/标题,或下载尝试因匹配不明确而失败时,才使用此工具。排除完整定期报告 PDF(t1=40000 下的年报 / 中期报告 / 季度报告及 ESG 报告)。

参数

类型

必填

描述

stock_code

string

5 位港股代码,例如 "00700"

category

string

HKEX t1/t2 代码或层级名称,例如 "Inside Information""13500""20000"。省略则列出所有范围内的类别

start_date

string

开始日期 YYYY-MM-DD

end_date

string

结束日期 YYYY-MM-DD

title_keyword

string

标题关键词筛选

limit

int

最大返回公告数,默认 10,最大 50

工具 2:download_hkexnews_announcement

从 www1.hkexnews.hk 下载特定的 HKEXnews 公告。当 list_hkexnews_announcements 返回 local_key 时优先使用。幂等。

参数

类型

必填

描述

stock_code

string

5 位港股代码,例如 "00700"

release_date

string

发布日期 YYYY-MM-DD(如果提供了 local_key 则可选)

title_keyword

string

用于区分同日公告的标题子串

category

string

可选的类别筛选

news_id

string

HKEXnews NEWS_ID(如果已知)

local_key

string

列表结果中的精确本地捆绑键

工具 3:parse_hkexnews_announcement

将已下载的公告 PDF/HTML 解析为按页拆分的 JSON。使用 PyMuPDF 进行 PDF 物理页面文本提取。

参数

类型

必填

描述

local_key

string

列表/下载返回的捆绑键,例如 "00700_13500_2026-03-15_a1b2c3d4"

工具 4:keyword_search

跨所有页面的全文关键词搜索。结果按 TF + 位置加权分数排序。

参数

类型

必填

描述

local_key

string

捆绑键

keywords

string[]

1–5 个搜索关键词

match_mode

string

"ANY"(默认,任一关键词匹配)/ "ALL"(全部必须匹配)

max_results

int

最大返回结果数,默认 5,最大 50

工具 5:get_announcement_pages

按页码范围读取完整页面内容。

参数

类型

必填

描述

local_key

string

捆绑键

start_page

int

起始页码(从 1 开始)

page_count

int

要返回的页数,默认 3,最大 5

工具 6:lookup_stock_code

诊断工具:查找 stock_code→stockId 映射。仅当 download_hkexnews_announcement / list_hkexnews_announcements 返回 Stock code not found 时使用。绕过会话失败代码缓存。

参数

类型

必填

描述

stock_code

string

5 位港股代码,例如 "00700"

refresh

bool

强制重新下载 HKEX 公司映射(默认:false

配置

首次运行时,会在 ~/.agentladle/mcp-hkexnews/config.yaml 创建默认配置文件:

paths:
  data_dir: "~/.agentladle/mcp-hkexnews/data"
  pdf_dir: "~/.agentladle/mcp-hkexnews/data/pdf"
  json_dir: "~/.agentladle/mcp-hkexnews/data/json"

download:
  delay_between_requests: 0.3
  min_file_size: 500
  list_row_range: 100
  list_max_pages: 5

company:
  cache_ttl_days: 7

tiers:
  cache_ttl_days: 7

数据目录结构

~/.agentladle/mcp-hkexnews/
├── config.yaml                        # Configuration (auto-created)
└── data/
    ├── companies.json                 # stock_code→stockId mapping (auto-downloaded & cached)
    ├── tiers.json                     # HKEX headline category mapping (auto-downloaded & cached)
    ├── pdf/                           # Downloaded announcement bundles
    │   ├── 00700_13500_2026-03-15_a1b2c3d4/
    │   │   ├── primary.pdf
    │   │   └── manifest.json
    │   └── ...
    └── json/                          # Parsed page-split JSON
        ├── 00700_13500_2026-03-15_a1b2c3d4.json
        └── ...

文件命名约定: {STOCK_CODE}_{T2_CODE}_{RELEASE_DATE}_{ID_HASH}

使用示例

这些工具采用 EAFP(请求原谅比请求许可更容易) 的方法设计。AI 助手应尝试直接检索数据,并依靠错误来触发下载。

场景 A:文件已存在于本地(最短路径)

User: "Search 00700 inside information for buyback"

1. keyword_search(local_key="00700_50100_2026-07-09_a1b2c3d4", keywords=["buyback", "repurchase"])
   → Returns page snippets matching the keywords immediately.

场景 B:文件缺失(触发回退)

User: "What did Tencent announce in its latest inside information?"

1. list_hkexnews_announcements(stock_code="00700", category="Inside Information", limit=3)
   → Returns local_key / release_date / title.

2. keyword_search(local_key="...", keywords=["inside information"])
   → Error: File not found.

3. download_hkexnews_announcement(stock_code="00700", local_key="...")
   → Downloads PDF to ~/.agentladle/mcp-hkexnews/data/pdf/

4. parse_hkexnews_announcement(local_key="...")
   → Parses into JSON.

5. keyword_search(local_key="...", keywords=["inside information"])
   → Retries search and returns data.

技术栈

组件

选择

用途

MCP 框架

mcp (FastMCP)

支持 stdio 传输的 MCP 服务器

HTTP 客户端

httpx

HKEXnews API 请求及文件下载

PDF 解析

pymupdf + beautifulsoup4

PDF 页面文本提取;HTML 回退

搜索

Python 内置

TF + 位置加权评分

配置

pyyaml

YAML 配置文件

证券列表

openpyxl

解析 HKEX ListOfSecurities.xlsx

项目结构

src/mcp_hkexnews/
├── __init__.py
├── server.py                 # MCP Server entry point
├── config.py                 # Config loading (~/.agentladle/mcp-hkexnews/config.yaml, singleton cached)
├── models.py                 # Data models
├── categories.py             # Announcement category blacklist
├── response.py               # Unified JSON responses
├── instances.py              # Service singletons
├── tools/
│   ├── list_announcements.py # Tool 1: list_hkexnews_announcements
│   ├── download.py           # Tool 2: download_hkexnews_announcement
│   ├── parse.py              # Tool 3: parse_hkexnews_announcement
│   ├── search.py             # Tool 4: keyword_search
│   ├── page.py               # Tool 5: get_announcement_pages
│   └── lookup.py             # Tool 6: lookup_stock_code
└── services/
    ├── company.py            # HKEX activestock + ListOfSecurities + stock_code→stockId
    ├── tiers.py              # HKEX tierone/tiertwo category cache
    ├── downloader.py         # HKEXnews titleSearch + PDF download
    ├── parser.py             # PDF/HTML→JSON parsing (PyMuPDF)
    ├── searcher.py           # Local JSON search + TF scoring
    └── keys.py               # local_key helpers

许可证

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP server for Japan's TDnet (Timely Disclosure network). Search and retrieve timely disclosure documents from listed companies on Japanese stock exchanges.
    5
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server that wraps SFC financial data API into 32 tools for comprehensive A-share market data, including real-time quotes, rankings, limit-up statistics, news, themes, financials, charts, research reports, and watchlists.
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server for analyzing SEC filings (10-K, 10-Q, 8-K) with industry-aware financial extraction and BERT-based NLP.
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Official Octoparse MCP server for template discovery, cloud tasks, and structured data export.

  • Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.

  • All HasData scraping tools in one MCP server: Google, TikTok, Instagram, maps, e-commerce and more.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/agentladle/mcp-hkexnews'

If you have feedback or need assistance with the MCP directory API, please join our Discord server