Scrape 25+ years of HKEx (Hong Kong Stock Exchange) regulatory filings into PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, ClickHouse, DuckDB, or SurrealDB — with full-text extraction, graph linking, and a hosted MCP server for AI agents.
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
claude mcp add hkex-filing-scraper -- python -m hkex-filing-scraper{
"mcpServers": {
"hkex-filing-scraper": {
"command": "python",
"args": ["-m", "hkex-filing-scraper"]
}
}
}MCP Servers overview
# HKEx Filing Scraper

[](https://github.com/simonplmak-cloud/hkex-filing-scraper/actions/workflows/ci.yml)
[](https://github.com/simonplmak-cloud/hkex-filing-scraper/releases)
[](https://pypi.org/project/hkex-filing-scraper/)
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
[](https://hkex-listco-updates.ascent-partners.com/ai-agents/)
[](https://hkex-listco-updates.ascent-partners.com/)
[](https://github.com/astral-sh/ruff)
[](CONTRIBUTING.md)
[](https://www.postgresql.org)
[](https://www.mysql.com)
[](https://sqlite.org)
[](https://www.mongodb.com)
[](https://neo4j.com)
[](https://clickhouse.com)
[](https://duckdb.org)
[](https://surrealdb.com)
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.
<!-- mcp-name: io.github.simonplmak-cloud/hkex-filings -->
It speaks the undocumented HKEx JSON API directly, which is faster and more resilient than
driving a browser.
## Two ways to use it
| | **Hosted MCP gateway** | **Local pipeline** |
| --- | --- | --- |
| What | A public endpoint you point an AI agent at | The `hkex-scraper` CLI |
| Setup | None — paste a URL | `pip install` + one environment variable |
| Data | Live from HKEx, nothing stored | Stored in your database(s) |
| Docs | [Live MCP gateway](docs/live-mcp.md) · [AI agent support](docs/ai-agents.md) | [Getting started](docs/getting-started.md) |

## Use the hosted MCP gateway
POST, Streamable HTTP, **no API key**:
```text
https://hkex-listco-updates.ascent-partners.com/api/mcp
```
Three read-only tools: `get_server_info`, `search_filings` (a window of at most 31 days), and
`get_filing` (downloads one document and extracts its text and tables).

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](docs/ai-agents.md) — and for a stored corpus,
the [stdio MCP server](docs/mcp.md) exposes a wider tool catalog. The gateway is listed in the
[official MCP Registry](https://registry.modelcontextprotocol.io/) as
`io.github.simonplmak-cloud/hkex-filings`.
## Quick start (local)
```bash
pip install hkex-filing-scraper # core; SQLite needs no server
pip install "hkex-filing-scraper[all]" # Excel + dotenv + every driver + the MCP server
cp .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=sqlite
SQLITE_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](docs/getting-started.md).
## 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](docs/sinks/README.md).
| Sink | Model | License | Extra | Idempotent upsert |
| ---- | ----- | ------- | ----- | ----------------- |
| `postgres` | relational | PostgreSQL License | `postgres` | `ON CONFLICT DO UPDATE` |
| `mysql` / `mariadb` | relational | GPLv2 | `mysql` | `ON DUPLICATE KEY UPDATE` |
| `sqlite` | relational | Public domain | — | `ON CONFLICT DO UPDATE` |
| `mongodb` | document | SSPL¹ | `mongodb` | `update_one(upsert=True)` |
| `neo4j` | graph | GPLv3 (Community) | `neo4j` | `MERGE` |
| `clickhouse` | columnar | Apache-2.0 | `clickhouse` | `ReplacingMergeTree` + read-merge |
| `duckdb` | relational | MIT | `duckdb` | `ON CONFLICT DO UPDATE` |
| `surrealdb` | graph + document | BSL 1.1¹ | — | `UPSERT` / `RELATE` |
¹ Source-available, not OSI-approved — labelled exceptions per
[ADR 0003](docs/adr/0003-sink-support-policy.md).
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,sqlite
POSTGRES_DSN=postgresql://user:password@localhost:5432/hkex
SQLITE_PATH=hkex.db
```
## 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](docs/architecture.md) · [ADR 0002](docs/adr/0002-multi-sink-architecture.md).
## 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
- [Getting started](docs/getting-started.md) · [Configuration](docs/configuration.md) · [CLI](docs/cli.md)
- [Database sinks (matrix)](docs/sinks/README.md) — [PostgreSQL](docs/sinks/postgresql.md), [MySQL/MariaDB](docs/sinks/mysql.md), [SQLite](docs/sinks/sqlite.md), [MongoDB](docs/sinks/mongodb.md), [Neo4j](docs/sinks/neo4j.md), [ClickHouse](docs/sinks/clickhouse.md), [DuckDB](docs/sinks/duckdb.md), [SurrealDB](docs/sinks/surrealdb.md)
- [Live MCP gateway](docs/live-mcp.md) · [AI agent support](docs/ai-agents.md) · [MCP server](docs/mcp.md)
- [Architecture](docs/architecture.md) · [Troubleshooting](docs/troubleshooting.md) · [Testing](docs/testing.md)
- [Roadmap](docs/roadmap.md) · [De-risking register](docs/de-risking.md) · [Upgrading](docs/upgrading.md)
- [What's new](docs/news.md) · [Releasing](docs/releasing.md) · [Legal & Terms of Use](docs/legal.md) · [Changelog](CHANGELOG.md)
- **Docs site:** <https://hkex-listco-updates.ascent-partners.com/> · [Try it locally (`examples/`)](examples/README.md)
## Development
```bash
pip install -e ".[dev,all]"
ruff check # lint (py310, lWhat people ask about hkex-filing-scraper
What is simonplmak-cloud/hkex-filing-scraper?
+
simonplmak-cloud/hkex-filing-scraper is mcp servers for the Claude AI ecosystem. Scrape 25+ years of HKEx (Hong Kong Stock Exchange) regulatory filings into PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, ClickHouse, DuckDB, or SurrealDB — with full-text extraction, graph linking, and a hosted MCP server for AI agents. It has 15 GitHub stars and its last recorded update is dated 2026-09-19.
How do I install hkex-filing-scraper?
+
You can install hkex-filing-scraper by cloning the repository (https://github.com/simonplmak-cloud/hkex-filing-scraper) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is simonplmak-cloud/hkex-filing-scraper safe to use?
+
Our security agent has analyzed simonplmak-cloud/hkex-filing-scraper and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains simonplmak-cloud/hkex-filing-scraper?
+
simonplmak-cloud/hkex-filing-scraper is maintained by simonplmak-cloud. The last recorded GitHub activity is dated 2026-09-19, with 1 open issues.
Are there alternatives to hkex-filing-scraper?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy hkex-filing-scraper to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/simonplmak-cloud-hkex-filing-scraper)<a href="https://claudewave.com/repo/simonplmak-cloud-hkex-filing-scraper"><img src="https://claudewave.com/api/badge/simonplmak-cloud-hkex-filing-scraper" alt="Featured on ClaudeWave: simonplmak-cloud/hkex-filing-scraper" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ
The fastest path to AI-powered full stack observability, even for lean teams.