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/ArknightsGameData Release 下载 zh_CN-excel.zip,其内容同步自 Kengxxiao/ArknightsGameData
  • 关卡战斗数据gamedata-levels volume):从同一 Release 下载 zh_CN-levels.zip,用于关卡实际出怪和关卡级敌人数值
  • 剧情数据storyjson volume):从 ArknightsStoryJson Releases 下载 zh_CN.zip

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

周期可通过 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.4.0.tar.gz (197.7 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.4.0-py3-none-any.whl (85.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prts_mcp-2.4.0.tar.gz
Algorithm Hash digest
SHA256 51270b740583f992dbeb38699d2c99f8a1af9d55fb1a17eaac43065bf3126c52
MD5 476ee222843b344ab16ef942cbb2129b
BLAKE2b-256 f66c78adfe3c09fd8e1c626c61fe3647a367cd30e7ae90af5ede788bbbf27f53

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for prts_mcp-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74394e9a08806b98f972a842147f349460f05f826ef4fd4367cd11d32f1e7e0d
MD5 5fc596a3a4a25def6c8db5031ab50cac
BLAKE2b-256 f2fbe703e40b515b4ddb49937f4f2c68b810200eacf66919b6a54c321700be99

See more details on using hashes here.

Provenance

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

2.6.0

2 files

2.5.2

2 files

2.5.1

2 files

2.5.0

2 files

This release

2.4.0 This release

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