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.6.0.tar.gz (230.0 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.6.0-py3-none-any.whl (107.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prts_mcp-2.6.0.tar.gz
  • Upload date:
  • Size: 230.0 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.6.0.tar.gz
Algorithm Hash digest
SHA256 781f55632e2a301797129adde5436753cdcc0771e6a5d02373f1aa02bbf4fb24
MD5 9f509eb8f23e794ba8858d69d2b6fa3b
BLAKE2b-256 3db308458d0210912a84b1c5c752bde5198c7032c1f5ced614f264c7bc4fe29a

See more details on using hashes here.

Provenance

The following attestation bundles were made for prts_mcp-2.6.0.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.6.0-py3-none-any.whl.

File metadata

  • Download URL: prts_mcp-2.6.0-py3-none-any.whl
  • Upload date:
  • Size: 107.8 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6da15f7254c6b3232b23d3a1c875f88d44970f3fbddec3be0f50c0f1ee2e43a6
MD5 743869f3695b3b0a91b7ffd217d46cc7
BLAKE2b-256 0010a90d0cf2b3ce5a6b91aa1bca0b3ab493278062a77be54d6eef08a383de14

See more details on using hashes here.

Provenance

The following attestation bundles were made for prts_mcp-2.6.0-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

This release

2.6.0 This release

2 files

2.5.2

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