chuance-policy-mcp
# chuance-policy-mcp — 川策智行 · 权威政策检索 MCP
为「川策智行 — 公共数据政策仿真与公共价值评估智能体」定制的 MCP 服务器,
让智能体具备**实时权威政策检索**与**法条引用核验**能力,补齐静态知识库的时效性短板。
全部走公开渠道(中国政府网政策文件库官方接口、gov.cn 各站点、Bing/百度检索),
**无需任何 API Key**,可在女娲智能体沙箱内以 stdio 方式直接运行。
## 工具清单
| 工具 | 用途 |
|---|---|
| `search_gov_policy` | 权威政策检索:中国政府网政策文件库(含文号/发文机关/日期/时效性)+ 定向站点(国家数据局/四川省/发改委/财政部/人行/成都) |
| `fetch_page_text` | 抓取任意政策页面正文(自动解析发布日期;兼容 gov.cn 新旧版 CMS) |
| `verify_law_article_tool` | 法条原文核验:给定法名+条号,返回该条完整原文与来源(三级匹配防误抽) |
| `batch_verify_citations` | 批量核验 `《法名》第X条` 引用列表,输出逐项核验表 |
| `check_freshness` | 政策页面时效性检查(发布日期距今天数 + 引用提示) |
| `source_catalog` | 数据源清单与强制使用声明 |
核验引擎特点:
- **三级匹配**(标题含法名 → 全文页签名 → 宽松提及),杜绝在"引用了该法的无关文件"里误抽条文;
- 法名后缀消歧(《政府采购法》≠《政府采购法**实施条例》》);
- 行首条文边界解析,不受条文内"第X条"交叉引用干扰;
- 支持国家法律、行政法规与**省级地方性法规**(如《四川省数据条例》)。
## 部署到女娲Nuwax
进入 空间 → 组件资源 → MCP管理 → 创建MCP服务,安装方式选择 **uvx**,
MCP服务配置填:
```json
{
"command": "uvx",
"args": [
"--from",
"git+https://github.com/wenyi3370-lgtm/chuance-policy-mcp.git",
"chuance-policy-mcp"
],
"env": {}
}
```
服务名称建议:`权威政策检索`;描述可写:
> 实时检索中国政府网政策文件库(文号/日期/时效性)、国家数据局、四川省政府网等权威来源,核验《法名》第X条引用原文。用于正式合规审查的证据双源校验。
若沙箱访问 GitHub 缓慢,可改用 PyPI 安装(发布后):`{"command":"uvx","args":["chuance-policy-mcp"],"env":{}}`。
### 本地运行 / 调试
```bash
pip install -e . # 或 uv pip install -e .
chuance-policy-mcp # stdio 模式(供智能体平台调用)
chuance-policy-mcp --http --host 127.0.0.1 --port 8931 # Streamable HTTP 模式(端点 /mcp)
```
环境变量:`CHUANCE_TIMEOUT`(默认20s)、`CHUANCE_MAX_CHARS`(默认6000)、
`CHUANCE_PROXY`(如 http://127.0.0.1:7897,默认**不**使用系统代理)。
## 使用建议(写给智能体)
- 正式合规结论先 `search_gov_policy` 检索 → 命中后用 `fetch_page_text` 或 `verify_law_article_tool` 核对原文 → 引用必须带 `url + doc_no + pub_date`;
- 检索不到 ≠ 政策不存在,须表述为"本次检索未召回";
- `verify_law_article_tool` 的 `confidence` 为 weak 时必须人工复核。
## 免责声明
检索与核验结果仅供决策参考,不构成正式法律意见;正式依据以官方公布文本为准。
TDQS
Scored across 6 tools
Each tool has a distinct primary role: search, fetch full text, verify a single law article, verify citations in batch, check freshness, and list data sources. There is slight functional overlap (fetch_page_text and check_freshness both return publish dates, and verify tools fetch pages), but the descriptions clarify when each should be used.
Most tools follow a readable verb_noun pattern: search_gov_policy, fetch_page_text, batch_verify_citations, check_freshness. However, verify_law_article_tool adds an unnecessary '_tool' suffix and source_catalog is noun-only, so the pattern is not perfectly uniform.
Six tools is well-scoped for a specialized policy/law research MCP. Each tool serves a distinct step in the research workflow—search, fetch, verify, batch verify, freshness check, and source transparency—without redundancy or bloat.
The toolset covers the full core workflow: searching authoritative policy sources, retrieving page text, verifying individual and batch law citations, and assessing freshness. source_catalog also clarifies boundaries and data-source limitations, leaving no obvious dead ends for the stated purpose.