Metadata-Version: 2.5
Name: cscec-gwdoc-mcp
Version: 0.1.0
Summary: 中建企业公文 Word（.docx）生成 stdio MCP 服务，供百炼函数计算 uvx 托管接入。
Author: CSCEC
License: Proprietary
Keywords: cscec,docx,mcp,word,公文
Requires-Python: >=3.10
Requires-Dist: lxml>=4.9
Requires-Dist: mcp[cli]<2,>=1.0
Requires-Dist: pydantic>=2.0
Requires-Dist: python-docx>=1.1
Description-Content-Type: text/markdown

# cscec-gwdoc-mcp

中建企业公文 Word（.docx）生成 **stdio MCP** 服务。可被 `uvx` 安装运行，适配阿里云百炼函数计算（FC）代码包（uvx）托管模式，再由中建 AI 等外部 MCP 客户端经百炼接入。

## 工具

`generate_official_doc`：根据结构化公文内容生成 `.docx`。

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `title` | str | 公文标题（必填） |
| `sections` | list[dict] | 章节列表，每项 `{heading, paragraphs, subheadings?}` |
| `document_number` | str | 文号 |
| `recipient` | str | 主送单位 |
| `introduction` | str | 导语 |
| `attachments` | list[str] | 附件名称 |
| `issuer` | str | 发文单位 |
| `department` | str | 发文部门（代章） |
| `issue_date` | str | 发文日期 |
| `cc` | str | 抄送 |
| `document_type` | str | 公文类型，默认「通报」 |

## 运行

```bash
uvx cscec-gwdoc-mcp
```

服务以 stdio 方式启动；生成的 `.docx` 作为 MCP 内嵌二进制资源（base64）随工具结果回传，不提供公网下载链接。

## 本地开发自测

```bash
uv venv
uv pip install -e .
python -m cscec_gwdoc_mcp.server
```

## 数据与排版说明

- 生成器优先套用包内范文的页面设置、Word 样式及页眉页脚，再重建正文。
- 未提供的文号、日期、单位、统计数字、整改时限等应标记为待补充，人工核对后再正式发文。
- 「方正小标宋简体」「仿宋_GB2312」「楷体_GB2312」等字体需目标环境安装，缺字体会被自动替换。
