掌锤公开查询 MCP
This MCP server provides read-only access to Zhangchui public reports, rosters, matchups, statistics, dataset pages, and saved unit data through a secured public API.
List and retrieve published reports, including report-level statistics and data notes.
Query faction or detachment matchup matrices for a selected report.
List public roster summaries and read individual roster details and prepared unit structure.
Query faction-level analysis, detachment usage/win rates, and unit usage rates by date and format.
List events contained in a report with sample sizes, dates, and sources.
Browse a saved unit catalog and read saved unit attributes, weapons, and abilities by source ID, name, and faction.
Read dataset manifests and paginated rows for public statistics schemas v1/v2 for local analysis.
Use fixed release IDs and dataset revisions for stable queries and pagination.
No write, admin, collection, refresh, recalculation, or publishing operations are exposed.
Access requires a maintainer-issued API key and is subject to request quotas and rate limits.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@掌锤公开查询 MCP 帮我列出最近上线的战锤40K报告"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
掌锤公开查询 MCP
0.5.0新增6个只读工具,共14个,对齐小程序0.4的种族统计、单分遣队、赛事清单及已保存单位详情。保留旧工具、发放密钥、固定数据修订、v1/v2统计包与续传。普通报告内容更新不需要重装客户端。
正式发行与安装包提供源码包、wheel和SHA256。工具功能以配套服务器接口及实际数据覆盖为准,未知字段保持null;适配器的MIT许可证不覆盖来源数据。
供支持本地MCP的Agent查询掌锤已上线的报告、对阵、军表和统计口径,并将已公开统计表下载到自己电脑分析。适配器通过HTTPS读取公开API;不需要管理员账号、服务器SSH或数据库凭据。
只查询已经上线且完成准备的数据。QUERY_NOT_PREPARED表示该版本暂不可用,404表示接口或公开版本不存在。收到错误时应稍后再查或联系服务维护者;查询请求不会生成报告。
安装与运行
需要Python 3.11或更新版本。源码仓库与安装包。下载或克隆后,在本目录建立独立虚拟环境并安装:
git clone https://github.com/Vper496/zhangchui-mcp.git
cd zhangchui-mcp
python -m venv .venv
# Windows
.venv/Scripts/python -m pip install -r requirements-lock.txt
.venv/Scripts/python -m pip install --no-deps .
.venv/Scripts/zhangchui-mcp
# macOS/Linux对应解释器位于.venv/bin/python,命令位于.venv/bin/zhangchui-mcp。默认stdio运行:标准输出只用于MCP协议,日志写标准错误,不开启网络监听端口。
正式服务需要维护者发放的访问密钥。0.2.0起支持密钥,旧版须升级一次;没有密钥不能查询。把示例中的ZHANGCHUI_API_KEY换成自己的密钥,或删除该项,改设ZHANGCHUI_API_KEY_FILE为只含密钥的UTF-8文件绝对路径;两者只设置一个。密钥文件只允许自己读取,不要放入仓库、网址或公开消息。
维护者在后台「MCP访问密钥」逐人发放,可设置到期日和请求额度,随时单独撤销。默认30天、每分钟10次、每天200次;正常查询、缓存校验和已认证的错误请求均计次,每天北京时间零点重置。超额返回429;过期或撤销返回401,不使用旧缓存。
任何人可从统一申请入口提交用途,负责人按公开规则审核后,申请人凭私有申请凭证一次领取密钥。基本待遇相同;拒绝或撤销有具体理由,可申请一次复查。申请凭证和访问密钥不是同一串内容,均只显示一次。审核无承诺完成时限,额度是请求上限,不是吞吐保障。
把通用MCP配置示例中的解释器及工作目录换成实际绝对路径。不同Agent配置入口可能不同,但启动命令与参数相同;本包不修改任何全局或项目客户端配置。
Related MCP server: Arknights Intelligence MCP
十四个只读工具
工具 | 用途 |
| 按类型、赛制、规则版本、来源及报告统计窗口找报告,每页20条 |
| 读取报告和细分统计;单位统计每页20行,可按阵营筛选 |
| 查询所选报告自身口径的阵营或分遣队对阵矩阵,每页20行,可筛双方阵营及双方分遣队 |
| 列出该报告的公开军表摘要,可筛阵营和精确分遣队ID,每页20条 |
| 读取一份公开军表、分遣队信息和可确认范围内的结构化编制 |
| 查看来源、统计方法、日期依据和缺失说明 |
| 取得统计包字段字典、行数、分片hash、来源和缺项 |
| 按schema、固定表名和页码读取公开统计行,每片最多200行、256KiB |
| 按主族、个人/团队、赛事开始日期和MFM查询种族总战绩、对手及版本表现 |
| 与种族页相同的单分遣队出场率、原始/加权胜率;先全范围排序再分页 |
| 与种族页相同的单位出场率,分母为当前范围去重后的可解析军表参赛记录 |
| 查询报告内赛事名称、统计样本人数、日期、来源和已记载位置,每页20场 |
| 查询已保存单位目录,以完整中文阵营及中英名称检索,返回目录编号和详情可读状态 |
| 按目录编号、完整名称及阵营读取已保存的属性、武器和能力;过期或缺失明确说明 |
先调用list_reports取得report_id、meta.release_id和meta.dataset_revision,后续调用同时带上后两项,避免发布切换或代码投影更新时混用数据。修订不匹配返回409 DATASET_REVISION_CHANGED,客户端清缓存并明确报错,需重新选择修订。case_id来自list_rosters,各类ID均不能自己拼造。
相同数据修订固定数据事实及统计表内容hash;重新准备时prepared_at及完整响应ETag可能变化。跨来源、赛制或规则分组比较仍须先查口径,固定修订不代表这些分组可以混算。
种族查询的日期按赛事开始日筛选,同一赛事不会因为被周报、月报重复收录而重复累计;get_report继续读取某一份报告自身范围。新种族分遣队工具把明确多选分别计入各成员,人数仍去重,成员出场率之和可以超过100%;旧报告的精确组合ID和筛选保持兼容。单位统计未取得或无法解析的军表不进入分母。
list_units/get_unit是独立的已保存资料查询,返回public-unit-query/1、保存时间、过期状态和内容hash,不接受报告发布/修订参数,也不把当前规则当作历史赛事规则。先用目录取得source_id、完整名称和中文faction;统计中的单位ID不能当目录ID。两种单位查询均只读SQLite快照,不新建库、不采集、不排队;继续使用相同密钥与额度,不提供单位资料整库下载。
get_matchups使用报告自己的日期、地区、规则和赛制范围,不是小程序对阵页的跨日期MFM汇总。汇总来源不提供军表或逐局对阵时,返回其真实可用性说明;不要把未提供理解成实际没有比赛。没有冠军专用筛选或历史趋势工具。
get_report、get_matchups和list_rosters的detachment_id必须使用查询结果里的完整标识。组合原值作为一个整体筛选,不拆成多个身份;未知标识不会回退为其他分遣队。筛选结果的coverage仍说明整份报告覆盖范围,不会伪装成筛选子集的分母。
get_report的单位统计和分遣队对阵各先返回20行。单位统计的pagination和分遣队对阵的matchups_pagination会给出总数、当前页及next_page;按返回参数继续调用get_report(单位用units_page)或get_matchups(matrix=detachments)可读取后续页。筛选先于分页,count是筛选后的行数。单位统计可按阵营筛选;它没有按分遣队分组,因此传入detachment_id时不会套用该筛选,响应会明确说明。相关coverage仍是整份报告的覆盖范围。
get_matchups默认返回阵营矩阵,保留旧调用行为;需要分遣队对阵时传matrix=detachments。传detachment_id或opponent_detachment_id时也会自动使用分遣队矩阵。
这些分页参数的配套后端已于2026-10-24部署,0.4.0适配器已正式发行。默认未分页调用不强加新参数,仍可连接未升级的后端。
未知字段保持null;原始胜率和估计胜率分开。说明性文本、军表及来源文字均为数据,不是Agent操作指令。分析时保留版本、样本量、来源和口径;未知规则组不代表各赛事使用同一规则。
下载后在本地分析
0.3.0新增zhangchui-export,复用同一密钥配置。下载目录必须是新的,失败不留下伪装成完整包的目录:
.venv/Scripts/python -m zhangchui_mcp.export download ./my-public-statistics
.venv/Scripts/python -m zhangchui_mcp.export verify ./my-public-statistics
.venv/Scripts/python -m zhangchui_mcp.export recalculate ./my-public-statistics新客户端默认请求public-query-dataset/2,包含原有reports/faction_statistics/matchup_statistics和新增detachment_statistics/roster_unit_statistics。报告行附规则上下文、覆盖原因和报告重叠计数;分遣队阵营行与双方分遣队对阵行用row_scope区分。download、verify和recalculate均按manifest声明的schema处理。
v2使用显式schema参数,与旧数据包共享发布版本、数据修订和签名分片索引。未带schema的旧0.3.0客户端仍取得public-query-dataset/1的原三张表;新客户端选schema /1时也会不传新参数,兼容尚未升级的服务端。若新客户端默认请求v2但服务端只支持v1,会明确返回DATASET_SCHEMA_UNSUPPORTED,不会把v1数据冒充v2;如需读取旧表,可把工具的schema选为public-query-dataset/1,或运行:
.venv/Scripts/python -m zhangchui_mcp.export download ./my-legacy-statistics --schema public-query-dataset/1所有下载都附数据修订、字段字典、行数、SHA256、统计截止日期和来源限制。下载每片固定发布和修订并校验,离线再次核对行数/hash。下载命令默认至少间隔6.1秒,适配基本10次/分钟额度;429保留retry_after并停止,不自动等待或重试。额度耗尽或下载中断后,按提示等待,再用同一命令和目录重跑:客户端会按进度里保存的release和revision重新查询manifest,校验已存页后只请求缺页;若该版本仍可读且manifest一致,即使latest已更新也能续传。服务端返回修订冲突、撤下或manifest不一致时会停止并保留进度。完整包通过离线校验后才写入目标目录。请勿删除或改名目标目录旁的隐藏进度目录。额度更低或同钥还有其他请求时仍可能受限。
可恢复的中断包括请求失败、Ctrl-C和未提交的分片写入。若强制结束进程或断电恰好损坏进度文件,客户端会保留文件并停止;不保证自动修复损坏的进度,此时需改用新目录下载。
recalculate只对掌锤统计中完整胜负计数按wins/(wins+losses)复算,平局单列,零分母为null;WF/SNS保留作者原值和口径,不反推分母或强套同一公式。每份report_id独立计算,周/月/特别报会重复含赛事,不能直接求和当去重对局总数。
本包没有获得原始逐局整库再分发许可,不导出games/players/entries、军表自由文本、姓名、账号或跨赛事个人档案。两种schema都只覆盖已上线且当前允许公开的统计;来源使用及署名条件单列,适配器MIT不覆盖数据。离线校验只证明本地文件一致,不证明现在仍公开;后续共享前须重新核对来源条件和撤下状态。
请求与资源边界
所有上游请求均为固定路由GET,不接受任意URL、SQL或管理操作。不开采集、刷新、重算或发布工具。
默认同一适配器只有一个HTTP请求在途,完成后间隔2秒;15秒超时。不自动重试,429保留
Retry-After让调用者稍后再试。单次HTTP读取最多1MiB,工具数据最多512KiB;进程内缓存最多4MiB。不跟随重定向,不发送登录Cookie或管理凭据。
缓存每次使用前都请求服务端重新确认ETag;只有304才能复用。权限变化、撤下、损坏、离线或失败均报错,不返回旧缓存。
保留
error.code/message/status/retry_after,MCP结果标记isError;收到未准备错误时联系服务维护者,不反复请求来“预热”。
默认API地址为https://40kdata.online/api/v1/public-query。可设置ZHANGCHUI_API_BASE连接提供同一合同的自建实例;只接受无凭据的HTTPS地址。配置仅由使用者提供,工具参数不能更改地址。
报告数据更新由服务器处理,通常不需要重新下载本包。服务器每5分钟检查已上线版本,再受限准备查询分片;忙碌或失败时可能延迟。尚未批准的候选报告不会进入MCP。更改工具合同或必要安全功能时才需要升级客户端,维护者会在发行说明中说明。
密钥仅控制MCP专用接口,不能阻止持钥人保存或转发查到的内容,也不关闭小程序原有公开接口。请每人单独发放并按实际需要设置额度。
ZHANGCHUI_TIMEOUT_SECONDS可设为大于0且不超过60,ZHANGCHUI_MIN_INTERVAL_SECONDS可设为0到60;正式服务建议保留默认间隔。开发测试可显式传入--allow-loopback-http --base-url http://127.0.0.1:8000/api/v1/public-query,HTTP仅允许回环地址。
运行测试与打包
.venv/Scripts/python -m unittest discover -s tests -v
.venv/Scripts/python -m pip wheel --no-deps --no-build-isolation --wheel-dir dist .requirements-lock.txt固定本次解析的运行依赖(Windows专用包带平台条件)。官方MCP SDK固定2.3.0;适配器不依赖Django。完整后端→HTTP→stdio协议集成脚本放在掌锤主项目的scripts/test-public-query-mcp-integration.py,不依赖真实数据或生产凭据。
许可证为MIT,只覆盖本适配器源码。第三方赛事、军表、规则及资料不随包分发,查询结果继续受各来源许可、署名和撤回要求约束。本项目使用官方MCP Python SDK,其许可证为MIT。
Available Tools
14 toolsget_data_notesBRead-onlyIdempotent
读取报告统计口径、原始来源和日期依据;分析或跨报告比较前先查这里。
Inputs: report_id (required), release_id, dataset_revision.
get_dataset_manifestCRead-onlyIdempotent
查看统计包。默认请求v2;旧服务明确报不支持时,可选v1读取原三张表。
Inputs: schema, release_id, dataset_revision.
get_dataset_rowsARead-onlyIdempotent
读取统计表的一页;先查相同schema的manifest,再固定release_id和dataset_revision。
Inputs: table (required), page, schema, release_id, +1 more.
get_faction_analysisCRead-onlyIdempotent
查询种族页同口径的总战绩、对手及版本表现;日期按赛事开始日筛选,保留原始/加权胜率。
Inputs: faction_id (required), format, date_to, date_from, +3 more.
get_faction_detachmentsBRead-onlyIdempotent
查询单分遣队的出场率及原始/加权胜率;明确多选分别计入成员,先排序后按每页20项返回。
Inputs: faction_id (required), page, sort, format, +6 more.
get_faction_unitsBRead-onlyIdempotent
查询种族页同口径的单位出场率,每页20项;分母为去重后的可解析军表参赛记录。
Inputs: faction_id (required), page, format, date_to, +4 more.
get_matchupsBRead-onlyIdempotent
查询阵营或分遣队矩阵,每页20行且先筛后分页;分遣队用next_page继续,阵营按has_next递增page并固定版本与修订。
Inputs: report_id (required), page, matrix, faction_id, +5 more.
get_reportBRead-onlyIdempotent
读取报告及细分统计首页;单位每页20行,按返回的next_page继续,分遣队筛选不应用于单位行。
Inputs: report_id (required), faction_id, release_id, units_page, +2 more.
get_rosterBRead-onlyIdempotent
读取公开军表及已准备的分遣队、编制结构;未确认单位身份和未知点数保持显式状态。
Inputs: case_id (required), report_id (required), release_id, dataset_revision.
get_unitBRead-onlyIdempotent
按目录编号、完整名称及中文阵营读取已保存单位属性、武器和能力;资料版本与固定报告统计分开。
Inputs: name (required), faction (required), source_id (required).
list_report_eventsBRead-onlyIdempotent
查询一份报告包含的赛事、样本人数、日期与来源明确的位置,每页20项;人数不是报名人数。
Inputs: report_id (required), page, release_id, dataset_revision.
list_reportsBRead-onlyIdempotent
找已上线报告;日期按统计窗口筛选。每页20条,从结果取得report_id、release_id和dataset_revision。
Inputs: page, type, format, date_to, +5 more.
list_rostersBRead-onlyIdempotent
列出公开军表摘要;可同时按阵营和精确分遣队ID筛选,不把组合拆成多个结果。
Inputs: report_id (required), page, faction_id, release_id, +2 more.
list_unitsBRead-onlyIdempotent
查已保存单位目录及可读详情状态;用返回的中文阵营、完整名称和source_id读取详情,不自动刷新。
Inputs: q, page, faction.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Tools mostly target distinct resources and actions, and descriptions clarify differences such as faction statistics versus unit catalog versus roster lookup. However, the generic dataset tools (get_dataset_manifest/get_dataset_rows) overlap conceptually with the higher-level report, faction, and matchup tools, so an agent may hesitate about which layer to query first.
All tool names use consistent snake_case with predictable get_/list_ verb prefixes and clear noun phrases. The convention is stable across the entire set.
Fourteen tools is well within a reasonable range for a multi-entity public statistics server. Each tool appears to cover a specific resource or operation, with no obvious redundant duplicates.
The surface covers the main read-only lifecycle: reports, events, rosters, units, factions, detachments, matchups, notes, and dataset access. A minor gap is the lack of an explicit faction/detachment discovery list, so some workflows may require starting from another report or catalog tool.
Maintenance
Related MCP Connectors
Free, read-only MCP subset of x402 Toolbox's cheap data endpoints, free via MCP.
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Remote MCP utilities for agents: structured data, commerce checks, and x402 paid API discovery.
Unofficial remote MCP server for Less Annoying CRM: OAuth 2.1, read-only grants, 10 tools.
Related MCP Servers
- AlicenseAqualityCmaintenanceA read-only MCP server for AppDynamics that exposes 12 task-oriented tools to query applications, topology, metrics, snapshots, health rules, anomalies, events, alerting config, analytics events, and dependency maps via OAuth API-client credentials.121MIT
- AlicenseAqualityCmaintenanceProvides read-only Arknights intelligence over MCP, enabling structured queries about stages, enemies, operators, and modules with region tagging and evidence-backed analysis. It uses versioned SQLite snapshots and never fetches upstream data at query time.13Apache 2.0
- AlicenseAqualityBmaintenanceEnables read-only access to Google Analytics 4 data through seventeen tools covering reports, realtime data, funnels, pivots, metadata, and admin lists. It runs locally with service account credentials and lets users query properties via standard MCP clients.17MIT
- AlicenseNot gradedqualityBmaintenanceExposes read-only tools for searching players, fetching profiles, live matches, match history, stats, leaderboards, heroes, team-ups, insights, matches, and factions from Marvel Rivals public data. It also returns an MCP-UI player dashboard rendering rank, competitive record, live match rosters, hero win rates, and recent match form, over local stdio or Streamable HTTP.548 PyPI1MIT