HKEx Filings

io.github.simonplmak-cloud由 GitHub 账号 simonplmak-cloud 发布v2.4.1更新于 Oct 2, 2026

Live HKEx (Hong Kong Stock Exchange) regulatory filings for AI agents.

发布方自己的服务:SEC Filings

已验证Streamable HTTP可网页运行数据库网页搜索与抓取金融

概览

AI 生成的概览

只读的 MCP 服务,接入香港交易所(HKEx)实时监管公告,让助手搜索、浏览并提取公告正文与表格。

可以做什么
  • 在最长 31 天的时间窗口内搜索公告,可按股票代码、标题、文件类型、类别或股票名称筛选
  • 通过公告分面浏览某个时间窗口内包含的内容
  • 下载单份公告文件并提取其正文与表格
  • 查询网关自身的服务器信息
  • 本地 stdio 版本针对已存储的语料提供更完整的工具集
适用场景
当助手需要获取当前或历史港交所公告、中期报告等上市公司文件,用于研究、合规核查或对本地语料做检索,而又不想自己写爬虫时适用。
运行要求
可使用托管的 Streamable HTTP 端点(无需 API 密钥),或在本地安装 PyPI 包 hkex-filing-scraper(通过 uvx 或 pip 运行);本地流水线需设置 DATABASE_TARGET,非 SQLite 目标还需连接信息如 POSTGRES_DSN。需要能访问港交所的网络。
安装前请注意
托管网关实时读取港交所数据且不存储;本地流水线会把抓取的公告写入你配置的数据库,请指向愿意被修改的数据库。POSTGRES_DSN 等连接串包含凭据。抓取数据的再分发受限,转载前请查阅项目的法律条款。

安装

在 SourceWeft 中

  1. 打开 控制台中的 HKEx Filings,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.simonplmak-cloud%2Fhkex-filings/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "hkex-filings": {
      "type": "http",
      "url": "https://hkex-listco-updates.ascent-partners.com/api/mcp"
    }
  }
}

README

HKEx Filing Scraper

An open-source scraper for 25+ years of HKEx regulatory filings — into any of nine databases, with full-text extraction, graph linking, and a read-only MCP server for AI agents.

[HKEx Filing Scraper — one scraper, many databases]

[CI] [MCP Registry] [Glama MCP] [GitHub Release] [PyPI] [Python 3.10+] [Docs] [MCP] [Ruff] [License: MIT]

Overview

The US has EDGAR full-text search. Japan has EDINET. Hong Kong has a search form that returns one page at a time. There is no bulk, machine-readable, full-text corpus of HKEx filings. This builds one.

An open-source Python tool that scrapes 25+ years of Hong Kong Stock Exchange (HKEx) regulatory filings and ingests them into any combination of nine databases — with full-text and table extraction, chunk-level coverage, optional graph linking, and a read-only MCP server so AI agents can query the corpus or the live site.

It speaks the undocumented HKEx JSON API directly, which is faster and more resilient than driving a browser.

Vendors & Integrations

Databases — nine first-class destinations, in documented popularity order (see the support matrix):

  • PostgreSQL — production-grade open-source relational
  • MySQL / MariaDB — GPL relational servers, one driver
  • SQLite — zero-server file database, no install needed
  • MongoDB — document database
  • Neo4j — property-graph database
  • ClickHouse — columnar analytics engine
  • DuckDB — in-process analytical engine
  • SurrealDB — multi-model graph + document database

AI clients — any MCP-capable agent; ready-made configuration for Claude, ChatGPT, Cursor, VS Code/Copilot, Gemini CLI, opencode, Manus, and Perplexity.

Available on — PyPI · Glama · MCP Registry · hosted gateway.

Two Ways to Use It

Hosted MCP gatewayLocal pipeline
WhatA public endpoint you point an AI agent atThe hkex-scraper CLI
SetupNone — paste a URLpip install + one environment variable
DataLive from HKEx, nothing storedStored in your database(s)
DocsLive MCP gateway · AI agent supportGetting started

[Example: install, scrape filings into SQLite, then query the hosted MCP gateway from an AI agent]

Use the Hosted MCP Gateway

POST, Streamable HTTP, no API key:

text
https://hkex-listco-updates.ascent-partners.com/api/mcp

Four read-only tools: get_server_info, search_filings (a window of at most 31 days, with optional stock-code, title, document-type, category, and stock-name filters), list_filing_facets (browse what a window contains), and get_filing (downloads one document and extracts its text and tables).

[Two ways to reach HKEx filings from an AI agent: the hosted MCP gateway or the local stdio server]

Point a client at it — for example opencode:

json
{  "$schema": "https://opencode.ai/config.json",  "mcp": {    "hkex-live": {      "type": "remote",      "url": "https://hkex-listco-updates.ascent-partners.com/api/mcp"    }  }}

Then ask:

text
Use hkex-live to list the filings published between 2026-09-01 and 2026-09-18,then summarise the interim report.

Ready-made configuration for Claude, ChatGPT, Cursor, VS Code/Copilot, Gemini CLI, opencode, Manus, and Perplexity is in AI agent support — and for a stored corpus, the stdio MCP server exposes a wider tool catalog and is published on Glama. The gateway is listed in the official MCP Registry as com.ascent-partners/hkex-filings.

Featured on Glama — the read-only stdio MCP server is also published on Glama, where Glama scans the built server and scores tool-definition quality (currently 4.7/5).

Quick Start (≤ 5 minutes)

Fastest path: no install — use the hosted gateway at https://hkex-listco-updates.ascent-partners.com/api/mcp (Streamable HTTP), or install and run locally:

bash
pip install hkex-filing-scraper        # core; SQLite needs no serverpip install "hkex-filing-scraper[all]" # Excel + dotenv + every driver + the MCP servercp .env.example .env                   # then set DATABASE_TARGET (below)hkex-scraper --metadata-only --limit 100

Optional extras: excel, postgres, mysql, duckdb, mongodb, clickhouse, neo4j, mcp, pdf, all, dev.

DATABASE_TARGET is an ordered, comma-separated list of sink ids; the order decides which sink serves reads. To start with no server:

ini
DATABASE_TARGET=sqliteSQLITE_PATH=hkex.db

hkex-scraper runs the full pipeline (metadata + documents + graph); hkex-scraper --full-history covers everything since April 1999. The schema is created automatically. Full install options and per-sink settings are in Getting started.

Database Support

Every sink is a first-class destination; rows are in documented popularity order. The full matrix — licenses, capability differences, per-engine notes — is in Database sinks.

SinkModelLicenseExtraIdempotent upsert
postgresrelationalPostgreSQL LicensepostgresON CONFLICT DO UPDATE
mysql / mariadbrelationalGPLv2mysqlON DUPLICATE KEY UPDATE
sqliterelationalPublic domain—ON CONFLICT DO UPDATE
mongodbdocumentSSPL¹mongodbupdate_one(upsert=True)
neo4jgraphGPLv3 (Community)neo4jMERGE
clickhousecolumnarApache-2.0clickhouseReplacingMergeTree + read-merge
duckdbrelationalMITduckdbON CONFLICT DO UPDATE
surrealdbgraph + documentBSL 1.1¹—UPSERT / RELATE

¹ Source-available, not OSI-approved — labeled exceptions per ADR 0003.

Valid sink ids, in documented order: postgres, mysql, sqlite, mongodb, mariadb, neo4j, clickhouse, duckdb, surrealdb. Set one variable and the same run feeds every sink:

ini
# Order sets read precedence.DATABASE_TARGET=postgres,sqlitePOSTGRES_DSN=postgresql://user:password@localhost:5432/hkexSQLITE_PATH=hkex.db

How This Compares

Four ways to get HKEx filings, and what each one costs you.

This projectHKEXnews web searchBrowser automation you writeLicensed HKEx feed
Bulk exportYesNo — page-at-a-timeYesYes
History to April 1999YesYes, manuallyDepends on your codeYes
Full text of documentsExtracted from PDF/HTML/ExcelNo — you open each fileYou build the extractorVaries by contract
Structured tablesExtracted to MarkdownNoYou build itVaries
Coverage verificationPer-chunk, auditableNot applicableYou build itVendor SLA
Lands in your engine9 engines, any combinationNoWhatever you wire upUsually one format
SpeedJSON API, no browserManualSlower — renders pagesFast
CostFree, MITFreeYour timeSubscription
Commercial redistributionSee docs/legal.mdRestrictedRestrictedLicensed

If you need licensed, redistributable, SLA-backed data, buy the feed. If you need a complete local corpus for research, compliance, or RAG, this replaces the pipeline you would otherwise write yourself.

How It Works

mermaid
flowchart LR    A[HKEx JSON API] --> B[Phase 1: metadata]    B --> C[Canonical record]    C --> D{DATABASE_TARGET}    D --> E[(PostgreSQL)]    D --> F[(MySQL / MariaDB)]    D --> G[(SQLite)]    D --> H[(MongoDB)]    D --> I[(Neo4j)]    D --> J[(ClickHouse)]    D --> K[(DuckDB)]    D --> L[(SurrealDB)]    B --> M[Graph linking]    M --> D    B --> N[Phase 2: download and extract]    N --> C
  • Phase 1 scrapes filing metadata through a JSF session, splitting the range into monthly chunks and deduplicating on a 16-character MD5 filingId.
  • Phase 2 downloads each filing's PDF/HTML/Excel document, extracts text and tables to Markdown, and writes the payload.
  • Graph linking (optional) writes has_filing and references_filing edges when COMPANY_TABLE is set.
  • Failure isolation — a failure on one sink is logged and counted but never blocks another; the run exits non-zero if any configured sink failed.

Deeper detail: Architecture · ADR 0002.

HKEx API session

mermaid
sequenceDiagram    autonumber    participant C as hkex-scraper    participant J as HKEx site (JSF)    participant A as HKEx JSON servlet    C->>J: GET /search/titlesearch.xhtml    J-->>C: HTML + javax.faces.ViewState    C->>J: POST form (from/to dates + ViewState)    C->>A: GET /search/titleSearchServlet.do (rowRange paging)    A-->>C: JSON page of filings    Note over C: generate_monthly_chunks() splits ranges > 1 month    C->>C: dedupe on 16-char MD5 filingId

Data model

mermaid
erDiagram    COMPANY ||--o{ EXCHANGE_FILING : has_filing    EXCHANGE_FILING ||--o{ DOCUMENT : has_document    EXCHANGE_FILING ||--o{ EXCHANGE_FILING : references_filing    EXCHANGE_FILING ||--o{ SCRAPE_COVERAGE : chunk_of    EXCHANGE_FILING {        string filingId "16-char MD5"        string stockCode        string title        datetime dateTime    }    DOCUMENT {        text documentText        array documentTables    }    SCRAPE_COVERAGE {        int apiCount        int ingestedCount        int uniqueCount        string runId    }

exchange_filing and scrape_coverage are SCHEMAFULL; has_filing / references_filing are the graph edges written by graph.py.

Sink contract and read routing

mermaid
flowchart LR    CANON["canonical record<br/>per filing / document / coverage / edge"] --> DISPATCH["dispatch to every configured sink"]    DISPATCH --> S1["sink A"]    DISPATCH --> S2["sink B"]    DISPATCH --> SN["sink N"]    S1 -.->|error| LOG["logged + counted<br/>never blocks the others"]    READ["reads: pending filings · tickers · titles · coverage"] --> FIRST["first configured sink<br/>whose capabilities include reads"]    DISPATCH --> EXIT["sink_exit_code()<br/>non-zero if any sink failed"]

Features

  • Fast API scraping — direct HKEx JSON API; no browser or Selenium.
  • Full history — every filing from April 1999 to today, with chunk-level coverage checks.
  • Document processing — PDF/HTML/Excel text and structured tables, extracted to Markdown.
  • Multi-sink — any ordered combination of nine databases, each with native idempotent upserts.
  • AI-ready — a hosted live MCP gateway plus a local stdio MCP server.
  • Resumable and observable — batching, parallel downloads, stalled-job detection, per-sink counters, and --coverage-report / --parity-report / --verify.
  • Optional dependencies — the core is requests + beautifulsoup4; drivers and document extraction are extras with graceful fallbacks.

Documentation

Development

bash
pip install -e ".[dev,all]"ruff check           # lint (py310, line-length 100)ruff format --check  # formattingpytest               # unit tests (no DB or network required)

Tests are pure unit tests; SQLite and DuckDB contract tests run in-process, and integration tests that need a server are skipped unless that sink is configured. See Testing.

CI and deployment run through the APG workbench pipeline.

The deploy smoke check probes the public hostname through the balancer, not a local port.

Contributing

See CONTRIBUTING.md; report security issues per SECURITY.md. Ideas and questions are welcome in Discussions.

Built by Ascent Partners.

If this saves you time, a ⭐ on GitHub helps others find it.

Use with Context7

Up-to-date HKEx Filing Scraper documentation is indexed on Context7, so coding agents can pull it into context on demand. With the Context7 MCP server or ctx7 CLI installed, name the library in your prompt:

text
use library /simonmak-ascent/hkex-filing-scraper for API and docs

License

MIT — see LICENSE. That covers this project's code only; optional dependencies carry their own licenses, notably the pdf extra (PyMuPDF / pymupdf4llm), which is AGPL-3.0 and deliberately excluded from .[all]. See docs/legal.md.

Data & Terms of Use: this is a research tool for the undocumented HKEx JSON API, and it is not affiliated with or endorsed by HKEx. Commercial redistribution of HKEx data may require a licensed HKEx feed; see docs/legal.md.

来源:README.md,提交 75b7d61

工具

0
SourceWeft 尚未读取此服务器的工具。

版本历史

2
  1. v2.4.1最新Oct 1, 2026
  2. v2.4.0Sep 20, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式必需10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Filings 集成