Post-Quantum Cryptography MCP Server
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.
README
Post-Quantum Cryptography MCP Server
A Model Context Protocol (MCP) server that provides post-quantum cryptographic operations using Open Quantum Safe's liboqs. Enables AI assistants like Claude to perform quantum-resistant cryptographic operations including key generation, encryption, signing, and verification.
Why Post-Quantum Cryptography?
Current cryptographic systems (RSA, ECC, ECDSA) will be broken by quantum computers running Shor's algorithm. NIST has standardized new quantum-resistant algorithms:
| Standard | Algorithm | Type | Status |
|---|---|---|---|
| FIPS 203 | ML-KEM (Kyber) | Key Encapsulation | Finalized 2024 |
| FIPS 204 | ML-DSA (Dilithium) | Digital Signature | Finalized 2024 |
| FIPS 205 | SLH-DSA (SPHINCS+) | Hash-based Signature | Finalized 2024 |
This MCP server makes these algorithms accessible to AI agents for research, development, and integration.
Features
- 32 Key Encapsulation Mechanisms (KEMs): ML-KEM, FrodoKEM, HQC, BIKE, Classic McEliece
- 221 Signature Algorithms: ML-DSA, Falcon, SPHINCS+, MAYO, CROSS, UOV
- Full MCP Integration: Works with Claude Desktop, Claude Code, Cursor, and any MCP client
- NIST Standards Compliant: Implements FIPS 203, 204, and 205 algorithms
- Security Analysis: Compare classical vs quantum security levels
Quick Start
Prerequisites
Installation
1. Install liboqs
macOS (Homebrew with shared library):
# Homebrew only provides static library, build from source for shared:
git clone --depth 1 --branch 0.15.0 https://github.com/open-quantum-safe/liboqs.git
cd liboqs && mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
make -j4 && make install
Ubuntu/Debian:
sudo apt-get install liboqs-dev
2. Clone and Install
git clone https://github.com/scottdhughes/post-quantum-mcp.git
cd post-quantum-mcp
# Create virtual environment with Python 3.10+
uv venv --python 3.10 .venv
source .venv/bin/activate
# Install dependencies
uv pip install liboqs-python "mcp>=1.0.0"
3. Configure Claude Code / Claude Desktop
Add to your MCP configuration:
Claude Code (~/.claude.json):
{
"mcpServers": {
"pqc": {
"type": "stdio",
"command": "/path/to/post-quantum-mcp/run.sh",
"args": [],
"env": {}
}
}
}
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"pqc": {
"command": "/path/to/post-quantum-mcp/run.sh"
}
}
}
Available Tools
pqc_list_algorithms
List all available post-quantum algorithms.
Input: { "type": "kem" | "sig" | "all" }
Output: List of available algorithms with NIST standard mappings
pqc_algorithm_info
Get detailed information about a specific algorithm.
Input: { "algorithm": "ML-KEM-768" }
Output: Key sizes, security level, performance characteristics
pqc_generate_keypair
Generate a quantum-resistant key pair.
Input: { "algorithm": "ML-DSA-65" }
Output: Base64-encoded public and secret keys
pqc_encapsulate
Perform key encapsulation (create shared secret).
Input: { "algorithm": "ML-KEM-768", "public_key": "<base64>" }
Output: Ciphertext and shared secret
pqc_decapsulate
Recover shared secret from ciphertext.
Input: { "algorithm": "ML-KEM-768", "secret_key": "<base64>", "ciphertext": "<base64>" }
Output: Shared secret
pqc_sign
Sign a message with a post-quantum signature.
Input: { "algorithm": "ML-DSA-65", "secret_key": "<base64>", "message": "Hello, quantum world!" }
Output: Base64-encoded signature
pqc_verify
Verify a post-quantum signature.
Input: { "algorithm": "ML-DSA-65", "public_key": "<base64>", "message": "...", "signature": "<base64>" }
Output: { "valid": true/false }
pqc_hash_to_curve
Hash a message using quantum-safe hash functions.
Input: { "message": "data", "algorithm": "SHA3-256" | "SHA3-512" | "SHAKE128" | "SHAKE256" }
Output: Digest in hex and base64
pqc_security_analysis
Analyze security properties of an algorithm.
Input: { "algorithm": "ML-KEM-768" }
Output: NIST level, classical/quantum security equivalents, Grover/Shor resistance
Supported Algorithms
Key Encapsulation Mechanisms (KEMs)
| Algorithm | NIST Level | Public Key | Ciphertext | Shared Secret |
|---|---|---|---|---|
| ML-KEM-512 | 1 | 800 B | 768 B | 32 B |
| ML-KEM-768 | 3 | 1,184 B | 1,088 B | 32 B |
| ML-KEM-1024 | 5 | 1,568 B | 1,568 B | 32 B |
| FrodoKEM-640 | 1 | 9,616 B | 9,720 B | 16 B |
| HQC-128 | 1 | 2,249 B | 4,481 B | 64 B |
Digital Signatures
| Algorithm | NIST Level | Public Key | Signature | Notes |
|---|---|---|---|---|
| ML-DSA-44 | 2 | 1,312 B | 2,420 B | Balanced |
| ML-DSA-65 | 3 | 1,952 B | 3,309 B | Recommended |
| ML-DSA-87 | 5 | 2,592 B | 4,627 B | High security |
| Falcon-512 | 1 | 897 B | 653 B | Smallest sigs |
| Falcon-1024 | 5 | 1,793 B | 1,280 B | Compact |
| SPHINCS+-SHA2-128f | 1 | 32 B | 17,088 B | Stateless, hash-based |
| SPHINCS+-SHA2-256f | 5 | 64 B | 49,856 B | Maximum security |
Example Usage with Claude
Once configured, you can ask Claude:
"Generate an ML-KEM-768 keypair and show me the security analysis"
"Sign the message 'Hello quantum world' using ML-DSA-65 and verify it"
"Compare the signature sizes of Falcon-512 vs SPHINCS+-SHA2-128f"
"What's the quantum security level of ML-KEM-1024?"
Architecture
post-quantum-mcp/
├── pqc_mcp_server/
│ ├── __init__.py # Main MCP server implementation
│ └── __main__.py # Entry point
├── run.sh # Wrapper script (sets DYLD_LIBRARY_PATH)
├── pyproject.toml # Package configuration
└── README.md
Security Considerations
- Key Storage: This server generates keys in memory. For production use, implement secure key storage.
- Side Channels: liboqs implementations aim to be constant-time but may not be suitable for all threat models.
- Algorithm Selection: ML-KEM and ML-DSA are NIST-approved. Other algorithms are experimental.
- Version Compatibility: Ensure liboqs version matches liboqs-python expectations.
Development
# Run tests
python -m pytest tests/
# Format code
python -m black pqc_mcp_server/
# Type checking
python -m mypy pqc_mcp_server/
Related Projects
- Open Quantum Safe - The liboqs library
- Model Context Protocol - MCP specification
- quantum-proof-bitcoin - Bitcoin with PQC signatures
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details.
Acknowledgments
- Open Quantum Safe Project for liboqs
- Anthropic for the Model Context Protocol
- NIST for PQC standardization efforts
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。