lumio-admin-mcp
MCP server (stdio) that exposes Lumio 诗文库 / 词库 / 字库 admin APIs to hosts such as Cursor and Grok Bot, authenticated with a long-lived Bot Token.
PyPI: lumio-admin-mcp
源码: mcp/lumio-admin
设计规格:
- 一期诗文:
docs/superpowers/specs/2026-10-22-lumio-classic-bot-mcp-design.md - 二期词库/字库:
docs/superpowers/specs/2026-10-23-lumio-mcp-words-hanzi.md
Requirements
- Python 3.11+
- uv(推荐用
uvx直接跑) - 可达的 Lumio API(
LUMIO_API_BASE_URL) - Bot Token(scopes:
classic/words/hanzi)
1. Create a Bot Token
在 monorepo 的 backend 目录:
cd backend && ../.venv/bin/python -m scripts.create_bot_token --name grok-bot
默认 scopes:classic,words,hanzi。仅诗文时可:
../.venv/bin/python -m scripts.create_bot_token --name classic-only --scopes classic
stdout 仅打印一次:
BOT_TOKEN=lumio_bot_…
2. Cursor / Grok Bot MCP(推荐:PyPI + uvx)
发布到 PyPI 后,无需本地 checkout:
{
"mcpServers": {
"lumio-admin": {
"command": "uvx",
"args": ["lumio-admin-mcp"],
"env": {
"LUMIO_API_BASE_URL": "https://your-lumio-host",
"LUMIO_BOT_TOKEN": "lumio_bot_…"
}
}
}
}
固定版本示例:"args": ["lumio-admin-mcp==0.1.0"]。
本地开发(未发布 / 改源码时)
{
"mcpServers": {
"lumio-admin": {
"command": "uv",
"args": [
"--directory",
"/ABS/PATH/mcp/lumio-admin",
"run",
"lumio-admin-mcp"
],
"env": {
"LUMIO_API_BASE_URL": "http://127.0.0.1:7061",
"LUMIO_BOT_TOKEN": "lumio_bot_…"
}
}
}
}
3. Publish to PyPI(维护者)
- 在 PyPI 创建账号,Account settings → API tokens → 生成 token(
pypi-…)。 - 在本目录构建并发布:
cd mcp/lumio-admin
uv build
uv publish
uv publish 会提示输入用户名(可用 __token__)与 password(粘贴 API token)。也可用环境变量:
export UV_PUBLISH_TOKEN=pypi-…
uv publish
发版前请 bump pyproject.toml 的 version,再 uv build && uv publish。
4. Local install / debug
cd mcp/lumio-admin
uv sync
export LUMIO_API_BASE_URL=http://127.0.0.1:7061
export LUMIO_BOT_TOKEN=lumio_bot_…
uv run lumio-admin-mcp
stdio:等待 MCP host;缺环境变量时 stderr 提示并以 code 1 退出。
5. Example prompts
- 「列出 online 古诗」
- 「给静夜思加注释 床=井栏边 并上线」
- 「在采实每日背诵词库新建分组 Unit 3-2,批量写入这些短语」
- 「列出字库,往某某字库的某分组批量加汉字」
6. Tools
诗文库(classic)
| Tool | HTTP | Notes |
|---|---|---|
list_works |
GET /api/admin/classic/works |
kind, q, status, page, page_size |
get_work |
GET .../works/{id} |
|
create_work |
POST .../works |
may set status=online |
update_work |
PATCH .../works/{id} |
|
delete_work |
DELETE .../works/{id} |
single work only |
list_glosses |
GET .../works/{id}/glosses |
|
create_gloss |
POST .../works/{id}/glosses |
|
update_gloss |
PATCH .../glosses/{id} |
|
delete_gloss |
DELETE .../glosses/{id} |
词库(words)
| Tool | HTTP | Notes |
|---|---|---|
list_word_libraries |
GET /api/admin/word-libraries |
|
list_word_groups |
GET .../{library_id}/groups |
|
create_word_group |
POST .../{library_id}/groups |
不新建词库 |
batch_add_words |
POST .../groups/{group_id}/words/batch |
字库(hanzi)
| Tool | HTTP | Notes |
|---|---|---|
list_hanzi_libraries |
GET /api/admin/hanzi-libraries |
|
list_hanzi_groups |
GET .../{library_id}/groups |
|
create_hanzi_group |
POST .../{library_id}/groups |
不新建字库 |
batch_add_hanzis |
POST .../groups/{group_id}/hanzis/batch |
7. Security
- Never commit
LUMIO_BOT_TOKEN/ PyPI token。 - Bot Token 按
scopes限制路径前缀。 - 吊销:
cd backend && ../.venv/bin/python -m scripts.revoke_bot_token --id <id>
Metadata
Release files for lumio-admin-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lumio_admin_mcp-0.1.0.tar.gz | 58.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lumio_admin_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.7 kB
Release files / lumio_admin_mcp-0.1.0.tar.gz
| Download URL | lumio_admin_mcp-0.1.0.tar.gz |
|---|---|
| Size | 58.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8e11d5b6b4fcde77a0a360968745a75030ba3e38069b05c214cfd7a873eba36
|
|
BLAKE2b-256 checksum How to use checksums |
a80d15b5647b6cb675aa1634cddb7f764da37a17483f47e0abfc5956f8dbb0b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.8
|
Release files / lumio_admin_mcp-0.1.0-py3-none-any.whl
| Download URL | lumio_admin_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36b92f4e7ecf6ec5ef80e48391e06ca5972bbb18976e0d870de81017c92021f5
|
|
BLAKE2b-256 checksum How to use checksums |
ae8847aa9388b04431ea044fa1ce6c90088f463f43933c2c102888fbf743667b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.8
|
Security for lumio-admin-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.