loading…
Search for a command to run...
loading…
Enables natural language interaction and management of pfSense firewalls through Claude and other GenAI applications using the Model Context Protocol. It provid
Enables natural language interaction and management of pfSense firewalls through Claude and other GenAI applications using the Model Context Protocol. It provides advanced tools for firewall rule configuration, interface management, and intelligent log analysis via a REST API integration.
🚀 A next-generation Model Context Protocol (MCP) server that enables natural language interaction with pfSense firewalls through Claude Desktop and other GenAI applications. Now with advanced API features by pfrest.org including intelligent filtering, HATEOAS navigation, and enterprise-grade controls.
⚠️ IMPORTANT: This project needs community testing and validation!
👥 We need your help to test this with real pfSense devices and environments.
- 🔍 Test it with your pfSense setup
- 🐛 Report issues via GitHub Issues
- 🔧 Fix bugs and submit PRs
- 📝 Improve documentation based on real-world usage
- 💡 Contribute features and enhancements
Your testing and contributions will help make this production-ready for everyone!
Version License MCP pfSense API Community
| Version | Status | API Package | Features |
|---|---|---|---|
| pfSense CE 2.8.0 | ✅ Fully Supported | Download | All enhanced features |
| pfSense Plus 24.11 | ✅ Fully Supported | Download | All enhanced features |
On your pfSense system (via SSH or console):
# For pfSense CE 2.8.0
pkg-static add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-2.8.0-pkg-RESTAPI.pkg
# For pfSense Plus 24.11
pkg-static -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-24.11-pkg-RESTAPI.pkg
# Clone the repository
git clone https://github.com/gensecaihq/pfsense-mcp-server.git
cd pfsense-mcp-server
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
nano .env # Add your pfSense details
Minimal .env configuration:
PFSENSE_URL=https://your-pfsense.local
PFSENSE_API_KEY=your-api-key-here
PFSENSE_VERSION=CE_2_8_0 # or PLUS_24_11
AUTH_METHOD=api_key
VERIFY_SSL=true
ENABLE_HATEOAS=false # Set true for navigation links
# Test enhanced features
python tests/test_enhanced_features.py
# Start the enhanced MCP server
python -m src.main
Add to your Claude Desktop configuration:
{
"mcpServers": {
"pfsense-enhanced": {
"command": "python",
"args": ["/path/to/pfsense-mcp-server/main_enhanced_mcp.py"],
"env": {
"PFSENSE_URL": "https://your-pfsense.local",
"PFSENSE_API_KEY": "your-api-key",
"PFSENSE_VERSION": "CE_2_8_0",
"ENABLE_HATEOAS": "false"
}
}
}
}
search_interfaces() - Find interfaces with advanced filteringsearch_firewall_rules() - Multi-field rule search with paginationsearch_aliases() - Intelligent alias discoverysearch_dhcp_leases() - DHCP lease management with state filteringfind_blocked_rules() - Locate blocking rules across interfacescreate_firewall_rule_advanced() - Create rules with position controlmove_firewall_rule() - Reorder rules dynamicallybulk_block_ips() - Block multiple IPs efficientlymanage_alias_addresses() - Add/remove alias entriesanalyze_blocked_traffic() - Pattern analysis and threat scoringsearch_logs_by_ip() - IP-specific log analysisget_api_capabilities() - Discover API featuresfollow_api_link() - Navigate HATEOAS links dynamicallyrefresh_object_ids() - Handle dynamic ID changesfind_object_by_field() - Field-based object lookupenable_hateoas() / disable_hateoas() - Control navigation linkstest_enhanced_connection() - Comprehensive connectivity testing"Search for firewall rules on WAN interface blocking port 22"
"Show me blocked traffic patterns from the last 24 hours"
"Find all aliases containing IP 192.168.1.100"
"Block these suspicious IPs: 198.51.100.1, 203.0.113.1"
"Search DHCP leases for hostname containing 'server'"
"Move firewall rule ID 5 to position 1"
"Analyze blocked traffic and group by source IP"
"Find interfaces that are currently down"
"Search for firewall rules with 'malware' in description"
"Show me the top 10 blocked source IPs"
# Test basic API connection
python test_pfsense_api_v2.py
# Test all enhanced features
python test_enhanced_features.py
# Run comprehensive test suite
pytest tests/ -v
# Test specific MCP tools
python -c "
import asyncio
from main_enhanced_mcp import search_firewall_rules
print(asyncio.run(search_firewall_rules(interface='wan', page_size=5)))
"
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Claude Desktop │────│ Enhanced MCP │────│ pfSense API v2 │
│ (Natural Lang) │ │ Server (Python) │ │ (REST/GraphQL) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │
▼ ▼
┌──────────────────┐ ┌─────────────────┐
│ Advanced Features │ │ pfSense System │
│ • Filtering │ │ • Firewall │
│ • Pagination │ │ • Interfaces │
│ • HATEOAS │ │ • Services │
│ • Object IDs │ │ • DHCP/VPN │
└──────────────────┘ └─────────────────┘
This MCP server represents a significant advancement in pfSense automation, but we need the community to help make it even better! Whether you're a pfSense veteran, Python developer, or GenAI enthusiast, there are many ways to contribute.
Contributors will be:
Together, we can make pfSense automation accessible to everyone through natural language! 🌟
"The best open source projects are built by communities, not individuals. Your contribution, no matter how small, makes a difference!"
| Feature | Basic MCP | Enhanced MCP | Benefits |
|---|---|---|---|
| API Integration | XML-RPC only | REST API v2 + fallbacks | Modern, faster, more reliable |
| Filtering | Basic queries | 8 filter types + regex | Find exactly what you need |
| Pagination | None | Smart pagination | Handle large datasets |
| Object Management | Static IDs | Dynamic ID handling | Robust against changes |
| Navigation | Manual endpoints | HATEOAS links | Discover API capabilities |
| Controls | Basic operations | Fine-grained parameters | Precise operation control |
| Performance | Basic caching | Advanced optimization | Faster response times |
MIT License - see LICENSE for details.
⭐ Star this repo if it helps you manage pfSense with AI! ⭐
Made with ❤️ by the community, for the community
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"pfsense-enhanced-mcp-server": {
"command": "npx",
"args": []
}
}
}Web content fetching and conversion for efficient LLM usage.
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also