A secure, containerized Model Context Protocol (MCP) server that integrates SpamAssassin for defensive email security analysis. This server provides Claude Code with comprehensive email analysis capabilities while maintaining strict security boundaries.
A secure, containerized Model Context Protocol (MCP) server that integrates SpamAssassin for defensive email security analysis. This server provides Claude Code with comprehensive email analysis capabilities while maintaining strict security boundaries.
ดาว
6
เครื่องมือ
—
อัปไทม์
—
🛡️ Security-First Design
Defensive Operations Only - This server exclusively provides security analysis capabilities:
✅ Email spam detection and analysis
✅ Sender reputation checking
✅ Rule testing and validation
✅ Configuration inspection
❌ NO email sending/relay capabilities
❌ NO malicious content generation
❌ NO offensive security tools
🚀 Quick Start
Prerequisites
Docker and Docker Compose
Claude Code with MCP support
1. Build and Start
# Clone or create the project directory
cd spamassassin-mcp
# Optional: Copy and customize configuration
cp .env.example .env
# Edit .env to customize ports and settings
# Build and start the containers
docker compose up -d
# Check health
docker compose logs spamassassin-mcp
1. Alternative: Use Pre-built Image
# Pull the latest image from Docker Hub
docker pull your-dockerhub-username/spamassassin-mcp:latest
# Run the container
docker run -d \
--name spamassassin-mcp \
-p 8081:8080 \
your-dockerhub-username/spamassassin-mcp:latest
2. Connect Claude Code
# Connect to containerized server (SSE transport)
# Server URL: http://localhost:8081/mcp
# Or for direct connection (stdio transport)
./mcp-server
3. Test the Integration
# Scan a sample email
/scan_email --content "Subject: Test Email
This is a test email for spam analysis."
# Check sender reputation
/check_reputation --sender "[email protected]"
# Get current configuration
/get_config
🔧 Available Tools
Email Analysis
scan_email
Analyze email content for spam probability and rule matches.
Parameters:
content (required): Raw email content including headers
# Check sender reputation
/check_reputation --sender "[email protected]"
# Check domain and IP
/check_reputation --domain "suspicious-domain.com" --ip "192.168.1.100"
Rule Development
# Test custom rules
/test_rules --rules "header LOCAL_TEST Subject =~ /test/i
describe LOCAL_TEST Test rule
score LOCAL_TEST 2.0" --test_emails '["Subject: test email\n\nThis is a test."]'
Score Analysis
# Get detailed score explanation
/explain_score --email_content "Subject: Free Money!\n\nClaim your prize now!"
🏥 Health Monitoring
Health Check Endpoint
The container includes automated health checks:
# Check container health
docker-compose exec spamassassin-mcp /usr/local/bin/health-check.sh
# View health status
docker ps
This project uses GitHub Actions for continuous integration and deployment:
Docker Build and Push: Automatically builds and pushes Docker images to Docker Hub on pushes to main branch and tags
Test Docker Image: Runs tests on the Docker image to ensure it builds and runs correctly
Update Docker Hub Overview: Automatically updates the Docker Hub repository description when README.md changes
Setting up Docker Hub Publishing
To use the Docker Hub publishing workflow:
Create a Docker Hub account if you don't already have one
Generate a Docker Hub access token:
Log in to Docker Hub
Go to Account Settings > Security
Click "New Access Token"
Give it a descriptive name (e.g., "GitHub Actions")
Set permissions to "Read & Write"
Copy the generated token (you won't see it again)
Set up Docker Hub credentials as GitHub Secrets:
Go to your GitHub repository settings
Click "Secrets and variables" > "Actions"
Add two new repository secrets:
DOCKER_USERNAME: Your Docker Hub username
DOCKER_PASSWORD: Your Docker Hub access token (the token you just created)
Push to the main branch or create a tag starting with v (e.g., v1.0.0)
The workflow will automatically build and push the image to Docker Hub
The published images will be available at https://hub.docker.com/r/YOUR_USERNAME/spamassassin-mcp where YOUR_USERNAME is your Docker Hub username.
Image tags:
latest - Latest build from the main branch
vX.Y.Z - Specific version tags for releases
commit-SHA - Specific commit builds
Manual Docker Hub Overview Update
You can also manually generate the Docker Hub overview:
# Generate Docker Hub overview
./scripts/extract-dockerhub-info.sh
# Or use the manual update script with your credentials
./scripts/update-dockerhub-manual.sh your-docker-username your-docker-access-token
🤝 Contributing
Contributions welcome! Please read our Contributing Guide and ensure all changes maintain the security-first, defensive-only design principles.
⚠️ Security Notice: This server is designed exclusively for defensive security analysis. It does not provide capabilities for sending emails, generating spam content, or any offensive security operations. All operations are logged and auditable.
S
Spamassassin
btafoya·6 ดาว·
A secure, containerized Model Context Protocol (MCP) server that integrates SpamAssassin for defensive email security analysis. This server provides Claude Code with comprehensive email analysis capab
A secure, containerized Model Context Protocol (MCP) server that integrates SpamAssassin for defensive email security analysis. This server provides Claude Code with comprehensive email analysis capabilities while maintaining strict security boundaries.
ตรวจสอบล่าสุดเมื่อ 2026-10-27 A secure, containerized Model Context Protocol (MCP) server that integrates SpamAssassin for defensive email security analysis. This server provides Claude Code with comprehensive email analysis capabilities while maintaining strict security boundaries.