A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
A secure, containerized Model Context Protocol (MCP) server that integrates SpamAssassin for defensive email security an
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.
Defensive Operations Only - This server exclusively provides security analysis capabilities:
# 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
# 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
# Connect to containerized server (SSE transport)
# Server URL: http://localhost:8081/mcp
# Or for direct connection (stdio transport)
./mcp-server
# Scan a sample email
/scan_email --content "Subject: Test Email
This is a test email for spam analysis."
# Check sender reputation
/check_reputation --sender "test@example.com"
# Get current configuration
/get_config
scan_emailAnalyze email content for spam probability and rule matches.
Parameters:
content (required): Raw email content including headersheaders (optional): Additional headers to analyzecheck_bayes (optional): Include Bayesian analysisverbose (optional): Return detailed rule explanationsExample:
{
"content": "Subject: Urgent Action Required\\n\\nClick here to claim your prize!",
"verbose": true,
"check_bayes": true
}
check_reputationCheck sender reputation and domain/IP blacklists.
Parameters:
sender (required): Email sender addressdomain (optional): Sender domainip (optional): Sender IP addressexplain_scoreExplain how a spam score was calculated with detailed breakdown.
get_configRetrieve current SpamAssassin configuration and status.
update_rulesUpdate SpamAssassin rule definitions (defensive updates only).
Parameters:
source (optional): Rule source (official/custom)force (optional): Force update even if recenttest_rulesTest custom rules against sample emails in a safe environment.
Parameters:
rules (required): Custom rule definitionstest_emails (required): Array of sample emails to testspamassassin-mcp/
├── main.go # MCP server entry point
├── go.mod # Go module definition
├── Dockerfile # Multi-stage container build
├── docker-compose.yml # Service orchestration
├── internal/
│ ├── config/ # Configuration management
│ ├── handlers/ # MCP tool handlers
│ └── spamassassin/ # SpamAssassin client wrapper
├── configs/
│ └── config.yaml # Server configuration
├── scripts/
│ ├── entrypoint.sh # Container initialization
│ └── health-check.sh # Health monitoring
└── README.md
| Variable | Default | Description |
|---|---|---|
SA_MCP_HOST_PORT | 8081 | Host port for container deployment |
SA_MCP_LOG_LEVEL | info | Logging level (debug, info, warn, error) |
SA_MCP_SERVER_BIND_ADDR | 0.0.0.0:8080 | Server bind address (container internal) |
SA_MCP_SPAMASSASSIN_HOST | localhost | SpamAssassin daemon host |
SA_MCP_SPAMASSASSIN_PORT | 783 | SpamAssassin daemon port |
SA_MCP_SPAMASSASSIN_THRESHOLD | 5.0 | Spam score threshold |
SA_MCP_SECURITY_MAX_EMAIL_SIZE | 10485760 | Max email size (10MB) |
UPDATE_RULES | false | Update SpamAssassin rules on startup |
MCP_TRANSPORT | auto | Transport mode (auto, stdio, sse) |
The server includes comprehensive security measures:
# Simple spam check
/scan_email --content "$(cat suspicious_email.eml)"
# Detailed analysis with Bayes
/scan_email --content "$(cat email.eml)" --verbose --check_bayes
# Check sender reputation
/check_reputation --sender "unknown@suspicious-domain.com"
# Check domain and IP
/check_reputation --domain "suspicious-domain.com" --ip "192.168.1.100"
# 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."]'
# Get detailed score explanation
/explain_score --email_content "Subject: Free Money!\n\nClaim your prize now!"
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
# View server logs
docker compose logs -f spamassassin-mcp
# Monitor resource usage
docker stats spamassassin-mcp
# Test MCP connectivity (container mode)
curl -v http://localhost:8081/mcp
spamassassin)# Install dependencies
go mod download
# Build binary
go build -o mcp-server main.go
# Run locally (requires SpamAssassin)
./mcp-server
# Run with testing profile (includes spamd)
docker compose --profile testing up -d
# Test SpamAssassin connectivity
docker compose exec spamassassin-mcp timeout 2 bash -c 'echo >/dev/tcp/localhost/783'
# Test MCP server health
docker compose exec spamassassin-mcp /usr/local/bin/health-check.sh
Symptoms: Container continuously restarts with "read error: EOF"
Symptoms: "bind: address already in use"
SA_MCP_HOST_PORT in .env fileSymptoms: "Pool overlaps with other one on this address space"
Symptoms: Container marked unhealthy
/usr/local/bin/health-check.sh manuallydocker compose logs spamassassin-mcpMIT License - See LICENSE file for details.
This project uses GitHub Actions for continuous integration and deployment:
main branch and tagsTo use the Docker Hub publishing workflow:
Create a Docker Hub account if you don't already have one
Generate a Docker Hub access token:
Set up Docker Hub credentials as GitHub Secrets:
DOCKER_USERNAME: Your Docker Hub usernameDOCKER_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 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 branchvX.Y.Z - Specific version tags for releasescommit-SHA - Specific commit buildsYou 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
Contributions welcome! Please read our Contributing Guide and ensure all changes maintain the security-first, defensive-only design principles.
For issues and questions:
docker-compose logs spamassassin-mcpdocker-compose exec spamassassin-mcp /usr/local/bin/health-check.shdocker-compose exec spamassassin-mcp pgrep spamd⚠️ 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.
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
MCP server integration for DaVinci Resolve Studio
A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba