Skip to main content

PRTS MCP Server — Python 实现

明日方舟同人创作辅助 MCP Server,Python 版本。支持 stdio 与 Streamable HTTP,可接入本地 MCP 客户端或作为 HTTP 服务部署。

提供 24 个 MCP 工具(2.x):PRTS 词条检索与页面结构、干员档案/语音/基础信息/战斗技能/面板数值、剧情活动与台词、角色出场追踪、全文搜索(含基建/战斗技能跨干员反查)、敌人图鉴、关卡查询、关卡敌人融合、物品/材料查询,以及干员立绘。完整清单见仓库根目录 README.md。

2.0 变更:工具面由 1.x 的 32 个合并为 23 个(详见 1.x → 2.0 迁移指南);新增可选的 output channel(PRTS_OUTPUT_CHANNEL 环境变量,默认 content,与 1.x 行为一致)。


快速开始(Docker)

# 从仓库根目录构建(可选预置 bundled 数据,详见下方)
docker build -f python/Dockerfile -t prts-mcp .

# 运行(named volume 持久化游戏数据,推荐)
docker run -i --rm -v prts-mcp-data:/data/gamedata -v prts-mcp-levels:/data/gamedata-levels -v prts-mcp-storyjson:/data/storyjson prts-mcp

接入 MCP 客户端

{
  "mcpServers": {
    "prts_wiki": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-v", "prts-mcp-data:/data/gamedata", "-v", "prts-mcp-levels:/data/gamedata-levels", "-v", "prts-mcp-storyjson:/data/storyjson", "prts-mcp"]
    }
  }
}

请使用 docker run 而非 docker compose run。后者会向 stdio 流写入进度信息,污染 JSON-RPC 通道。


不使用 Docker

仓库开发推荐使用 uv:

uv sync --directory python --locked

# GAMEDATA_PATH 设置后会禁用 auto-sync
GAMEDATA_PATH=/path/to/ArknightsGameData uv run --directory python --locked prts-mcp

安装正式发布包时仍支持 pip:

pip install prts-mcp

GAMEDATA_PATH=/path/to/ArknightsGameData prts-mcp

数据机制

服务器启动时会立即在后台同步三类数据,此后默认每小时检查一次新 Release,无需重启进程:

  • 游戏表格数据(gamedata volume):从 3aKHP/arknights-data-pipeline Release 下载 zh_CN-excel.zip
  • 关卡战斗数据(gamedata-levels volume):从同一 Release 下载 zh_CN-levels.zip,用于关卡实际出怪和关卡级敌人数值
  • 剧情数据(storyjson volume):从同一 Release 下载 zh_CN.zip(含剧情 JSON 和 LLM 摘要)

镜像内置 bundled 数据作为网络不可用时的离线保底。

自建数据工厂的新 Release 附带 manifest(prts-mcp-data/v1、源 versionId、包大小和 SHA-256);Python 实现会在原子激活前校验它。没有 manifest 的历史 Release 仍兼容读取。

周期可通过 PRTS_AUTO_SYNC_INTERVAL_SECONDS 调整(60..604800 秒);设为 0 时只执行启动同步。

PyPI 包本身不内置 bundled 数据;直接 pip install prts-mcp 时会在启动时自动同步,或使用 GAMEDATA_PATH / STORYJSON_PATH 指向你自己的本地数据。若 GAMEDATA_PATH 指向完整 ArknightsGameData 仓库根目录,内含的 zh_CN/gamedata/levels 会直接用于关卡战斗数据;否则默认在其相邻目录维护 gamedata-levels。正式 Docker 镜像会由 CI 预置兜底数据。


详细文档

→ docs/deployment.md:完整部署方式、MCP 客户端配置 → 环境变量参考:双实现全部环境变量的单一来源

Metadata

Release files for prts-mcp 2.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prts-mcp 2.8.0
File Size Uploaded
prts_mcp-2.8.0.tar.gz 302.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prts-mcp 2.8.0
File Interpreter ABI Platform
prts_mcp-2.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 454.8 kB

Release files / prts_mcp-2.8.0.tar.gz

Download URL prts_mcp-2.8.0.tar.gz
Size 302.4 kB
Tags Source
SHA-256 checksum
How to use checksums
919f399b68695fbafe2d319e4c7376640b6d2207d98533a6323cc11003771590
BLAKE2b-256 checksum
How to use checksums
38730121e06b18a767c59b75b9d31b649d5ae1ba11169dc705b4db76beeb742f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / prts_mcp-2.8.0-py3-none-any.whl

Download URL prts_mcp-2.8.0-py3-none-any.whl
Size 152.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5c419cca1c116e5755f3d710a5aef2eb6fb6b468e284290af64b3ac669677e9
BLAKE2b-256 checksum
How to use checksums
f33d580915093a173a98ccaa9b4401ad2c9b297dcf7bde7455ea2a298a9a442c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

2.8.1

2 release files

This release

2.8.0 This release

2 release files

2.7.4

2 release files

2.7.3

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page