Skip to main content
Glama
README.md
# Post-Quantum Audit MCP

![Two illuminated optical fibers crossing a dark network circuit board](docs/assets/post-quantum-cover.jpg)

Find cryptographic dependencies in source code and CycloneDX inventories, verify TLS 1.3 negotiation, and check migration decisions against live publisher documentation. Use the standalone CLI or connect the local Model Context Protocol server to **Codex** or **Claude Code**.

[Quick start](#quick-start) · [Live documentation](#live-documentation) · [CycloneDX inventories](#cyclonedx-inventories) · [Codex and Claude Code](#codex-and-claude-code) · [Audit another project](#audit-another-project) · [References](#research-and-references)

## Quick start

Install **Node.js 22 or newer**, then run:

```sh
git clone https://github.com/matthews-wong/post-quantum-audit-mcp.git
cd post-quantum-audit-mcp
npm ci
npm test
node src/cli.js search "Cloudflare origin"
```

Try the included synthetic Cloudflare inventory and logs:

```sh
node src/cli.js audit --inventory examples/inventory.json \
  --cloudflare-log examples/cloudflare-logpush.ndjson --max-findings 10
```

![Rendered sample audit output showing hybrid key exchange at the edge, classical key exchange at the origin, and authentication evidence gaps](docs/assets/audit-example.png)

The demo shows why migration reports should track each connection and cryptographic role. A visitor can negotiate `X25519MLKEM768` at the edge while the origin uses classical `X25519`. Both connections still need independent authentication evidence. [IETF hybrid TLS specification](https://www.rfc-editor.org/info/rfc10024) · [Cloudflare traffic guide](https://developers.cloudflare.com/use-cases/solutions/protect-traffic-post-quantum-encryption/)

## Live documentation

Start with a question such as “How does Cloudflare select a hybrid key exchange for my origin?” Search the local catalog, then fetch the relevant passage directly from the publisher.

```sh
node src/cli.js sources cloudflare --live-only
node src/cli.js document cf-origin --find "Automatic key exchange"
node src/cli.js document hybrid --find "Negotiated Groups"
```

In an MCP client, use `pqc_sources` with `{"query":"cloudflare","liveOnly":true}`, then `pqc_read_document` with `{"source":"cf-origin","find":"Automatic key exchange"}`. Results include the source URL, retrieval time, line range and SHA-256 digest of the downloaded document. To continue reading, pass `nextLine` as `startLine` and omit the search phrase.

The catalog includes 55 references. Four Cloudflare documents and ten RFCs support live passage retrieval. Each call requests the indexed publisher over HTTPS with a ten-second timeout and a 1 MiB download limit. The phrase search runs locally. Publisher outages surface as tool errors. The bundled guides and source catalog work offline. [Cloudflare origin guide](https://developers.cloudflare.com/ssl/post-quantum-cryptography/pqc-to-origin/) · [RFC 10024](https://www.rfc-editor.org/info/rfc10024)

## CycloneDX inventories

```sh
node src/cli.js cbom examples/crypto-bom.json
```

The example declares ML-KEM-768 and an ECDSA signature inside a service component. The report flags ECDSA for authentication migration and records ML-KEM as a static indication. To establish what the service negotiates, add deployment observations to the audit workflow below.

Use `pqc_review_cbom` with `{"path":"examples/crypto-bom.json"}` or a JSON file under the configured workspace. It accepts CycloneDX 1.6 and 1.7, visits nested components and the metadata component, and reviews up to 100 mapped algorithms per page (4 MiB per file). To read the next page, pass the returned `page.nextCursor` as the MCP `cursor` or CLI `--cursor`. Continue until it is null. Each cursor identifies the file contents used for the first page. If the file changes, restart the review. Coverage counts show unsupported assets across the file and mapped algorithms remaining after this page. Certificate assets and related key material count toward unsupported coverage. [Sample CBOM](examples/crypto-bom.json) · [CycloneDX JSON reference](https://www.cyclonedx.org/docs/1.7/json/)

## Codex and Claude Code

After `npm ci`, launch your client from this repository root. The project configurations start the same local stdio server.

| Client | Setup | Skills |
| --- | --- | --- |
| Codex | Trust the project so [`.codex/config.toml`](.codex/config.toml) loads. Use `/mcp` to check the connection. | `$post-quantum-audit` and `$post-quantum-migrate` |
| Claude Code | Approve the server from [`.mcp.json`](.mcp.json) when prompted. Use `/mcp` to check the connection. | `/post-quantum-audit` and `/post-quantum-migrate` |

Clients with MCP prompt support can also request `pqc_migration_review` with a `stack` argument such as `Go behind Cloudflare`. It walks through source discovery, inventory evidence and rollout checks.

Try asking **“Audit this workspace for post-quantum readiness. Prioritize long-lived data and show what still needs runtime evidence.”** [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli) · [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp)

## Audit another project

From the target project root, point to the installed helper with an absolute path.

```sh
pqc_cli="/absolute/path/to/post-quantum-audit-mcp/src/cli.js"
node "$pqc_cli" audit --workspace "$PWD"
```

For MCP access inside that project, run the command for your client and restart the session.

```sh
codex mcp add post-quantum -- node "$pqc_cli" serve --workspace "$PWD"
claude mcp add --scope local post-quantum -- node "$pqc_cli" serve --workspace "$PWD"
```

The Codex command creates a user-level entry anchored to the supplied workspace. For project-level setup, add the equivalent server entry to the target project's `.codex/config.toml` and use absolute paths. Copy the skill directories from [`.agents/skills`](.agents/skills) or [`.claude/skills`](.claude/skills) to the corresponding location in that project to use the skills there.

## Audit workflow

1. **Inventory the source.** Run `node "$pqc_cli" scan --workspace "$PWD"`. Review flagged protocol settings, crypto APIs, public certificates, signature and password-hash usage, and provider indicators. Each result includes a file location, a rule and a follow-up action.
2. **Add deployment evidence.** Use [the inventory example](examples/inventory.json) to record observed algorithms, roles, and expected evidence. `node "$pqc_cli" assess inventory.json` returns prioritized migration actions and gaps. Optional `observedAt` and `reference` fields can tie results to a timestamp and ticket or log.
3. **Verify a TLS endpoint you manage.** Run `node "$pqc_cli" tls api.example.com`. Add `--hybrid-only` to check hybrid compatibility with OpenSSL 3.5 or later and a supported build. OpenSSL verifies the peer using its configured trust store. The result describes one TCP TLS 1.3 handshake. Use production telemetry for fallback, QUIC and other connection legs.
4. **Review Cloudflare traffic.** Export `ClientTLSKeyExchangeGroup` and `OriginTLSKeyExchangeGroup` from Logpush and pass the JSON or NDJSON to `node "$pqc_cli" cloudflare-traffic logpush.ndjson`. Process up to 10,000 rows per batch. Use `audit --inventory inventory.json --cloudflare-log logpush.ndjson` for a combined report.

The static scan examines up to 20,000 entries and 2 MiB per file by default, with up to 500 findings in the output. It reports coverage counters and skips recognized credential files, private-key PEMs, symlinks, excluded directories, and gitignored paths. Review matches in documentation, dependencies, tests and disabled options before acting. Complete a deployment audit with effective provider settings, deployed binaries, certificate chains, runtime negotiation and managed-service telemetry. [Audit runbook](knowledge/audit.md)

## MCP tools

| Tool | Purpose |
| --- | --- |
| `pqc_search` and `pqc_read_guide` | Search the dated knowledge base or open a guide with primary references. Resources also appear under `pqc://knowledge/`. |
| `pqc_sources` and `pqc_read_document` | Discover publisher references and retrieve current passages by source ID, phrase or line. |
| `pqc_review_cbom` | Read a local CycloneDX JSON inventory and triage supported algorithm declarations. |
| `pqc_scan` | Inspect workspace code, configuration and public certificate files. |
| `pqc_assess` | Evaluate role-specific observations and get migration guidance for the supplied stack. |
| `pqc_audit` | Combine source findings, supplied runtime inventory and Cloudflare data. |
| `pqc_cloudflare_traffic` | Summarize reported TLS key exchanges on visitor and origin connections. |
| `pqc_tls_observe` | Verify one user-selected TLS 1.3 endpoint. Enable by appending `--allow-tls` to the server arguments. |

## Research and references

The knowledge base was reviewed on **December 4, 2026**. The guides link to primary sources and label published standards, current deployment guidance and roadmap milestones.

| Guide | Primary reference |
| --- | --- |
| [December developments and standards](knowledge/briefing.md) | [Industry joint statement](https://openai.com/index/joint-statement-post-quantum-cryptography/) · [NIST transition guidance](https://nvlpubs.nist.gov/nistpubs/ir/2026/NIST.IR.8547.pdf) |
| [Cloudflare deployment and verification](knowledge/cloudflare.md) | [Cloudflare traffic guide](https://developers.cloudflare.com/use-cases/solutions/protect-traffic-post-quantum-encryption/) · [Project Quantum Leap](https://blog.cloudflare.com/project-quantum-leap) |
| [TLS, certificates, hashes and passwords](knowledge/primitives.md) | [ML-KEM](https://csrc.nist.gov/pubs/fips/203/final) · [ML-DSA](https://csrc.nist.gov/pubs/fips/204/final) · [SLH-DSA](https://csrc.nist.gov/pubs/fips/205/final) |
| [Runtime, protocol and provider compatibility](knowledge/stack.md) | [IETF TLS hybrids](https://www.rfc-editor.org/info/rfc10024) · [OpenSSH post-quantum guidance](https://www.openssh.org/pq.html) |
| [Inventory and rollout runbook](knowledge/audit.md) | [NCCoE migration project](https://www.nccoe.nist.gov/applied-cryptography/migration-to-pqc) · [Complete source index](knowledge/index.json) |

For research updates, record the primary URL, publication or revision date and affected behavior, then update the relevant guide and run `npm test`. For code issues, share sanitized findings and reproduction steps without credentials or production data.

## Author and license

**Matthews Wong** · [@matthews-wong](https://github.com/matthews-wong) · [MIT License](LICENSE)

TDQS

B3.4/5.0

Scored across 9 tools

Disambiguation4/5

Most tools have clearly distinct purposes, especially the research/document tools versus workspace and inventory analysis tools. The main overlap is between pqc_scan, pqc_audit, and pqc_assess, which all analyze cryptographic posture from different inputs and could be confused at first glance, though the descriptions distinguish their intended scopes.

Naming Consistency4/5

All tools use a consistent pqc_ prefix and snake_case formatting, which makes the set easy to scan. There is minor inconsistency between verb-style names like pqc_scan and pqc_assess and noun-style names like pqc_sources and pqc_cloudflare_traffic, but the convention remains predictable enough.

Tool Count5/5

Nine tools is well-scoped for a post-quantum audit server, covering scanning, evidence gathering, assessment, research, and CBOM review without excessive surface area. Each tool appears to earn its place in the audit workflow.

Completeness4/5

The surface covers the core audit lifecycle: scanning, inventory assessment, Cloudflare traffic evidence, CBOM review, and supporting research/document access. Minor gaps exist around report generation or exporting audit findings, but agents can work around these by assembling outputs from the existing tools.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues