Skip to main content
Glama
PHASE2-SUMMARY.md•3.04 kB
# Phase 2 Summary - VLAN Management Implementation ## šŸ“… Timeline **Started:** June 10, 2025 **Completed:** June 10, 2025 āœ… ## šŸŽÆ Objectives Achieved ### 1. Fixed OPNsense API Integration - **Issue**: API returned "400 Invalid JSON syntax" on GET requests with Content-Type header - **Solution**: Modified client to only send Content-Type headers on POST/PUT/PATCH requests - **Result**: All API calls now working correctly ### 2. Discovered Working Endpoints - **VLAN List**: `POST /api/interfaces/vlan_settings/searchItem` - **VLAN Get**: `GET /api/interfaces/vlan_settings/get` - **VLAN Create**: `POST /api/interfaces/vlan_settings/addItem` - **VLAN Delete**: `POST /api/interfaces/vlan_settings/delItem/{uuid}` - **Apply Changes**: `POST /api/interfaces/vlan_settings/reconfigure` ### 3. Built MCP Server with VLAN Management - Full CRUD operations for VLANs - Interface discovery - Connection testing - Proper error handling - TypeScript implementation ### 4. Integrated with Claude Desktop - MCP server runs as subprocess - Natural language VLAN management - Real-time firewall changes ## šŸ› ļø Technical Implementation ### API Client (`src/api/client.ts`) - Fixed header handling for OPNsense compatibility - Implemented proper error handling - Added connection testing - Created VLAN-specific methods ### VLAN Resource (`src/resources/vlan.ts`) - Complete VLAN management class - Tag-based lookup - Interface enumeration - Validation logic ### MCP Server (`src/index.ts`) - 7 tools implemented - 3 resources exposed - Proper MCP error handling - Auto-initialization from environment ## šŸ“Š Test Results ### Final Test in Claude: - āœ… Connected to OPNsense 25.1.5_5 - āœ… Listed 17 existing VLANs - āœ… Created VLAN 999 successfully - āœ… Retrieved VLAN details - āœ… Deleted VLAN 999 - āœ… Verified deletion ## šŸ”§ Tools Implemented 1. `test_connection` - Verify API connectivity 2. `list_vlans` - List all VLANs 3. `get_vlan` - Get specific VLAN details 4. `create_vlan` - Create new VLAN 5. `update_vlan` - Update VLAN description 6. `delete_vlan` - Remove VLAN 7. `get_interfaces` - List network interfaces ## šŸ“š Key Learnings 1. **OPNsense API Quirks**: Some endpoints don't follow REST conventions 2. **Header Sensitivity**: GET requests fail with Content-Type headers 3. **Endpoint Naming**: Uses `searchItem` instead of `search` for some resources 4. **MCP Integration**: Works seamlessly with Claude Desktop 5. **TypeScript Benefits**: Caught potential runtime errors at build time ## šŸ“ Deliverables - Working MCP server at `dist/index.js` - Full TypeScript source in `src/` - Comprehensive test results in `testresults/` - Documentation for future phases - Clean, organized project structure ## šŸš€ Foundation for Phase 3 Phase 2 established: - Working API client pattern - Resource class structure - MCP server framework - Testing methodology - Documentation standards Ready to expand with firewall rules, NAT, DHCP, and DNS management! --- **Phase 2 Status: COMPLETE āœ…**

Latest Blog Posts

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