astockevent 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NengjiangLunpi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,472 @@
1
+ Metadata-Version: 2.4
2
+ Name: astockevent
3
+ Version: 0.2.0
4
+ Summary: AStockEvent MCP Server — Structured A-share announcement event feed for AI agents
5
+ Author-email: AStockEvent Team <astockevent@outlook.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://astockevent.com
8
+ Project-URL: Repository, https://github.com/NengjiangLunpi/astockevent-mcp
9
+ Keywords: mcp,a-share,event-feed,financial-data,stock,announcement,ai-agent
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Financial and Insurance Industry
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Office/Business :: Financial :: Investment
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: httpx>=0.26.0
23
+ Requires-Dist: mcp>=1.0.0
24
+ Requires-Dist: python-dotenv>=1.0.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
27
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
28
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
29
+ Requires-Dist: mypy>=1.8.0; extra == "dev"
30
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
31
+ Dynamic: license-file
32
+
33
+ # AStockEvent MCP Server · A股公告事件 MCP 服务
34
+
35
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
36
+ [![MCP](https://img.shields.io/badge/MCP-Model%20Context%20Protocol-blue)](https://modelcontextprotocol.io/)
37
+
38
+ **中文** | [English](#english)
39
+
40
+ ---
41
+
42
+ > 把 A 股公告变成 AI Agent 能直接消费的结构化事件 Feed。
43
+
44
+ 巨潮/东方财富给你公告原文。AStockEvent 给你 AI 可直接消费的结构化事件——及时、快速、不用等日终跑批。
45
+
46
+ AStockEvent 将 A 股上市公司公告转化为**结构化语义事件**,让 AI Agent(Claude、ChatGPT、VSCode Copilot 等)通过 MCP 协议直接查询、分析、追踪。
47
+
48
+ ---
49
+
50
+ ## 目录
51
+
52
+ - [功能特性](#功能特性)
53
+ - [快速开始](#快速开始)
54
+ - [事件类型](#事件类型)
55
+ - [工具参考](#工具参考)
56
+ - [项目结构](#项目结构)
57
+ - [重要说明](#重要说明)
58
+ - [许可证](#许可证)
59
+
60
+ ---
61
+
62
+ ## 功能特性
63
+
64
+ - **13+ 种事件类型** — 减持、ST/退市、监管函、限售解禁、回购、重组、停复牌、质押、业绩预告、增持、分红、违规处罚、可转债
65
+ - **16 个 MCP 工具** — 按股票/类型/股东查询、事件详情/时间线、提前预警、分红/违规/重组/股东/风险/监管专用入口、可转债、基金穿透、可信度报告
66
+ - **结构化 Event JSON** — 每条事件包含 `structured_payload`(量化标签)、`confidence_tier`(verified/likely/uncertain 可信度三级)、`ai_summary`(AI 摘要)、`ai_context`(严重度/情绪)、完整 `timeline`(生命周期时间线)
67
+ - **免费额度** — 100 次/天,注册后 200 次/天。付费功能开发中,[注册获取 API Key →](https://astockevent.com/register)
68
+ - **MCP stdio 传输** — 兼容 Claude Desktop / VSCode / 任何 MCP 协议兼容的 AI Agent
69
+ - **零本地依赖** — MCP Server 是 REST API 薄代理,无需数据库、无需数据采集
70
+
71
+ ## 快速开始
72
+
73
+ ### 1. 安装
74
+
75
+ ```bash
76
+ pip install astockevent
77
+ ```
78
+
79
+ ### 2. Claude Desktop 配置
80
+
81
+ 在 `claude_desktop_config.json` 中添加:
82
+
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "astockevent": {
87
+ "command": "python",
88
+ "args": ["-m", "astockevent.mcp"],
89
+ "env": {
90
+ "ASTOCKEVENT_API_KEY": "your_free_api_key"
91
+ }
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ ### 3. 在 Claude 中使用
98
+
99
+ 配置完成后,Claude 会自动发现 16 个 MCP 工具:
100
+
101
+ - **按股票查询**: "帮我查一下川润股份(002272)这周有没有减持公告"
102
+ - **按类型扫描**: "最近全市场有哪些 ST/退市风险预警?"
103
+ - **事件详情**: "展示事件 c8a7f9e1-d2b4-4a3c-8d5e-1f6a9b3c7d4e 的完整数据"
104
+ - **提前预警**: "未来 7 天有哪些股票有限售股解禁?"
105
+ - **可转债**: "最近有哪些可转债触发强赎?"
106
+ - **基金穿透**: "华夏成长混合(000001)的重仓股最近有什么事件?"
107
+ - **可信度**: "这个减持事件的提取可信度如何?"
108
+
109
+ ### 4. VSCode Copilot 配置
110
+
111
+ ```json
112
+ {
113
+ "mcp": {
114
+ "servers": {
115
+ "astockevent": {
116
+ "command": "python",
117
+ "args": ["-m", "astockevent.mcp"],
118
+ "env": {
119
+ "ASTOCKEVENT_API_KEY": "your_free_api_key"
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
125
+ ```
126
+
127
+ ## 事件类型
128
+
129
+ ### Tier 1(MVP — 核心事件)
130
+
131
+ | 事件类型 | 说明 | 典型生命周期 |
132
+ |---|---|---|
133
+ | `share_reduction` | 股东减持计划、进展、完成 | plan → in_progress → completed |
134
+ | `delisting_risk` | ST/退市风险警示 | warning → confirmed / remediation |
135
+ | `regulatory_letter` | 监管函/问询函/关注函 | pending_reply → replied / overdue |
136
+ | `lockup_expiration` | 限售股/定增解禁 | approaching → expiring_soon → expired |
137
+ | `share_buyback` | 股份回购计划与实施 | plan → in_progress → completed |
138
+
139
+ ### Tier 2(Phase 2 — 高频高价值)
140
+
141
+ | 事件类型 | 说明 | 典型生命周期 |
142
+ |---|---|---|
143
+ | `asset_restructuring` | 重大资产重组/并购 | plan → regulatory_review → approved / rejected / completed |
144
+ | `trading_halt_resume` | 停牌/复牌 | halted → extended → resumed |
145
+ | `pledge_risk` | 质押/补充质押/解除质押/违约处置 | new_pledge → active → released / default_disposal |
146
+ | `earnings_forecast` | 业绩预告/快报/修正 | first_forecast → revised_up/down → final_report |
147
+
148
+ ### Tier 3(Phase 2 — 扩展覆盖)
149
+
150
+ | 事件类型 | 说明 | 典型生命周期 |
151
+ |---|---|---|
152
+ | `share_increase` | 大股东/董监高增持计划 | plan → in_progress → completed / terminated |
153
+ | `dividend` | 现金分红/送股/转增 | plan → approved → completed / cancelled |
154
+ | `violation_penalty` | 立案调查/行政处罚/市场禁入 | filed → investigating → final_penalty / dismissed |
155
+
156
+ ## 工具参考
157
+
158
+ ### 核心查询(7 个)
159
+
160
+ | 工具 | 说明 | 关键参数 |
161
+ |------|------|------|
162
+ | `search_events_by_stock` | 按股票代码查询事件 | `stock_codes`(必填) |
163
+ | `search_events_by_type` | 按事件类型全市场扫描 | `event_types`(必填) |
164
+ | `search_events_by_shareholder` | 按股东名称追踪 | `shareholder_name`(必填) |
165
+ | `search_events` | **万能入口** — 支持全部筛选器(股票/类型/严重度/情绪/可转债子类型/日期/股东) | 全部可选 |
166
+ | `get_event_detail` | 获取单条事件完整数据(含 structured_payload) | `event_id`(必填) |
167
+ | `get_event_timeline` | 获取单条事件生命周期时间线 | `event_id`(必填) |
168
+ | `get_upcoming_events` | 未来 N 天到期事件提前预警 | `days`(默认 7,最大 30) |
169
+
170
+ ### 专用入口(7 个)— 预筛选的领域工具
171
+
172
+ | 工具 | 覆盖事件类型 | 用途 |
173
+ |------|------|------|
174
+ | `search_dividend_events` | `dividend` | 分红/送转公告、除权日、派息率 |
175
+ | `search_violation_events` | `violation_penalty` | 违规处罚、立案调查、行政处罚 |
176
+ | `search_restructuring_events` | `asset_restructuring` | 重大资产重组、并购、借壳 |
177
+ | `search_shareholder_events` | `share_reduction, share_increase, share_buyback, pledge_risk` | 股东行为全景(减持/增持/回购/质押) |
178
+ | `search_risk_events` | `delisting_risk, pledge_risk, trading_halt_resume, lockup_expiration` | 风险预警(ST/质押/停复牌/解禁) |
179
+ | `search_regulatory_events` | `regulatory_letter, violation_penalty` | 监管信号(问询函/关注函/处罚) |
180
+ | `search_cb_events` | `cb_event` | 可转债(强赎/回售/下修/到期) |
181
+
182
+ ### 穿透 & 验证(2 个)
183
+
184
+ | 工具 | 说明 | 关键参数 |
185
+ |------|------|------|
186
+ | `search_fund_events` | 基金穿透 — 输入基金代码 → 重仓股 × 事件交叉,按 impact_score 排序 | `fund_code`(必填) |
187
+ | `get_trust_report` | 可信度报告 — 多源交叉验证、提取质量指标 | `event_id`(必填) |
188
+
189
+ > **向后兼容**: `check_events` 仍可用(已弃用,指向 `search_events`)。
190
+ > 完整参数参见 MCP 工具自身的 `inputSchema`(AI Agent 会自动读取)。
191
+
192
+ ## 项目结构
193
+
194
+ ```
195
+ astockevent-mcp/
196
+ ├── src/astockevent/
197
+ │ ├── mcp/ # MCP Server(完整源码)
198
+ │ │ ├── server.py # 16 个工具核心逻辑 + dispatch
199
+ │ │ ├── stdio_server.py # MCP stdio 传输层 + Tool 注册
200
+ │ │ ├── __init__.py
201
+ │ │ └── __main__.py # python -m astockevent.mcp 入口
202
+ │ ├── models/
203
+ │ │ └── schemas.py # Event Schema(Pydantic 模型)
204
+ │ └── db/ # 数据库层桩代码(完整实现在私有仓库)
205
+ ├── web/ # Web 看板(HTML/JS)
206
+ ├── docs/
207
+ │ └── api-contract.md # API 契约文档
208
+ └── README.md
209
+ ```
210
+
211
+ ## 重要说明
212
+
213
+ **本仓库是 AStockEvent 的公开子集(Public Subset)**,仅包含 MCP Server + Event Schema + Web 看板 + API 文档。
214
+
215
+ ### 公开 vs 私有仓库隔离
216
+
217
+ | 内容 | 公开 `astockevent-mcp` | 私有 `astockevent` |
218
+ |------|:--:|:--:|
219
+ | MCP Server 源码(`server.py`, `stdio_server.py`, `__init__.py`, `__main__.py`) | ✅ | ✅(主副本) |
220
+ | Event Schema(`schemas.py`) | ✅ | ✅(主副本) |
221
+ | Web 看板(HTML/JS) | ✅ | ✅(主副本) |
222
+ | pyproject.toml | ✅(精简 3 deps) | ✅(完整) |
223
+ | API Contract(`docs/api-contract.md`) | ✅ | ✅(主副本) |
224
+ | Extractor 引擎(`extractors/`) | ❌ | ✅ |
225
+ | 数据管线(`pipeline/`) | ❌ | ✅ |
226
+ | Case Library(`case_library.py`) | ❌ | ✅ |
227
+ | 数据库迁移(`migrations/`) | ❌ | ✅ |
228
+ | 部署脚本(`scripts/deploy.py`) | ❌ | ✅ |
229
+ | 服务器配置/密钥 | ❌ | ✅ |
230
+ | Golden Dataset(`data/golden/`) | ❌ | ✅ |
231
+
232
+ **同步规则**:
233
+ - 仅 MCP Server(`server.py`, `stdio_server.py`, `__init__.py`, `__main__.py`)、Event Schema、Web 看板、API 文档可同步
234
+ - 私有 repo MCP 文件变更时自动触发同步(Dev Agent 执行)
235
+ - `pyproject.toml` 公共版保持精简(仅 3 个依赖),与私有版不同
236
+ - 同步前自动确认无硬编码 IP/密钥/内部路径泄露
237
+
238
+ **安全红线**:
239
+ - 公开 repo 不包含任何数据库连接信息、API 密钥、服务器 IP
240
+ - 公开 repo 不包含 Extractor 引擎(核心竞争力)
241
+ - 公开 repo 不包含 Golden Dataset(护城河资产)
242
+
243
+ MCP Server 是 REST API 的薄代理层——通过 HTTP 连接 `api.astockevent.com`,不包含数据库或管线逻辑。
244
+
245
+ > 完整后端代码参见私有仓库 [NengjiangLunpi/astockevent](https://github.com/NengjiangLunpi/astockevent)(PRIVATE)。
246
+
247
+ ## 联系方式
248
+
249
+ - **邮箱**: [astockevent@outlook.com](astockevent@outlook.com)
250
+ - **API 注册**: [astockevent.com/register](https://astockevent.com/register)
251
+ - **GitHub Issues**: [公开 repo](https://github.com/NengjiangLunpi/astockevent-mcp/issues)
252
+
253
+ ## API 契约
254
+
255
+ 完整 REST API + MCP Tool 规范见 [docs/api-contract.md](docs/api-contract.md)。
256
+
257
+ ## 许可证
258
+
259
+ MIT License — 详见 [LICENSE](LICENSE)。
260
+
261
+ ---
262
+
263
+ <a id="english"></a>
264
+
265
+ # English
266
+
267
+ > Transform A-share listed company announcements into structured event feeds that AI agents can directly consume.
268
+
269
+ Cninfo/Eastmoney gives you raw announcements. AStockEvent gives you AI-ready structured events — timely, fast, no batch processing needed.
270
+
271
+ AStockEvent transforms A-share listed company announcements into **structured semantic events**, enabling AI agents (Claude, ChatGPT, VSCode Copilot, etc.) to query, analyze, and track them through the MCP protocol.
272
+
273
+ ---
274
+
275
+ ## Features
276
+
277
+ - **13+ Event Types** — share reduction, ST/delisting risk, regulatory letters, lockup expiration, buybacks, restructuring, trading halts, pledge risk, earnings forecasts, share increase, dividends, violations, convertible bonds
278
+ - **16 MCP Tools** — query by stock/type/shareholder, event detail & timeline, early warning, 6 domain-specialized tools (dividend/violation/restructuring/shareholder/risk/regulatory), convertible bonds, fund penetration, trust reports
279
+ - **Structured Event JSON** — each event includes `structured_payload` (quantitative tags), `confidence_tier` (verified/likely/uncertain), `ai_summary`, `ai_context` (severity/sentiment), and full `timeline`
280
+ - **Free Tier** — 100 calls/day, 200 calls/day after registration. Paid plans coming soon. [Register for API Key →](https://astockevent.com/register)
281
+ - **MCP stdio transport** — compatible with Claude Desktop / VSCode / any MCP-compatible AI agent
282
+ - **Zero Local Dependencies** — MCP Server is a thin REST API proxy. No database, no data collection needed.
283
+
284
+ ## Quick Start
285
+
286
+ ### 1. Installation
287
+
288
+ ```bash
289
+ pip install astockevent
290
+ ```
291
+
292
+ ### 2. Claude Desktop Configuration
293
+
294
+ Add to your `claude_desktop_config.json`:
295
+
296
+ ```json
297
+ {
298
+ "mcpServers": {
299
+ "astockevent": {
300
+ "command": "python",
301
+ "args": ["-m", "astockevent.mcp"],
302
+ "env": {
303
+ "ASTOCKEVENT_API_KEY": "your_free_api_key"
304
+ }
305
+ }
306
+ }
307
+ }
308
+ ```
309
+
310
+ ### 3. Usage in Claude
311
+
312
+ Once configured, Claude automatically discovers 16 MCP tools:
313
+
314
+ - **By stock**: "Check if 川润股份 (002272) has any share reduction announcements this week"
315
+ - **By type**: "Show me all ST/delisting risk warnings across the market"
316
+ - **Event detail**: "Show the full timeline of event c8a7f9e1-d2b4-4a3c-8d5e-1f6a9b3c7d4e"
317
+ - **Early warning**: "Which stocks have lockup shares expiring in the next 7 days?"
318
+ - **Convertible bonds**: "Any convertible bonds triggering forced redemption recently?"
319
+ - **Fund penetration**: "What events happened to 华夏成长混合 (000001)'s heavy holdings?"
320
+ - **Trust report**: "How reliable is the extraction for this share reduction event?"
321
+
322
+ ### 4. VSCode Copilot Configuration
323
+
324
+ ```json
325
+ {
326
+ "mcp": {
327
+ "servers": {
328
+ "astockevent": {
329
+ "command": "python",
330
+ "args": ["-m", "astockevent.mcp"],
331
+ "env": {
332
+ "ASTOCKEVENT_API_KEY": "your_free_api_key"
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ ```
339
+
340
+ ## Event Types
341
+
342
+ ### Tier 1 (MVP — Core Events)
343
+
344
+ | Event Type | Description | Typical Lifecycle |
345
+ |---|---|---|
346
+ | `share_reduction` | Shareholder reduction plans, progress, completion | plan → in_progress → completed |
347
+ | `delisting_risk` | ST/delisting risk warnings | warning → confirmed / remediation |
348
+ | `regulatory_letter` | Regulatory/inquiry/concern letters | pending_reply → replied / overdue |
349
+ | `lockup_expiration` | Lockup share / private placement expiration | approaching → expiring_soon → expired |
350
+ | `share_buyback` | Share buyback plans and implementation | plan → in_progress → completed |
351
+
352
+ ### Tier 2 (Phase 2 — High Frequency, High Value)
353
+
354
+ | Event Type | Description | Typical Lifecycle |
355
+ |---|---|---|
356
+ | `asset_restructuring` | Major asset restructuring / M&A | plan → regulatory_review → approved / rejected / completed |
357
+ | `trading_halt_resume` | Trading halt / resumption | halted → extended → resumed |
358
+ | `pledge_risk` | Share pledge / supplementary pledge / release / default | new_pledge → active → released / default_disposal |
359
+ | `earnings_forecast` | Earnings forecast / flash report / revision | first_forecast → revised_up/down → final_report |
360
+
361
+ ### Tier 3 (Phase 2 — Extended Coverage)
362
+
363
+ | Event Type | Description | Typical Lifecycle |
364
+ |---|---|---|
365
+ | `share_increase` | Major shareholder / insider increase plan | plan → in_progress → completed / terminated |
366
+ | `dividend` | Cash dividend / stock dividend / capital reserve transfer | plan → approved → completed / cancelled |
367
+ | `violation_penalty` | Regulatory investigation / administrative penalty / market ban | filed → investigating → final_penalty / dismissed |
368
+
369
+ ## Tools Reference
370
+
371
+ ### Core Query (7)
372
+
373
+ | Tool | Description | Key Parameter |
374
+ |------|------|------|
375
+ | `search_events_by_stock` | Query events for specific stock codes | `stock_codes` (required) |
376
+ | `search_events_by_type` | Market-wide scan by event type | `event_types` (required) |
377
+ | `search_events_by_shareholder` | Track events by shareholder name | `shareholder_name` (required) |
378
+ | `search_events` | **Universal escape hatch** — all filters (stock/type/severity/sentiment/CB sub-type/date/shareholder) | All optional |
379
+ | `get_event_detail` | Full event record with structured_payload | `event_id` (required) |
380
+ | `get_event_timeline` | Event lifecycle timeline | `event_id` (required) |
381
+ | `get_upcoming_events` | Upcoming deadlines (next N days) | `days` (default 7, max 30) |
382
+
383
+ ### Domain-Specialized (7) — Pre-filtered convenience tools
384
+
385
+ | Tool | Event Types Covered | Use Case |
386
+ |------|------|------|
387
+ | `search_dividend_events` | `dividend` | Dividend/ex-rights/payout announcements |
388
+ | `search_violation_events` | `violation_penalty` | Regulatory investigations, penalties, fines |
389
+ | `search_restructuring_events` | `asset_restructuring` | M&A, asset injections, reverse mergers |
390
+ | `search_shareholder_events` | `share_reduction, share_increase, share_buyback, pledge_risk` | Insider activity panorama |
391
+ | `search_risk_events` | `delisting_risk, pledge_risk, trading_halt_resume, lockup_expiration` | Early warning signals |
392
+ | `search_regulatory_events` | `regulatory_letter, violation_penalty` | Exchange regulatory scrutiny |
393
+ | `search_cb_events` | `cb_event` | Convertible bonds (forced redemption/put-back/conversion price adjustment/maturity) |
394
+
395
+ ### Penetration & Verification (2)
396
+
397
+ | Tool | Description | Key Parameter |
398
+ |------|------|------|
399
+ | `search_fund_events` | Fund penetration — fund code → holdings × events, sorted by impact_score | `fund_code` (required) |
400
+ | `get_trust_report` | Trust/verification report — cross-validation & extraction quality metrics | `event_id` (required) |
401
+
402
+ > **Backward compat**: `check_events` still works (deprecated, points to `search_events`).
403
+ > Full parameter details are in each tool's `inputSchema` (AI agents read them automatically).
404
+
405
+ ## API Contract
406
+
407
+ See [docs/api-contract.md](docs/api-contract.md) for the complete REST API + MCP Tool specification.
408
+
409
+ ## Project Structure
410
+
411
+ ```
412
+ astockevent-mcp/
413
+ ├── src/astockevent/
414
+ │ ├── mcp/ # MCP Server (full source)
415
+ │ │ ├── server.py # 16 Tool core logic + dispatch
416
+ │ │ ├── stdio_server.py # MCP stdio transport layer
417
+ │ │ ├── __init__.py
418
+ │ │ └── __main__.py # python -m astockevent.mcp entry point
419
+ │ ├── models/
420
+ │ │ └── schemas.py # Event Schema (Pydantic)
421
+ │ └── db/ # Database layer stub (full impl in private repo)
422
+ ├── web/ # Web dashboard (HTML/JS)
423
+ ├── docs/
424
+ │ └── api-contract.md # API contract documentation
425
+ └── README.md
426
+ ```
427
+
428
+ ## Important Note
429
+
430
+ **This repository is the public subset of AStockEvent**, containing only MCP Server + Event Schema + Web Dashboard + API documentation.
431
+
432
+ ### Public vs Private Repository Separation
433
+
434
+ | Component | Public `astockevent-mcp` | Private `astockevent` |
435
+ |------|:--:|:--:|
436
+ | MCP Server source (`server.py`, `stdio_server.py`, `__init__.py`, `__main__.py`) | ✅ | ✅ (canonical) |
437
+ | Event Schema (`schemas.py`) | ✅ | ✅ (canonical) |
438
+ | Web Dashboard (HTML/JS) | ✅ | ✅ (canonical) |
439
+ | pyproject.toml | ✅ (slim, 3 deps) | ✅ (full) |
440
+ | API Contract (`docs/api-contract.md`) | ✅ | ✅ (canonical) |
441
+ | Extractor Engine (`extractors/`) | ❌ | ✅ |
442
+ | Data Pipeline (`pipeline/`) | ❌ | ✅ |
443
+ | Case Library (`case_library.py`) | ❌ | ✅ |
444
+ | DB Migrations (`migrations/`) | ❌ | ✅ |
445
+ | Deployment Scripts (`scripts/deploy.py`) | ❌ | ✅ |
446
+ | Server Config / Secrets | ❌ | ✅ |
447
+ | Golden Dataset (`data/golden/`) | ❌ | ✅ |
448
+
449
+ **Sync Rules**:
450
+ - Only MCP Server (`server.py`, `stdio_server.py`, `__init__.py`, `__main__.py`), Event Schema, Web Dashboard, and API docs may be synced to the public repo
451
+ - Sync is automated — Dev Agent executes when private repo MCP files change
452
+ - Public `pyproject.toml` is intentionally slim (3 deps only), different from private
453
+ - Pre-sync review ensures no hardcoded IPs, keys, or internal paths leak
454
+
455
+ **Security Red Lines**:
456
+ - Public repo contains NO database credentials, API keys, or server IPs
457
+ - Public repo contains NO Extractor engine (core competitive advantage)
458
+ - Public repo contains NO Golden Dataset (moat asset)
459
+
460
+ The MCP Server is a thin REST API proxy — it connects to `api.astockevent.com` via HTTP, with no database or pipeline logic included.
461
+
462
+ > Complete backend source: [NengjiangLunpi/astockevent](https://github.com/NengjiangLunpi/astockevent) (PRIVATE).
463
+
464
+ ## Contact
465
+
466
+ - **Email**: [astockevent@outlook.com](mailto:astockevent@outlook.com)
467
+ - **API Registration**: [astockevent.com/register](https://astockevent.com/register)
468
+ - **GitHub Issues**: [Public Repo](https://github.com/NengjiangLunpi/astockevent-mcp/issues)
469
+
470
+ ## License
471
+
472
+ MIT License — see [LICENSE](LICENSE).