内容
# lu-eli-mcp
<!-- mcp-name: io.github.matematicsolutions/lu-eli-mcp -->
## 安装(单命令)
已发布到 PyPI 和 MCP Registry(`io.github.matematicsolutions/lu-eli-mcp`)。无需克隆即可运行:
```bash
uvx lu-eli-mcp
```
MCP 客户端配置(stdio):
```json
{ "mcpServers": { "lu-eli-mcp": { "command": "uvx", "args": ["lu-eli-mcp"] } } }
```
(从源代码构建 - 见下文。)
一个针对 **卢森堡立法** 的 MCP 服务器,通过 [Legilux](https://legilux.public.lu) 开放数据
(`data.legilux.public.lu`)。它获取法令元数据和完整的 Akoma Ntoso 文本,并附有可验证的
引用。由 [MateMatic](https://matematic.co) 提供的 **eu-legal-mcp** 国家法律连接器系列的一部分。
Legilux 真正 **ELI 原生**:每个法令都通过其 ELI 地址,并以 jolux RDF 描述,
遵循 FRBR 模型(作品 / 表达 / 表现),并附有完整的 Akoma Ntoso XML 文本。每个
响应都包含一个原生的 `eli_uri`,一个 `human_readable_citation` 和一个可解析的 `source_url`。
> **只读。** 服务器仅查询 Legilux 并写入本地审计日志。永不修改官方文本。
## 工具
| 工具 | 功能 |
| --- | --- |
| `lu_get_act(eli)` | 通过 ELI(完整 URI 或裸 `eli/...` 路径)获取法令的元数据。返回原生的 `eli_uri`,标题,日期,生效状态,可用语言 / 表现形式,以及法令的 `cites` / `modifies` / `repeals` 链接。 |
| `lu_get_text(eli, language, file_format)` | 获取指定 `language`(默认为 `fr`)和 `file_format`(默认为 `xml`,Akoma Ntoso)的逐字文本。 |
**无自由文本搜索**:Legilux 不提供 HTTP 搜索端点。通过 ELI 坐标(来自 legilux.public.lu)或跟随 `lu_get_act` 返回的 `cites` / `modifies` / `repeals` ELI 来发现法令。卢森堡是多语言的,因此标题和文本可以是法语或德语;`languages` 字段显示给定法令的可用内容。
## 配置
Legilux 无密钥。配置是可选的:
| 变量 | 含义 |
| --- | --- |
| `LU_ELI_BASE_URL` | Legilux 数据主机(默认为 `https://data.legilux.public.lu`)。 |
| `LU_ELI_CACHE_DIR` | 磁盘缓存目录(默认为 `~/.matematic/cache/lu-eli`)。 |
| `LU_ELI_AUDIT_DIR` | 审计日志目录(默认为 `~/.matematic/audit`)。 |
将 `.mcp.json.example` 复制到您的 MCP 客户端配置中。
## 安装
```bash
py -3.13 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]" # Windows
# 或:python -m pip install -e ".[dev]" # POSIX
```
## 测试
```bash
pytest tests/test_instructions_drift.py tests/test_parse.py # 离线
pytest tests/test_smoke.py -v # 在线,访问 Legilux
```
## 许可
Apache-2.0。Legilux 内容由卢森堡大公国所有;本软件仅检索和引用它。