jq-docs-mcp 2.0.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.
- jq_docs_mcp-2.0.0/.gitignore +15 -0
- jq_docs_mcp-2.0.0/LICENSE +21 -0
- jq_docs_mcp-2.0.0/PKG-INFO +351 -0
- jq_docs_mcp-2.0.0/README.md +322 -0
- jq_docs_mcp-2.0.0/pyproject.toml +68 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/__init__.py +3 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/__main__.py +6 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/cli.py +39 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/data/jq_knowledge.db +0 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/db.py +174 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/formatters.py +249 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/glossary.py +176 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/scraper/__init__.py +5 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/scraper/audit_db.py +199 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/scraper/build_db.py +294 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/scraper/fetch.py +183 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/scraper/pages.py +65 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/scraper/parser.py +1704 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/search.py +735 -0
- jq_docs_mcp-2.0.0/src/jq_docs_mcp/server.py +288 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jimmer
|
|
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,351 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: jq-docs-mcp
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: 聚宽(JoinQuant)公开 API 文档 MCP Server — 覆盖 20 个公开文档页、参数默认值、未来函数与避坑提示、数据表字段反查,零登录依赖
|
|
5
|
+
Project-URL: Homepage, https://github.com/jimmer-code/jq-docs-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/jimmer-code/jq-docs-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/jimmer-code/jq-docs-mcp/issues
|
|
8
|
+
Author-email: Jimmer <130927472+jimmer-code@users.noreply.github.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: a-share,api-docs,joinquant,jqdata,mcp,quant,trading
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: fastmcp<5.0.0,>=2.10.0
|
|
23
|
+
Requires-Dist: rapidfuzz<4.0.0,>=3.9.0
|
|
24
|
+
Provides-Extra: scraper
|
|
25
|
+
Requires-Dist: beautifulsoup4>=4.12.0; extra == 'scraper'
|
|
26
|
+
Requires-Dist: httpx>=0.27.0; extra == 'scraper'
|
|
27
|
+
Requires-Dist: lxml>=5.0.0; extra == 'scraper'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# jq-docs-mcp
|
|
31
|
+
|
|
32
|
+
聚宽(JoinQuant)公开 API 文档 MCP Server。把 20 个公开文档页里的函数签名、参数默认值、未来函数与避坑提示、策略对象、数据表和字段含义,整理成一个随包发布的本地 SQLite 知识库,让 AI 编程助手在离线状态下准确查文档。
|
|
33
|
+
|
|
34
|
+
查询全程只读本地数据库:**零登录、零流量、运行时零网络请求**。
|
|
35
|
+
|
|
36
|
+
## 核心特性
|
|
37
|
+
|
|
38
|
+
- **20 页公开文档全覆盖**:策略 API、JQData、股票/基金/期货/期权/债券/指数、因子库、Alpha101/Alpha191、技术指标、宏观、板块、组合优化等。
|
|
39
|
+
- **零登录依赖**:文档抓取走聚宽公开帮助页,不需要账号、Cookie 或 Token;服务运行时也不联网。
|
|
40
|
+
- **参数默认值齐全**:1,862 个参数中 1,084 个带默认值,755 个必填,直接给出可复制的调用形态。
|
|
41
|
+
- **未来函数与避坑提示**:140 条风险提示,覆盖未来函数、日期边界、接口弃用、配额限制、回测/研究环境差异、停牌与涨跌停等。
|
|
42
|
+
- **中文语义字段反查**:5,039 个表字段,支持「市盈率」「净资产收益率」「北向资金」这类中文说法直接定位到 `valuation.pe_ratio`、`indicator.roe`、`STK_ML_QUOTA` 等真实字段。
|
|
43
|
+
- **渐进式返回,节省 Token**:搜索只回 top-K 摘要卡片,并给出下一步该调哪个工具;完整文档、示例代码、全量字段按需展开。按 o200k 分词实测,`search_jq_docs("市盈率")` 约 256 tokens,而完整 `get_function_doc("get_price")` 约 2,489 tokens。
|
|
44
|
+
- **双传输**:默认 stdio,也支持 Streamable HTTP;同时提供 3 个 MCP Resources。
|
|
45
|
+
|
|
46
|
+
## 数据覆盖
|
|
47
|
+
|
|
48
|
+
以下数字来自知识库 `meta` 表实测(schema 2.0,构建于 2026-12-03):
|
|
49
|
+
|
|
50
|
+
| 维度 | 数量 | 说明 |
|
|
51
|
+
|---|---:|---|
|
|
52
|
+
| 覆盖文档页 | 20 | 全部为聚宽公开帮助页 |
|
|
53
|
+
| 函数 / 方法 | 543 | 平台 API、JQData、因子、技术指标等 |
|
|
54
|
+
| 函数参数 | 1,862 | 带默认值 1,084,必填 755 |
|
|
55
|
+
| 风险提示 | 140 | 未来函数 33、通用 53、日期边界 21、弃用 16、配额 16、环境差异 6、交易状态 3 |
|
|
56
|
+
| 策略对象 | 10 | `Context`、`Portfolio`、`Position`、`Order`、`Trade` 等 |
|
|
57
|
+
| 对象属性 | 99 | 对象字段与含义 |
|
|
58
|
+
| 数据表 | 195 | 宏观 115、财务 45、基金 10、债券 8、期权 7、板块 4 等 |
|
|
59
|
+
| 表字段 | 5,039 | 含字段类型、中文含义与说明 |
|
|
60
|
+
| 全文索引 | 5,787 行 | FTS5,实体与索引一一对应 |
|
|
61
|
+
| 知识库体积 | 10.5 MiB | 随 wheel 一起发布 |
|
|
62
|
+
|
|
63
|
+
函数按领域分布:
|
|
64
|
+
|
|
65
|
+
| 领域 | 函数数 |
|
|
66
|
+
|---|---:|
|
|
67
|
+
| Alpha191 / Alpha101 / 因子库 | 191 / 82 / 40 |
|
|
68
|
+
| 技术指标 | 99 |
|
|
69
|
+
| 核心策略 API | 84 |
|
|
70
|
+
| JQData | 25 |
|
|
71
|
+
| 指数、期货、期权、基金、优化器等 | 22 |
|
|
72
|
+
|
|
73
|
+
## 快速安装
|
|
74
|
+
|
|
75
|
+
需要 Python 3.11+ 和 [uv](https://docs.astral.sh/uv/)。
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# 已发布到 PyPI 后
|
|
79
|
+
uvx jq-docs-mcp
|
|
80
|
+
|
|
81
|
+
# 从源码安装(当前仓库未发布到 PyPI 时使用)
|
|
82
|
+
git clone https://github.com/jimmer-code/jq-docs-mcp.git
|
|
83
|
+
cd jq-docs-mcp
|
|
84
|
+
uv tool install .
|
|
85
|
+
|
|
86
|
+
# 或者不安装,在仓库目录里直接运行
|
|
87
|
+
uvx --from . jq-docs-mcp
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
安装后命令为 `jq-docs-mcp`。如果使用 `uvx`,每次启动都会复用 uv 缓存,冷启动约 0.5 秒。
|
|
91
|
+
|
|
92
|
+
### Claude Code
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
claude mcp add jq-docs -- uvx jq-docs-mcp
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
用源码安装时把命令换成 `jq-docs-mcp`:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
claude mcp add jq-docs -- jq-docs-mcp
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Cursor / Claude Desktop
|
|
105
|
+
|
|
106
|
+
在 MCP 配置文件中加入:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"jq-docs": {
|
|
112
|
+
"command": "uvx",
|
|
113
|
+
"args": ["jq-docs-mcp"]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Cursor 的配置文件是 `~/.cursor/mcp.json`;Claude Desktop 是 `claude_desktop_config.json`。Windows 上若找不到 `uvx`,把 `command` 写成 `uvx.exe` 的绝对路径。
|
|
120
|
+
|
|
121
|
+
### Codex
|
|
122
|
+
|
|
123
|
+
在 `~/.codex/config.toml` 中加入:
|
|
124
|
+
|
|
125
|
+
```toml
|
|
126
|
+
[mcp_servers.jq-docs]
|
|
127
|
+
command = "uvx"
|
|
128
|
+
args = ["jq-docs-mcp"]
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 通用 MCP JSON
|
|
132
|
+
|
|
133
|
+
任何支持 stdio MCP 的客户端都可以用同一份配置:
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"mcpServers": {
|
|
138
|
+
"jq-docs": {
|
|
139
|
+
"command": "uvx",
|
|
140
|
+
"args": ["jq-docs-mcp"],
|
|
141
|
+
"env": {}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 命令行
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# stdio(默认,供 MCP 客户端拉起)
|
|
151
|
+
jq-docs-mcp
|
|
152
|
+
|
|
153
|
+
# Streamable HTTP
|
|
154
|
+
jq-docs-mcp --transport http --host 127.0.0.1 --port 8000
|
|
155
|
+
|
|
156
|
+
# 使用自定义知识库(也可用环境变量 JQ_DB_PATH)
|
|
157
|
+
jq-docs-mcp --db /path/to/jq_knowledge.db
|
|
158
|
+
|
|
159
|
+
# 版本
|
|
160
|
+
jq-docs-mcp --version
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
| 参数 | 默认值 | 说明 |
|
|
164
|
+
|---|---|---|
|
|
165
|
+
| `--transport` | `stdio` | `stdio` 或 `http` |
|
|
166
|
+
| `--host` | `127.0.0.1` | HTTP 监听地址 |
|
|
167
|
+
| `--port` | `8000` | HTTP 监听端口 |
|
|
168
|
+
| `--db` | 包内数据库 | 自定义 `jq_knowledge.db` 路径 |
|
|
169
|
+
| `--version` | — | 打印版本 |
|
|
170
|
+
|
|
171
|
+
## MCP 工具
|
|
172
|
+
|
|
173
|
+
### `search_jq_docs`
|
|
174
|
+
|
|
175
|
+
渐进式检索函数、策略对象、数据表和字段。命中函数名或对象名时直接返回完整文档;否则返回 top-K 摘要卡片,并附带下一步建议。
|
|
176
|
+
|
|
177
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
178
|
+
|---|---|---|---|
|
|
179
|
+
| `query` | string | 必填 | 中英文、错别字、自然语言均可 |
|
|
180
|
+
| `entity_type` | `all` / `function` / `table` / `column` / `object` | `all` | 限定实体类型 |
|
|
181
|
+
| `limit` | int | `5` | 返回条数 |
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
search_jq_docs("市盈率", limit=3)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
## Search Results: `市盈率` — top 3
|
|
189
|
+
1. **valuation.pe_ratio_lyr** `column` — 市盈率(PE)
|
|
190
|
+
`column` · `col:valuation.pe_ratio_lyr` → `get_table_schema("valuation", column_filter="pe_ratio_lyr")`
|
|
191
|
+
2. **valuation.pe_ratio** `column` — 市盈率(PE, TTM)
|
|
192
|
+
`column` · `col:valuation.pe_ratio` → `get_table_schema("valuation", column_filter="pe_ratio")`
|
|
193
|
+
3. **valuation.code** `column` — 股票代码
|
|
194
|
+
`column` · `col:valuation.code` → `get_table_schema("valuation", column_filter="code")`
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### `get_function_doc`
|
|
198
|
+
|
|
199
|
+
返回一个函数或策略对象的完整文档:签名、参数表(含类型、是否必填、默认值)、风险提示、返回类型和官方来源链接。
|
|
200
|
+
|
|
201
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
202
|
+
|---|---|---|---|
|
|
203
|
+
| `name` | string | 必填 | 函数名或对象名,如 `get_price`、`Context` |
|
|
204
|
+
| `include_examples` | bool | `false` | 是否附带示例代码 |
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
get_function_doc("get_price")
|
|
208
|
+
get_function_doc("Context")
|
|
209
|
+
get_function_doc("get_bars", include_examples=True)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
找不到时会给出最接近的函数名建议,并用 `get_function_doc("建议名")` 指路。
|
|
213
|
+
|
|
214
|
+
### `get_table_schema`
|
|
215
|
+
|
|
216
|
+
数据表字段反查与分页浏览。支持中文别名(如「资产负债表」→ `balance`、「估值表」→ `valuation`);`column_filter` 会同时匹配字段名、中文含义和字段说明。
|
|
217
|
+
|
|
218
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
219
|
+
|---|---|---|---|
|
|
220
|
+
| `table_name` | string | 必填 | 表名或常用别名 |
|
|
221
|
+
| `column_filter` | string / null | `null` | 按字段名或含义过滤 |
|
|
222
|
+
| `limit` | int | `25` | 每页条数,取值 1–200 |
|
|
223
|
+
| `offset` | int | `0` | 偏移量 |
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
get_table_schema("valuation", column_filter="市盈")
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
输出节选(字段说明已截断):
|
|
230
|
+
|
|
231
|
+
```text
|
|
232
|
+
# Table: `valuation` — 估值数据(市值、市盈率、市净率等)
|
|
233
|
+
**Columns:** showing 1–2 of 2 matching `市盈`
|
|
234
|
+
|
|
235
|
+
| Column | Type | Meaning | Description |
|
|
236
|
+
|---|---|---|---|
|
|
237
|
+
| pe_ratio | - | 市盈率(PE, TTM) | 每股市价为每股收益的倍数…… |
|
|
238
|
+
| pe_ratio_lyr | - | 市盈率(PE) | 以上一年度每股盈利计算的静态市盈率…… |
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
剩余字段会用 `get_table_schema("valuation", limit=25, offset=25)` 提示翻页。`limit` 超过 200 会按 200 截断。
|
|
242
|
+
|
|
243
|
+
### `list_catalog`
|
|
244
|
+
|
|
245
|
+
列出文档分区、数据表或策略对象目录,适合先看全貌再检索。
|
|
246
|
+
|
|
247
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
248
|
+
|---|---|---|---|
|
|
249
|
+
| `scope` | `sections` / `tables` / `objects` | `sections` | 目录类型 |
|
|
250
|
+
| `filter` | string / null | `null` | 按关键词过滤条目 |
|
|
251
|
+
| `limit` | int | `40` | 返回条数,取值 1–200 |
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
list_catalog("tables", filter="财务")
|
|
255
|
+
list_catalog("objects")
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## MCP Resources
|
|
259
|
+
|
|
260
|
+
| URI | 内容 |
|
|
261
|
+
|---|---|
|
|
262
|
+
| `jq://function/{name}` | 单个函数的完整文档,含示例代码(等价于 `include_examples=true`) |
|
|
263
|
+
| `jq://table/{table_name}` | 单张表的完整字段表(最多 50 行) |
|
|
264
|
+
| `jq://meta` | JSON 元数据:构建时间、文档页数、各类实体数量、内容哈希 |
|
|
265
|
+
|
|
266
|
+
`jq://meta` 适合让客户端自检知识库版本,例如比较 `built_at` 或 `content_sha256` 是否变化。
|
|
267
|
+
|
|
268
|
+
## Streamable HTTP
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
jq-docs-mcp --transport http --host 127.0.0.1 --port 8000
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
服务端点为 `http://127.0.0.1:8000/mcp`。用 FastMCP 客户端连接:
|
|
275
|
+
|
|
276
|
+
```python
|
|
277
|
+
import asyncio
|
|
278
|
+
from fastmcp import Client
|
|
279
|
+
|
|
280
|
+
async def main():
|
|
281
|
+
async with Client("http://127.0.0.1:8000/mcp") as client:
|
|
282
|
+
tools = await client.list_tools()
|
|
283
|
+
print([tool.name for tool in tools])
|
|
284
|
+
result = await client.call_tool("search_jq_docs", {"query": "市盈率"})
|
|
285
|
+
print(result.content[0].text)
|
|
286
|
+
|
|
287
|
+
asyncio.run(main())
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
对外提供服务时建议放在反向代理之后,并自行加认证;服务本身不内置鉴权。
|
|
291
|
+
|
|
292
|
+
## Docker
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
docker build -t jq-docs-mcp .
|
|
296
|
+
docker run --rm -p 8000:8000 jq-docs-mcp
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
镜像内默认执行:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
jq-docs-mcp --transport http --host 0.0.0.0 --port 8000
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
容器监听 `0.0.0.0:8000`,端点同样是 `/mcp`。知识库已打进镜像,运行时不访问外网。
|
|
306
|
+
|
|
307
|
+
## 更新知识库与质量体检
|
|
308
|
+
|
|
309
|
+
知识库重新构建需要联网抓取聚宽公开文档,并安装可选的抓取依赖:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
uv sync --extra scraper
|
|
313
|
+
|
|
314
|
+
# 重新抓取并生成 src/jq_docs_mcp/data/jq_knowledge.db
|
|
315
|
+
uv run python -m jq_docs_mcp.scraper.build_db --refresh
|
|
316
|
+
|
|
317
|
+
# 只重建部分页面(页面名见 src/jq_docs_mcp/scraper/pages.py)
|
|
318
|
+
uv run python -m jq_docs_mcp.scraper.build_db --refresh --pages api JQDatadoc stock
|
|
319
|
+
|
|
320
|
+
# 指定缓存目录和输出路径
|
|
321
|
+
uv run python -m jq_docs_mcp.scraper.build_db \
|
|
322
|
+
--cache-dir /tmp/jq-raw \
|
|
323
|
+
--db-path /tmp/jq_knowledge.db \
|
|
324
|
+
--refresh
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
`build_db` 会输出 JSON 统计(实体数量、`content_sha256`、`integrity_check` 等),并写入 `meta` 表。抓取缓存默认放在仓库外的 `exp/raw_20/`,不会进入 wheel 或 sdist。
|
|
328
|
+
|
|
329
|
+
质量体检:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# 12 项数据库质量门:完整性、数量、命名空间、FTS、meta 等
|
|
333
|
+
uv run python -m jq_docs_mcp.scraper.audit_db
|
|
334
|
+
|
|
335
|
+
# 单元与集成测试(tests/)
|
|
336
|
+
uv run pytest -q
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
`audit_db` 全部通过时最后一行是 `PASS`,失败返回非零退出码,可直接接进 CI。
|
|
340
|
+
|
|
341
|
+
开发仓库还带一套 v1/v2 检索对照基准:`eval/queries.jsonl`(70 条查询,覆盖精确函数、错别字、混合意图、中文表/字段、参数与避坑、v2 扩展六类场景)和 `eval/run_retrieval_eval.py`。脚本会从仓库 `main` 分支取出 v1.0.0 的 `server.py` 和数据库作为基线,逐条回放两版检索链路,输出 Recall@1、Recall@5、MRR@10、零结果率、平均 Token 与延迟;没有 v1 历史产物时无法运行。`eval/` 不随 wheel 或 sdist 发布。
|
|
342
|
+
|
|
343
|
+
## 开源协议
|
|
344
|
+
|
|
345
|
+
MIT License,见 [LICENSE](LICENSE)。
|
|
346
|
+
|
|
347
|
+
## 免责声明
|
|
348
|
+
|
|
349
|
+
- 数据抓取自聚宽(JoinQuant)公开帮助文档,文档版权归聚宽所有;本项目仅做本地索引与检索,与聚宽无隶属或合作关系。
|
|
350
|
+
- 文档内容可能随官方更新而滞后,交易接口、字段与权限请以聚宽官网和实际账户权限为准。
|
|
351
|
+
- 本项目只提供文档查询,不构成任何投资建议;据此做出的策略与交易决策风险自负。
|