Metadata-Version: 2.4
Name: judian-poetry-mcp
Version: 1.0.0
Summary: Local Stdio MCP server for Judian poetry OpenAPI.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Requires-Dist: httpx[http2]>=0.27.0
Requires-Dist: keyring>=25.0.0

# judian-poetry-mcp

聚典诗文数据库本地 Stdio MCP 服务。它把 Kimi Code CLI 与聚典诗文 OpenAPI 连接起来，所有 HTTPS 请求都从用户本机发出，用于满足聚典 `/auth/code` 阶段的 IP 白名单校验要求。

## 本地源码安装

如果你当前拿到的是源码目录，而不是已经发布到 PyPI 的包，请在项目根目录执行：

```powershell
cd C:\home\聚典mcp
python -m pip install -e .
python -m judian_mcp_server setup
```

如果 `judian-poetry-mcp` 命令已在 PATH 中，也可以执行：

```powershell
judian-poetry-mcp setup
```

Kimi 本地源码注册建议使用绝对路径，避免 PATH 问题：

```powershell
kimi mcp add --transport stdio judian-poetry-db -- python C:\home\聚典mcp\judian_mcp_server.py
```

## 发布后安装

以下命令只适用于 `judian-poetry-mcp` 已发布到 PyPI 或企业内部包仓库之后：

```powershell
pipx install judian-poetry-mcp
```

如果没有 `pipx`：

```powershell
python -m pip install judian-poetry-mcp
```

## 一次性配置

```powershell
judian-poetry-mcp setup
```

该命令会把 `clientSecret` 保存到系统钥匙串，把非敏感配置保存到本机用户配置目录。Kimi MCP 配置中不需要保存密钥。

## Kimi 注册

```powershell
kimi mcp add --transport stdio judian-poetry-db -- judian-poetry-mcp
kimi mcp test judian-poetry-db
```

## 可用工具

| 工具 | 说明 |
| --- | --- |
| `search_poetry` | 检索诗文作品，返回 ID、题名、作者、朝代 |
| `get_poetry_details` | 获取作品详情和正文 |
| `get_poetry_translation` | 获取白话译文 |
| `get_poetry_appreciation` | 获取赏析、背景和文学评价 |

## 自检

```powershell
judian-poetry-mcp doctor
judian-poetry-mcp config-path
```
