Skip to main content
Glama

OPNSense MCP Server

SIMPLIFIED-APPROACH.md2.76 kB
# Simplified Phase 3 Implementation ## The Right Architecture You were absolutely right - we don't need to deploy the entire MCP server to the hypervisor. Here's the corrected, simplified approach: ### What Runs Where | Component | Location | Purpose | |-----------|----------|---------| | **MCP Server** | Your Local PC | Talks to Claude Desktop | | **Redis** | Hypervisor (10.0.0.2) | Optional caching | | **PostgreSQL** | Hypervisor (10.0.0.2) | Optional audit logs | ### Two Deployment Options ## Option 1: Basic (No External Services) Just use the MCP server locally with minimal config: ```env # .env file OPNSENSE_HOST=https://your-opnsense-ip OPNSENSE_API_KEY=your-key OPNSENSE_API_SECRET=your-secret OPNSENSE_VERIFY_SSL=false ENABLE_CACHE=false BACKUP_ENABLED=true ``` This gives you: - ✅ All VLAN management - ✅ Firewall rules (with API limitations) - ✅ Local backup management - ❌ No caching (slightly slower) - ❌ No audit database ## Option 2: Enhanced (With Redis/PostgreSQL) ### Step 1: Deploy data services on hypervisor ```bash # SSH to hypervisor ssh root@10.0.0.2 # Quick deploy (one command) mkdir -p /opt/mcp-data && cd /opt/mcp-data && \ docker run -d --name mcp-redis -p 10.0.0.2:6379:6379 redis:7-alpine && \ docker run -d --name mcp-postgres -p 10.0.0.2:5432:5432 \ -e POSTGRES_DB=opnsense_mcp \ -e POSTGRES_USER=mcp_user \ -e POSTGRES_PASSWORD=changeme \ postgres:15-alpine ``` ### Step 2: Update local .env ```env # Enhanced .env file OPNSENSE_HOST=https://your-opnsense-ip OPNSENSE_API_KEY=your-key OPNSENSE_API_SECRET=your-secret OPNSENSE_VERIFY_SSL=false # Enable external services ENABLE_CACHE=true REDIS_HOST=10.0.0.2 POSTGRES_HOST=10.0.0.2 POSTGRES_USER=mcp_user POSTGRES_PASSWORD=changeme ``` This gives you: - ✅ All basic features - ✅ 5x faster responses with Redis cache - ✅ Complete audit trail in PostgreSQL - ✅ Shared infrastructure for future MCP servers ## Key Benefits of This Approach 1. **Simple** - MCP server stays on your local machine 2. **Optional** - Works fine without Redis/PostgreSQL 3. **Scalable** - Add data services when you need them 4. **Shared** - Other MCP servers can use the same Redis/PostgreSQL ## Testing ### Without external services: ```bash npm run build # Just works! ``` ### With external services: ```bash # Test Redis redis-cli -h 10.0.0.2 ping # Test PostgreSQL psql -h 10.0.0.2 -U mcp_user -d opnsense_mcp -c "SELECT 1" # Then build and run npm run build ``` ## Summary - **Core functionality** works without any external services - **Redis/PostgreSQL** are optional enhancements - **MCP server** always runs locally with Claude Desktop - **Hypervisor** only hosts the optional data services Much simpler and more practical! 🎯

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vespo92/OPNSenseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server