Skip to main content

PRTS MCP Server — Python 实现

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

提供 23 个 MCP 工具(2.0):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.zipzh_CN-levels.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 客户端配置、环境变量参考

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prts_mcp-2.5.2.tar.gz (226.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prts_mcp-2.5.2-py3-none-any.whl (105.6 kB view details)

Uploaded Python 3

File details

Details for the file prts_mcp-2.5.2.tar.gz.

File metadata

  • Download URL: prts_mcp-2.5.2.tar.gz
  • Upload date:
  • Size: 226.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prts_mcp-2.5.2.tar.gz
Algorithm Hash digest
SHA256 f86cbb094c81070e9fb476668043a793eabe0d0aa2e7990bf515639fe4890088
MD5 9cb4d918736addf5a36d2632d8910401
BLAKE2b-256 868812ff94748eb0712d4ac5b29ec81e331b7c5d45b6745353b3f7b2d810b5d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for prts_mcp-2.5.2.tar.gz:

Publisher: cd.yml on 3aKHP/prts-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prts_mcp-2.5.2-py3-none-any.whl.

File metadata

  • Download URL: prts_mcp-2.5.2-py3-none-any.whl
  • Upload date:
  • Size: 105.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prts_mcp-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8edaa0443dac3a830c1b950130aee6155c80bc1c8a675a3fdcbd9cd8371f3286
MD5 80540220c9d8e8d9ab8db90575f5c229
BLAKE2b-256 fcc94f40b03586360d7cc3436c057a4b6b46181884daee7d65ea275ea4132bd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for prts_mcp-2.5.2-py3-none-any.whl:

Publisher: cd.yml on 3aKHP/prts-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.7.3

2 files

2.7.2

2 files

2.7.1

2 files

2.7.0

2 files

2.6.2

2 files

2.6.1

2 files

2.6.0

2 files

This release

2.5.2 This release

2 files

2.5.1

2 files

2.5.0

2 files

2.4.0

2 files

2.3.1

2 files

2.3.0

2 files

2.2.0

2 files

2.1.0

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 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