Skip to main content
Glama
Firewalla MCP Server

Firewalla MCP Server

by MadLlama25

Firewalla MCP Server

A production-ready Model Context Protocol (MCP) server for Firewalla network management, designed to work seamlessly with Claude Desktop and other MCP-compatible clients.

✨ Features

  • πŸ”’ Enterprise Security - Firewalla API keys never exposed to clients

  • πŸš€ Multi-Transport Support - stdio, SSE, and HTTP transports

  • πŸ“Š Comprehensive Monitoring - Device, network, and security analytics

  • πŸ›‘οΈ Built-in Protection - Rate limiting, input validation, audit logging

  • 🐳 Docker-Ready - Production-grade containerized deployment

  • πŸ”„ Resilient Architecture - Circuit breakers, retry logic, intelligent caching

  • 🎯 14 Powerful Tools - Complete Firewalla management capabilities

Related MCP server: MCP Web Research Server

πŸ› οΈ Available Tools

πŸ“± Device Monitoring (3 tools)

  • get_devices - List all network devices with status and basic info

  • get_device_details - Detailed device information including bandwidth usage

  • search_devices - Search devices by name, IP, MAC, or vendor

🌐 Network Analysis (3 tools)

  • analyze_network_flows - Analyze traffic flows with filtering and statistics

  • get_bandwidth_statistics - Bandwidth usage stats for devices or entire network

  • get_network_statistics - Comprehensive network health and top talkers

πŸ” Security Monitoring (4 tools)

  • get_alarms - Retrieve security alerts with severity and category filtering

  • get_alarm_details - Detailed information about specific security events

  • archive_alarm - Mark security alerts as reviewed

  • get_alarm_statistics - Statistical analysis of security events

βš™οΈ Rule Management (4 tools)

  • list_firewall_rules - List all firewall rules with status and conditions

  • get_rule_details - Detailed rule information including hit statistics

  • pause_rule - Temporarily disable rules with duration and reason

  • resume_rule - Re-enable paused firewall rules

πŸš€ Quick Start

git clone https://github.com/MadLlama25/firewalla_msp-mcp.git
cd firewalla_msp-mcp
./scripts/setup.sh

The setup script will:

  • βœ… Check prerequisites

  • βœ… Create and configure environment files

  • βœ… Build Docker image

  • βœ… Generate Claude Desktop configuration

  • βœ… Start the server

Manual Setup

Prerequisites

  • Docker and Docker Compose

  • Firewalla MSP account with API token

  • Claude Desktop (or other MCP client)

  • (Optional) Cloudflare Tunnel for remote access

Installation Steps

  1. Clone and Setup

git clone https://github.com/MadLlama25/firewalla_msp-mcp.git
cd firewalla_msp-mcp
cp .env.example .env
  1. Configure Environment Edit .env with your Firewalla credentials:

FIREWALLA_API_TOKEN=your_api_token_here
FIREWALLA_MSP_DOMAIN=https://your-domain.firewalla.net
  1. Deploy with Docker Compose

docker-compose up -d
  1. Verify Deployment

curl http://localhost:3000/health
docker logs firewalla-mcp

πŸ”§ Claude Desktop Configuration

{
  "mcpServers": {
    "firewalla": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "--env-file", "/full/path/to/.env",
        "--network", "host",
        "firewalla-mcp"
      ],
      "env": {
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Remote Access via Cloudflare Tunnel

{
  "mcpServers": {
    "firewalla": {
      "url": "https://your-tunnel-domain.example.com/mcp",
      "transport": "sse"
    }
  }
}

Local HTTP (Alternative)

{
  "mcpServers": {
    "firewalla": {
      "url": "http://localhost:3000/mcp",
      "transport": "sse"
    }
  }
}

πŸ—οΈ Architecture

Security Architecture

  • API Key Isolation - Firewalla credentials stored securely in Docker

  • Request Validation - Comprehensive input sanitization and validation

  • Rate Limiting - Per-client request throttling

  • Audit Logging - Complete request/response audit trail

  • Circuit Breakers - Automatic failover when Firewalla API is unavailable

Performance Features

  • Intelligent Caching - Multi-tier caching with TTL

  • Connection Pooling - Optimized HTTP client with retry logic

  • Resource Management - Memory-efficient data processing

  • Health Monitoring - Built-in health checks and metrics

πŸ“ Configuration Reference

Environment Variables

Variable

Required

Default

Description

FIREWALLA_API_TOKEN

βœ…

-

Your Firewalla MSP API token

FIREWALLA_MSP_DOMAIN

βœ…

-

Your MSP domain URL

PORT

❌

3000

Server port

MCP_TRANSPORT

❌

sse

Transport method (stdio/sse/http)

LOG_LEVEL

❌

info

Logging level (debug/info/warn/error)

CACHE_ENABLED

❌

true

Enable response caching

RATE_LIMIT_MAX

❌

100

Max requests per window

Docker Deployment Options

Production (docker-compose)

docker-compose up -d

Development (with hot reload)

docker-compose -f docker-compose.yml up firewalla-mcp-dev

Standalone Docker

docker run -d --name firewalla-mcp \
  --env-file .env \
  -p 3000:3000 \
  firewalla-mcp

πŸ” Monitoring & Troubleshooting

Health Checks

# Server health
curl http://localhost:3000/health

# Container logs
docker logs firewalla-mcp

# Container status
docker ps | grep firewalla-mcp

Common Issues

Authentication Errors

  • Verify FIREWALLA_API_TOKEN is correct

  • Check FIREWALLA_MSP_DOMAIN format

  • Ensure API token has proper permissions

Connection Issues

  • Check Docker container is running

  • Verify port 3000 is accessible

  • Check Cloudflare Tunnel configuration (if using)

Performance Issues

  • Monitor cache hit rates in logs

  • Check circuit breaker status

  • Verify adequate system resources

πŸ”’ Security Considerations

API Key Management

  • Store Firewalla API tokens in environment variables only

  • Never commit API keys to version control

  • Rotate API keys regularly (recommended: 90 days)

  • Use separate tokens for different environments

Network Security

  • Deploy behind Cloudflare Tunnel for production

  • Use HTTPS/TLS for all communications

  • Implement IP allowlisting if required

  • Monitor audit logs regularly

Access Control

  • Enable API key authentication for non-Claude Desktop clients

  • Use role-based permissions where applicable

  • Monitor unusual usage patterns

  • Implement automatic lockouts for suspicious activity

🀝 Multi-Client Support

Works with various MCP clients:

  • Claude Desktop - Primary target with optimized integration

  • Continue IDE - VS Code extension support

  • Custom MCP Clients - HTTP/SSE API available

πŸ§ͺ Testing

Test Categories

  • Unit Tests - Core utilities, middleware, and individual components

  • Integration Tests - API client, caching, and service integration

  • MCP Tool Tests - All 14 Firewalla management tools

  • Security Tests - Input validation, sanitization, and vulnerability checks

  • Performance Tests - Load testing and performance benchmarks

Running Tests

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run specific test categories
npm run test:unit
npm run test:integration
npm run test:security
npm run test:performance

# Run tests in watch mode
npm run test:watch

Test Coverage Targets

  • Unit Tests: 90% line coverage

  • Integration Tests: 80% path coverage

  • Critical Paths: 100% coverage (authentication, validation, security)

Quality Gates

All commits must pass:

  • βœ… Linting (ESLint)

  • βœ… Type checking (TypeScript)

  • βœ… Unit tests (90%+ coverage)

  • βœ… Security audit (npm audit)

  • βœ… Code formatting (Prettier)

# Run pre-commit checks
npm run pre-commit
# or use the script
./scripts/pre-commit.sh

πŸ“ Development

Local Development

npm install
npm run dev

Building

npm run build
npm run lint
npm run type-check

Testing Strategy

See TESTING_PLAN.md for comprehensive testing documentation.

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests (maintain coverage targets)

  5. Run pre-commit checks

  6. Submit a pull request

Code Quality Standards

  • TypeScript strict mode enabled

  • ESLint with strict configuration

  • Prettier for consistent formatting

  • Jest for testing with high coverage

  • Security-first development practices

πŸ“Š Performance Metrics

  • Response Time - Sub-100ms for cached requests

  • Throughput - 1000+ requests per minute

  • Uptime - 99.9% with automatic recovery

  • Cache Hit Rate - 70-90% for typical workloads

πŸ“œ License

MIT License - see LICENSE file for details

πŸ†˜ Support

  • Issues - GitHub Issues

  • Documentation - Built-in API documentation

  • Logs - Comprehensive audit trail and error logging


Built with ❀️ for the Firewalla community

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers