TLS MCP Server
Analyze TLS certificates using OpenSSL and zlint.
TLS MCP Server
A Model Context Protocol (MCP) server that provides a unified, user-friendly tool for TLS certificate analysis. No more copying PEM data between functions - everything happens in one clean interface!
๐ Features
- All-in-One Interface: Single tool with flexible options for any certificate analysis need
- Smart Analysis: Automatically uses OpenSSL when available, falls back to Python cryptography
- Cipher Suite Analysis: Comprehensive TLS cipher suite and version support testing
- Security Grading: Automated security assessment with grades from A+ to F
- Flexible Options: Choose quick/detailed analysis, include/exclude PEM, enable/disable linting
- Zero PEM Copying: Analysis happens automatically without manual certificate handling
- Comprehensive Testing: Full test coverage with unit, integration, and real-world tests
๐ ๏ธ Tool Provided
fetch_certificate - All-in-One Certificate Analysis
Fetches and analyzes TLS certificates with flexible options - no need to copy PEM data between tools!
Parameters:
- hostname(required): Website hostname (e.g., "google.com")
- port(optional): Port number (default: 443)
- include_pem(optional): Include raw PEM certificate in output (default: false)
- analyze(optional): Analysis level - "none", "quick", or "detailed" (default: "quick")
- lint(optional): Run zlint compliance checking (default: false)
- use_openssl(optional): Use OpenSSL for analysis when available (default: true)
- analyze_ciphers(optional): Analyze supported cipher suites and TLS versions (default: false)
- cipher_scan_type(optional): Type of cipher scan - "quick" or "full" (default: "quick")
Analysis Options:
- Quick Analysis: Essential certificate info (subject, issuer, validity, SANs)
- Detailed Analysis: Full certificate details including extensions and key info
- OpenSSL vs Cryptography: Automatically uses OpenSSL if available, falls back to Python cryptography
Examples:
- {"hostname": "google.com"}- Quick analysis only
- {"hostname": "github.com", "analyze": "detailed", "lint": true}- Detailed analysis + zlint
- {"hostname": "badssl.com", "analyze": "none", "include_pem": true}- Just fetch PEM
๐ Prerequisites
- Python 3.13+
- zlint (for certificate linting)
- OpenSSL (for certificate operations)
Install zlint
# macOS
brew install zlint
# Linux
go install github.com/zmap/zlint/v3/cmd/zlint@latest
# Or download from releases: https://github.com/zmap/zlint/releases
๐ง Installation
- Clone and setup the project:
git clone <repository-url>
cd tls-mcp
python3.13 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .
- Install development dependencies (optional):
pip install -e ".[dev]"
- Run tests to verify installation:
pytest tests/ -v
โ๏ธ Configuration
Add the following to your Claude Desktop configuration file:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "tls-mcp-server": {
      "command": "/path/to/your/tls-mcp/venv/bin/python",
      "args": [
        "/path/to/your/tls-mcp/tls_mcp_server/main.py"
      ],
      "env": {
        "PYTHONPATH": "/path/to/your/tls-mcp"
      }
    }
  }
}
Replace /path/to/your/tls-mcp with your actual project path.
๐ฆ Usage Examples
After configuration, restart Claude Desktop and try these commands:
Quick Certificate Analysis (Default)
"Analyze the certificate for github.com"
Detailed Analysis with Compliance Check
"Do a detailed analysis of google.com's certificate and run zlint on it"
Just Fetch Certificate (No Analysis)
"Get me the raw PEM certificate for badssl.com"
Compare Multiple Certificates
"Compare the certificates from google.com and github.com - show me their key differences"
Security Assessment
"Check if example.com uses secure certificate practices with full analysis and linting"
Cipher Suite Analysis
"Analyze the cipher suites supported by github.com and give me a security assessment"
Comprehensive Security Analysis
"Do a full security analysis of google.com including cipher suites, TLS versions, and certificate compliance"
Key Benefits:
- โ No PEM copying - Analysis happens automatically
- โ Flexible options - Choose what info you need
- โ Smart defaults - Works great out of the box
- โ OpenSSL integration - Uses the best available tools
๐งช Testing
Run the comprehensive test suite:
# Run all tests (including slow integration tests)
pytest tests/ -v
# Run only fast tests (excludes slow integration tests that require internet)
pytest tests/ -m "not slow" -v
# Run with coverage
pytest tests/ --cov=tls_mcp_server --cov-report=term-missing
# Run only unit tests
pytest tests/test_mcp_server.py -v
# Run only basic integration tests
pytest tests/test_integration.py -v
# Run real-world integration tests (requires internet and zlint)
pytest tests/test_google_integration.py -v
Test Coverage
- Unit Tests: Test the new unified interface with mocked dependencies
- Cipher Analysis Tests: Test cipher categorization, TLS version detection, and security grading
- Basic Integration Tests: Test server registration and tool options
- Real-World Integration Tests: Test full workflow with live Google certificate
- Error Handling: Test various failure scenarios
- Current Coverage: 23 passing tests with comprehensive coverage
๐ Project Structure
tls-mcp/
โโโ tls_mcp_server/
โ   โโโ __init__.py          # Package initialization
โ   โโโ main.py              # MCP server implementation
โโโ tests/
โ   โโโ __init__.py            # Test package
โ   โโโ test_mcp_server.py     # Unit tests
โ   โโโ test_cipher_analysis.py # Cipher analysis tests
โ   โโโ test_integration.py    # Integration tests
โโโ pyproject.toml           # Project configuration
โโโ pytest.ini              # Test configuration
โโโ README.md               # This file
๐ Architecture
The server is built using the MCP Python SDK with a modern, user-friendly design:
- Single Tool Interface: One fetch_certificatetool with flexible options
- Smart Analysis: Automatically chooses OpenSSL or Python cryptography
- Async Operations: All operations are asynchronous for better performance
- Error Handling: Comprehensive error handling with graceful fallbacks
- Modular Helpers: Internal helper functions for different analysis methods
- No PEM Juggling: Analysis happens automatically without manual PEM copying
๐จ Security Considerations
- Certificates are processed locally - no data is sent to external services
- Network connections use standard SSL/TLS libraries
- Temporary files are cleaned up after zlint operations
- Error messages don't expose sensitive system information
๐ค Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass: pytest tests/ -v
- Submit a pull request
๐ License
MIT License - see LICENSE file for details.
๐ Troubleshooting
Common Issues
"zlint command not found"
- Install zlint using the instructions above
- Verify it's in your PATH: which zlint
"Failed to fetch certificate"
- Check your internet connection
- Verify the hostname is correct
- Some servers may block automated requests
"MCP server not appearing in Claude"
- Verify the configuration file path is correct
- Check that Python path in config points to your virtual environment
- Restart Claude Desktop after configuration changes
Debug Mode
Enable debug logging by setting the environment variable:
export PYTHONPATH="/path/to/tls-mcp"
python tls_mcp_server/main.py
๐ท๏ธ Version History
- v0.2.0: Major interface redesign with unified fetch_certificatetool, OpenSSL integration, cipher suite analysis, security grading
- v0.1.0: Initial release with basic certificate fetching, analysis, and linting
Related Servers
- Jai MCP Server- Manage Jai platform resources through Claude Code. 
- REPL MCP Server- A universal REPL session manager supporting Python, Node.js, Ruby, and more, with session management and LLM-assisted recovery. 
- MLflow Prompt Registry- Access prompt templates managed in an MLflow Prompt Registry. Requires a running MLflow server configured via the MLFLOW_TRACKING_URI environment variable. 
- Hello World MCP Server- A simple Hello World MCP server built with FastMCP, serving as a basic example. 
- Perfetto- Turn natural language into powerful Perfetto trace analysis. Quickly explain jank, diagnose ANRs, spot CPU hot threads, uncover lock contention, and find memory leaks. 
- Recent Go MCP Server- Provides Go language updates and best practices in a structured Markdown format for LLM coding agents. 
- YAPI MCP Server- An MCP server for accessing YAPI interface details, configured via environment variables. 
- Debugg AI- Enable your code gen agents to create & run 0-config end-to-end tests against new code changes in remote browsers via the Debugg AI testing platform. 
- SACL MCP Server- A framework for bias-aware code retrieval using semantic-augmented reranking and localization. 
- Playwright MCP- Generate Playwright tests with AI assistants by providing real-time access to the browser DOM, interactions, and screenshots.