PQC Readiness Analyzer MCP Server
A Model Context Protocol (MCP) server that analyzes Git commits for Post-Quantum Cryptography (PQC) readiness. This server integrates with your crypto-agility framework to provide automated analysis of cryptographic algorithm usage and quantum risk assessment.
Features
- Git Commit Analysis: Analyzes code changes in Git commits to detect cryptographic algorithms
- PQC Algorithm Detection: Identifies classical, PQC, and hybrid cryptographic algorithms
- Readiness Scoring: Calculates deterministic PQC readiness percentages
- Risk Classification: Categorizes quantum risk levels (LOW, MEDIUM, HIGH, CRITICAL)
- Detailed Reporting: Provides comprehensive analysis with recommendations
Supported Algorithms
Post-Quantum (PQC-Safe)
- Dilithium (Dilithium2, Dilithium3, Dilithium5) - NIST FIPS 204
- Falcon (Falcon-512, Falcon-1024) - NIST FIPS 206
- SPHINCS+ - NIST FIPS 205
- Hybrid (RSA+Dilithium) - Experimental
Classical (Quantum-Vulnerable)
- RSA (RSA-2048, RSA-3072, RSA-4096)
- ECDSA (P-256, secp256r1)
Hash Functions (Quantum-Resistant)
- SHA-256, SHA-3 (quantum-resistant for hashing)
Installation
Prerequisites
- Python 3.10 or higher
- Git installed and accessible from command line
- Access to your Git repository
Setup
- Install dependencies:
cd /Users/sucharitapaul/Documents/Cline/MCP/pqc-analyzer
pip install -r requirements.txt
- Make the server executable:
chmod +x server.py
Configuration
Add the server to your MCP settings file at:
/Users/sucharitapaul/Library/Application Support/IBM Bob/User/globalStorage/ibm.bob-code/settings/mcp_settings.json
{
"mcpServers": {
"pqc-analyzer": {
"command": "python3",
"args": ["/Users/sucharitapaul/Documents/Cline/MCP/pqc-analyzer/server.py"],
"disabled": false,
"alwaysAllow": [],
"disabledTools": []
}
}
}
Available Tools
1. analyze_commit_pqc_readiness
Analyzes a Git commit for PQC readiness and provides a comprehensive report.
Parameters:
commit_id(required): Git commit SHA to analyzerepo_path(optional): Path to Git repository (defaults to current directory)
Returns:
- Total algorithms detected
- PQC-safe vs unsafe counts
- Classical, PQC, and hybrid algorithm counts
- PQC readiness percentage (0-100%)
- Quantum risk level (LOW/MEDIUM/HIGH/CRITICAL)
- Detailed list of detected algorithms with file locations
- Actionable recommendations
Example Usage:
Analyze commit abc123 for PQC readiness in the current repository
2. get_pqc_algorithm_info
Provides detailed information about cryptographic algorithms.
Parameters:
algorithm(optional): Specific algorithm name (DILITHIUM, FALCON, SPHINCS, RSA, ECDSA, HYBRID)
Returns:
- Algorithm specifications
- NIST standardization status
- Security levels
- Key sizes and signature sizes
- Quantum safety status
- Recommended use cases
Example Usage:
Get information about DILITHIUM algorithm
How It Works
Algorithm Detection
The server uses pattern matching to detect cryptographic algorithms in code:
- Pattern Recognition: Scans code for algorithm-specific patterns (e.g.,
RSA_3072,DilithiumKeyPairGenerator,AlgorithmType.FALCON) - File Analysis: Analyzes Java, Python, JavaScript, TypeScript, Go, C/C++ files
- Context Extraction: Captures the code context where algorithms are used
PQC Readiness Calculation
PQC Readiness % = (PQC-Safe Algorithms / Total Algorithms) × 100
Risk Level Classification:
- LOW (90-100%): Excellent PQC readiness
- MEDIUM (70-89%): Good progress, some work needed
- HIGH (40-69%): Significant quantum risk exposure
- CRITICAL (0-39%): Immediate action required
Recommendations Engine
The server provides context-aware recommendations:
- Migration strategies for classical algorithms
- Hybrid approach suggestions for gradual transitions
- NIST standard compliance guidance
- Priority levels based on risk assessment
Integration with Crypto-Agility Framework
This MCP server is designed to work seamlessly with your existing crypto-agility framework:
- Recognizes
AlgorithmTypeenum values (RSA_3072, ECDSA_P256, DILITHIUM3, FALCON512, HYBRID_RSA_DILITHIUM) - Detects key pair generators (RSAKeyPairGenerator, DilithiumKeyPairGenerator, etc.)
- Identifies certificate builders (ClassicalCertificateBuilder, PQCCertificateBuilder, HybridCertificateBuilder)
- Analyzes policy-driven configurations
Example Analysis Report
# PQC Readiness Analysis Report
## Commit Information
- Commit ID: abc123def456
- Repository: /path/to/repo
## Summary Statistics
- Total Algorithms Detected: 5
- PQC-Safe Algorithms: 3
- PQC-Unsafe Algorithms: 2
- Classical Algorithms: 2
- Hybrid Algorithms: 1
## PQC Readiness Score
- Score: 60.0%
- Quantum Risk Level: HIGH
## Detected Algorithms
### 1. RSA (CLASSICAL)
- File: `src/main/java/com/example/KeyGen.java`
- Line: 45
- PQC Safe: ❌ No
- Context: `KeyPairGenerator.getInstance("RSA")`
### 2. DILITHIUM (PQC)
- File: `src/main/java/com/example/PQCKeyGen.java`
- Line: 23
- PQC Safe: ✅ Yes
- Context: `new DilithiumKeyPairGenerator()`
## Recommendations
⚠️ CRITICAL: Found 2 classical algorithm(s). Consider hybrid approach (RSA+Dilithium) for gradual migration.
🟡 MEDIUM PRIORITY: PQC readiness is moderate. Plan migration strategy for remaining classical algorithms.
✅ Good: 1 hybrid algorithm(s) detected. This provides a balanced transition path to full PQC.
Troubleshooting
Common Issues
-
Git command not found
- Ensure Git is installed and in your PATH
- Test with:
git --version
-
Permission denied
- Make server.py executable:
chmod +x server.py
- Make server.py executable:
-
MCP SDK not found
- Install dependencies:
pip install -r requirements.txt
- Install dependencies:
-
Invalid commit ID
- Verify commit exists:
git log --oneline - Use full or short SHA (minimum 7 characters)
- Verify commit exists:
Development
Testing the Server
# Test locally
python3 server.py
# Test with a specific commit
# (Use through MCP client or IBM Bob)
Extending Algorithm Detection
To add new algorithm patterns, edit the ALGORITHM_PATTERNS dictionary in server.py:
'NEW_ALGORITHM': {
'patterns': [
r'pattern1',
r'pattern2',
],
'family': 'PQC', # or 'CLASSICAL', 'HYBRID'
'pqc_safe': True # or False
}
License
Part of the crypto-agility framework Bob-athon initiative.
Support
For issues or questions, refer to the main crypto-agility framework documentation.
Metadata
Release files for pqc-analyzer-mcp 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pqc_analyzer_mcp-1.0.0.tar.gz | 20.0 kB | Without provenance | Details for pqc_analyzer_mcp-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pqc_analyzer_mcp-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pqc_analyzer_mcp-1.0.0-py3-none-any.whl |
Total release size: 31.2 kB
Release files / pqc_analyzer_mcp-1.0.0.tar.gz
| Download URL | pqc_analyzer_mcp-1.0.0.tar.gz |
|---|---|
| Size | 20.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
03956accaf6bec46ccf080802e6a33139a995f73352af636cd2350f4a981b56a
|
|
BLAKE2b-256 checksum How to use checksums |
c375dd241d4e8fb5d90398af90633cf244bbff2331aea8a0d2f7bab7f9b1bfb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / pqc_analyzer_mcp-1.0.0-py3-none-any.whl
| Download URL | pqc_analyzer_mcp-1.0.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4c831b3d054dccf251d8d1441c97b08975fea3373d488eff1b6898e2eef27cb
|
|
BLAKE2b-256 checksum How to use checksums |
b7eee33e129f30896580d97db1e3961e168c30f262f15c65b934836020ab3e46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for pqc-analyzer-mcp 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.