Sign inSign up

btafoya/spamassassin-mcp

By btafoya

•Updated about 1 year ago

Secure SpamAssassin MCP server for email spam detection & rule testing.

Image
Security
Machine learning & AI
Developer tools
1

2.8K

btafoya/spamassassin-mcp repository overview

⁠SpamAssassin MCP Server

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.

⁠🔒 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

⁠Using Docker
# Pull the latest image from Docker Hub
docker pull btafoya/spamassassin-mcp:latest

# Run the container
docker run -d \
  --name spamassassin-mcp \
  -p 8081:8080 \
  btafoya/spamassassin-mcp:latest
⁠Using Docker Compose
# Clone the repository
git clone https://github.com/btafoya/spamassassin-mcp.git
cd spamassassin-mcp

# Copy and customize configuration
cp .env.example .env
# Edit .env to customize ports and settings

# Start the containers
docker compose up -d

# Check health
docker compose logs spamassassin-mcp

⁠🛠️ Configuration

⁠Environment Variables
VariableDefaultDescription
SA_MCP_HOST_PORT8081Host port for container deployment
SA_MCP_LOG_LEVELinfoLogging level (debug, info, warn, error)
SA_MCP_SERVER_BIND_ADDR0.0.0.0:8080Server bind address (container internal)
SA_MCP_SPAMASSASSIN_HOSTlocalhostSpamAssassin daemon host
SA_MCP_SPAMASSASSIN_PORT783SpamAssassin daemon port
SA_MCP_SPAMASSASSIN_THRESHOLD5.0Spam score threshold
SA_MCP_SECURITY_MAX_EMAIL_SIZE10485760Max email size (10MB)
⁠Security Settings

The server includes comprehensive security measures:

  • Rate Limiting: 60 requests/minute with burst of 10
  • Input Validation: Email format and size validation
  • Container Security: Non-root execution, read-only filesystem
  • Network Isolation: Custom bridge network
  • Resource Limits: Memory and CPU constraints

⁠📋 Available Tools

⁠Email Analysis
  • scan_email - Analyze email content for spam probability and rule matches
  • check_reputation - Check sender reputation and domain/IP blacklists
  • explain_score - Detailed breakdown of spam score calculation
⁠Configuration Management
  • get_config - Retrieve current SpamAssassin configuration and status
⁠Rule Testing
  • test_rules - Test custom rules against sample emails in a safe environment

⁠🏥 Health Monitoring

The container includes automated health checks:

# Check container health
docker exec spamassassin-mcp /usr/local/bin/health-check.sh

# View health status
docker ps

⁠📚 Documentation

For detailed documentation, please visit the GitHub repository:

⁠📄 License

MIT License - See LICENSE⁠ file for details.

Tag summary

Content type

Image

Digest

sha256:9e71ba610…

Size

119 MB

Last updated

about 1 year ago

docker pull btafoya/spamassassin-mcp