Skip to main content
Glama

pqc-migration-mcp

license mcp ci deps

让你的 AI 智能体获得它一直在猜测的后量子迁移事实。

通过 MCP 提供六个工具:凭据大小、分片数量、重组窗口、39 个失败族分类以及基准评分。问 Claude “我们的 ML-KEM-768 握手能否放进 BLE MTU?”,它会计算出答案,而不是估算一个。

📖 完整文档、教程和概念指南:https://nickharris808.github.io/pqc-toolkit/


为什么存在这个项目

智能体越来越多地参与 PQC 迁移工作,而它们恰恰在关键问题上自信地犯错:凭据实际有多大、会分成多少分片、在你的并发下是否存在安全的重组上限。这些是算术问题,不是判断问题——所以把算术交给智能体。

这里的协议层是零依赖的。MCP 是基于换行分隔 stdio 的 JSON-RPC 2.0,小到可以直接实现,并且让安装变得非常简单。

Related MCP server: attestix

安装

pip install git+https://github.com/nickharris808/pqc-migration-mcp

这也会从其仓库拉取 pqc-sizes 和 pqc-mfb。目前它们还未发布到 PyPI,所以 pip install pqc-migration-mcp 目前无法使用。

30 秒快速上手

# talk to it directly -- it is line-delimited JSON-RPC on stdio
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | pqc-migration-mcp

Claude Desktop

添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "pqc-migration": {
      "command": "pqc-migration-mcp"
    }
  }
}

重启 Claude Desktop。六个工具会出现在连接器下。

工具

工具

回答的问题

credential_size

KEM+签名凭据有多少字节,逐组件计算?

fragments

在此传输上有多少分片——分片现在是否强制?

reassembly_window

是否存在安全容量上限?如果不存在,什么并发 可以 工作?

list_failure_families

全部 39 个失败族,包含案例数和已发表的类似物

describe_family

该族中什么会失效、在哪些设计中、每个设计做了什么?

score_submission

对 PQC-MFB 提交进行评分:覆盖率、回归、零覆盖族

工作示例——实际输出

传输是换行分隔的 JSON——每行一个完整对象。请将请求保持在一行;跨两行的请求会到达为两个不完整的请求,并返回两个 -32700 解析错误。

$ echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"reassembly_window","arguments":{"largest_legitimate_object":12000,"memory_budget":32768,"concurrency":3}}}' | pqc-migration-mcp

服务器每行回复一个 JSON 对象。经过美化打印后,该回复的 content 负载是:

{
  "budget": 32768,
  "ceiling": 10922,
  "concurrency": 3,
  "explanation": "EMPTY WINDOW: floor 12,000 B > ceiling 10,922 B (short by 1,078 B). No capacity cap is both feasible and safe. Raise the budget to at least 36,000 B, reduce concurrency to at most 2, or choose a smaller credential.",
  "floor": 12000,
  "is_empty": true,
  "max_safe_concurrency": 2,
  "recommended_cap": null
}

智能体得到判定以及能修复它的数字,因此它可以提出具体更改,而不是报告问题。

此服务器不会告诉你什么

它暴露检测。它不暴露修复。

智能体可以了解到某个设计在 krack_retransmission 上失败,以及未修复的设计具体做了什么。它无法获得关闭该问题的机制。这个边界是刻意的:一个返回修复方案的 MCP 工具会让任何用户在一个下午内枚举出整个封闭集合。

有一个测试会对全部 39 个族调用 describe_family,再加上所有其他工具,将响应拼接起来,如果输出中任何地方出现 repair_mechanism、repaired_detail 或 repaired_held,测试就会失败。

错误语义

领域错误——未知算法、未知族——会作为工具结果返回,带有 isError: true 和一条列出有效选项的消息,以便智能体自行纠正。只有协议故障才会变成 JSON-RPC 错误(-32601 未知方法/工具、-32602 参数错误、-32700 无法解析的行)。

格式错误的行不会终止循环;服务器会回复解析错误并继续服务。

测试

pip install -e ".[dev]" && pytest      # 57 passed

测试覆盖协议、每个工具、护城河边界,以及作为子进程驱动的真实 stdio 传输——包括检查stderr 保持为空,因为 MCP 客户端将 stdout 读作协议,杂散警告会混淆它们。

范围

算术、分类查找和评分。没有密码学、没有网络、没有遥测。它不检查你的实现。一个干净的答案意味着你的配置是合理的,而不是你的代码强制执行了它。

相关

pqc-sizes · pqc-mfb · pqc-guard-action · pqc-dos-embedded

关闭 39 个族是封闭核心所做的事情。相关主题已由已提交的临时专利申请覆盖。如需商业使用完整包络,请打开 GitHub Discussion 或在此仓库上提交 issue。

诚实的范围

这证明了什么。 智能体推理所用的算术和分类是正确的:真实的凭据大小、真实的分片数量、真实的窗口判定,以及真实的失败分类。

它不证明什么。

  • 不证明智能体使用了答案。 这提供事实;它不监督这些事实被如何使用。

  • 不检查你的代码。 这里没有工具读取你的实现。

  • 不是修复通道。 每个工具只暴露检测。一个测试会对全部 39 个族调用 describe_family,再加上所有其他工具,如果输出中任何地方出现修复字段,测试就会失败。

错误。 领域问题会作为工具结果返回,带有 isError: true 和一条列出有效选项的消息,以便智能体自我纠正。只有协议故障才会变成 JSON-RPC 错误。


PQC 迁移工具包

为团队将认证密钥交换迁移到后量子而准备的十一个免费工具。它们发现和测量;它们不修复。

工具

作用

位置

pqc-sizes

大小、分片数量,以及双向重组窗口

源码

pqc-sizes-js

适用于 Node 和浏览器的相同算术

源码

pqc-guard-action

当窗口为空时使构建失败

GitHub Action

pqc-dos-embedded

169 行 C 代码:在真实 64 KB 设备上的失败

源码

farkas-check

在设备上重新验证边界,无需 SMT 求解器

源码

pqc-bounds-lean

用 Lean 4 证明的相同边界——0 个 sorry,0 个导入

源码

pqc-dos-gate-rtl

可综合 RTL 中的门,5 个 Yosys 证明

源码

pqc-migration-mcp ← 你在这里

面向 AI 智能体的六个 MCP 工具

源码

pqc-mfb

322 个案例 · 39 个失败族 · 评分器

源码

pqc-mfb (数据)

作为数据集的基准

HF

pqc-formal-corpus

122 个命名形式化结果,6 个证明器

HF

pqc-explorer

在浏览器中试用,无需安装

HF Space

刚接触? 端到端教程 用大约十分钟带你完成一个真实迁移,涵盖所有工具:大小 -> 窗口 -> CI 门 -> 基准。

赶时间? pqc-sizes 在五秒内告诉你凭据是否分片以及是否存在安全上限。pqc-explorer 在浏览器中做同样的事情,无需安装。

封闭核心

关闭 39 个失败族——降级绑定、重传安全安装、分片转录、漫游前向保密、多链路密钥分离、准入控制、组密钥绑定——是一个独立的专有代码库。相关主题已由已提交的临时专利申请覆盖。

这种划分是经过测量的,而非断言:在复制噪声控制下,32 个修复机制中只有 4 个在外部可区分,因此发布这些检测器不会泄露修复方案。

如需商业许可,请打开 GitHub Discussion 或在任何这些仓库上提交 issue。

许可证

Apache-2.0。参见 LICENSE 和 CONTRIBUTING.md。

Available Tools

6 tools
credential_sizeC

Total on-wire bytes for a KEM + signature credential, with a per-component breakdown.

Inputs: kem, sig.

describe_familyA

Detail for one failure family: the invariants it breaks, the unrepaired designs that fail it, and what each did. Does not return repairs.

Inputs: family (required).

fragmentsB

How many fragments an object becomes on a transport, and whether fragmentation is therefore mandatory.

Inputs: object_bytes (required), frame_payload (required).

list_failure_familiesA

All 39 post-quantum migration failure families, with case counts and published prior-art analogues.

Inputs: no named parameters.

reassembly_windowC

The two-sided reassembly-capacity window. Returns is_empty=true when NO capacity cap is both feasible and safe, plus the maximum concurrency that would be safe.

Inputs: concurrency (required), memory_budget (required), largest_legitimate_object (required).

score_submissionB

Score a PQC-MFB submission ({case_id: bool}). Returns coverage, regressions, and which families have zero coverage.

Inputs: submission (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of PQC migration analysis: failure families, reassembly capacity, submission scoring, credential size, family details, and fragmentation. No overlaps in functionality.

    Naming Consistency4/5

    Most tools follow a verb_noun pattern with underscores (list_failure_families, score_submission, describe_family). 'credential_size' and 'reassembly_window' are noun-like but still clear; 'fragments' is a single noun, slightly deviating.

    Tool Count5/5

    The set includes 6 tools, which is well within the ideal 3-15 range. Each tool addresses a specific need without redundancy, making the scope manageable and focused.

    Completeness3/5

    The tools cover querying failure families and scoring submissions, but lack submission management, repair retrieval (noted in describe_family), and listing submissions. Some gaps exist for a full workflow.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to perform quantum-resistant cryptographic operations using NIST-standardized algorithms including ML-KEM, ML-DSA, and SPHINCS+. Supports key generation, encryption, digital signatures, and security analysis for post-quantum cryptography research and development.
      25
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for compliance automation of AI agents, enabling EU AI Act compliance, verifiable credentials, and decentralized identity management with 47 tools across 9 modules.
      41 PyPI
      622
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      Defense-grade cryptographic compliance and analysis tools for MCP, including FIPS 140-3 validation, CNSA 2.0 analysis, post-quantum readiness assessment, and classical cipher utilities.
      18
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Post-quantum readiness for AI coding agents: scans code for quantum-vulnerable cryptography (RSA/ECDH/ECDSA/DH) and returns NIST ML-KEM/ML-DSA/SLH-DSA (and hybrid) migration guidance, with fix verification and dependency checks. Content-based, advisory tools only; runs local (npx @quantakrypto/mcp) or as a hosted OAuth endpoint.
      16
      16
      Apache 2.0