A production-grade Model Context Protocol (MCP) server that enables natural language interaction with pfSense firewalls through Claude Desktop and other GenAI applications.
- Natural Language Interface: Control pfSense using plain English
- 5 Access Levels: From read-only monitoring to emergency response
- Multiple Connection Methods: REST API, XML-RPC, and SSH
- 6 Functional Categories: Complete security operations coverage
- GenAI Integration: Works with Claude Desktop, Continue, and other MCP clients
- Production Ready: Audit logging, rate limiting, caching
# Clone the repository
git clone https://github.com/gensecaihq/pfsense-mcp-server.git
cd pfsense-mcp-server
# Copy environment template
cp .env.example .env
# Edit configuration
nano .env # Add your pfSense details
# Build and start
docker-compose up -d
# Check health
curl http://localhost:8000/health
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
{
"mcpServers": {
"pfsense": {
"command": "docker",
"args": ["run", "-i", "--rm", "--env-file", "/path/to/.env", "pfsense-mcp:latest"],
"env": {
"MCP_MODE": "stdio"
}
}
}
}
Or run locally:
{
"mcpServers": {
"pfsense": {
"command": "python",
"args": ["/path/to/pfsense-mcp-server/main.py"],
"env": {
"PFSENSE_URL": "https://your-pfsense.local",
"PFSENSE_API_KEY": "your-api-key"
}
}
}
}
Level | Description | Example Users |
---|---|---|
READ_ONLY |
Monitor and view | Security Analysts |
SECURITY_WRITE |
Modify security rules | Security Engineers |
ADMIN_WRITE |
Full system access | Administrators |
COMPLIANCE_READ |
Audit and compliance | Compliance Officers |
EMERGENCY_WRITE |
Emergency response | Incident Responders |
"Show me the system status"
"What IPs are currently blocked?"
"Block IP 192.168.1.100"
"Run a PCI compliance check"
"Analyze threats from the last hour"
"EMERGENCY: Block all traffic from Russia"
# Test connection
python scripts/test_connection.py
# Run tests
pytest tests/
# Generate token
python scripts/generate_token.py alice READ_ONLY
MIT License - see LICENSE