A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/CorefluxCommunity/CorefluxMCPServer below:

CorefluxCommunity/Coreflux-MQTT-MCP-Server: Coreflux MQTT MCP Server

An enterprise-grade Model Context Protocol (MCP) server that provides secure, scalable access to Coreflux MQTT brokers and comprehensive automation capabilities for Claude and other MCP-compatible AI assistants.

Docker Deployment (Recommended)
  1. Clone and configure:

    git clone https://github.com/CorefluxCommunity/Coreflux-MQTT-MCP-Server.git
    cd Coreflux-MQTT-MCP-Server
    cp .env.example .env
    # Edit .env with your configuration
  2. Deploy with Docker:

Option 1: Docker Deployment (Recommended)
  1. Clone and configure:

    git clone https://github.com/CorefluxCommunity/Coreflux-MQTT-MCP-Server.git
    cd Coreflux-MQTT-MCP-Server
    cp .env.example .env
    # Edit .env with your configuration
  2. Deploy with Docker:

  3. Verify deployment:

    docker-compose logs -f coreflux-mcp-server
Option 2: Development Installation
  1. Clone and setup:

    git clone https://github.com/CorefluxCommunity/Coreflux-MQTT-MCP-Server.git
    cd Coreflux-MQTT-MCP-Server
  2. Install dependencies:

    pip install -r requirements.txt
    # For development
    pip install -r requirements-dev.txt
  3. Configure environment:

    python setup_assistant.py  # Interactive configuration
    # OR
    cp .env.example .env && nano .env  # Manual configuration
  4. Validate and test:

    make validate  # Validate configuration
    make test      # Run tests
  5. Start the server:

    python server.py
    # OR
    make run

For detailed deployment instructions, see DEPLOYMENT.md.

Interactive Setup Assistant

The server includes a comprehensive setup assistant that guides you through configuration:

python setup_assistant.py

The assistant helps with:

Use the setup assistant when:

Environment Configuration

Copy .env.example to .env and configure:

# MQTT Broker Configuration
MQTT_BROKER=your-broker-host.com
MQTT_PORT=8883
MQTT_USER=your-username
MQTT_PASSWORD=your-password
MQTT_USE_TLS=true

# TLS Configuration (when MQTT_USE_TLS=true)
MQTT_CA_CERT=/path/to/ca.crt
MQTT_CERT_FILE=/path/to/client.crt  
MQTT_KEY_FILE=/path/to/client.key

# Coreflux Copilot API
DO_AGENT_API_KEY=your-api-key-here

# Logging Configuration
LOG_LEVEL=INFO
LOG_FILE=/var/log/coreflux-mcp.log

For detailed configuration options, see the Configuration Guide.

๐Ÿ”Œ Connecting Claude to the MCP Server
  1. Locate Claude Desktop config file:

  2. Add server configuration:

    {
      "mcpServers": {
        "coreflux": {
          "command": "python",
          "args": ["/path/to/your/server.py"],
          "env": {
            "MQTT_BROKER": "your-broker-host.com",
            "MQTT_PORT": "8883",
            "MQTT_USER": "your-username", 
            "MQTT_PASSWORD": "your-password",
            "MQTT_USE_TLS": "true",
            "DO_AGENT_API_KEY": "your-copilot-api-key"
          }
        }
      }
    }
  3. Restart Claude Desktop

Security Note: For production deployments, store secrets in secure environment variables or secret management systems rather than the Claude config file.

Using Environment Variables

For better security, use environment variables instead of hardcoding credentials:

{
  "mcpServers": {
    "coreflux": {
      "command": "python",
      "args": ["/path/to/your/server.py"],
      "env": {
        "MQTT_BROKER": "${COREFLUX_MQTT_BROKER}",
        "MQTT_PORT": "${COREFLUX_MQTT_PORT}",
        "MQTT_USER": "${COREFLUX_MQTT_USER}",
        "MQTT_PASSWORD": "${COREFLUX_MQTT_PASSWORD}",
        "DO_AGENT_API_KEY": "${COREFLUX_API_KEY}"
      }
    }
  }
}

Once configured, test the connection by asking Claude:

Can you check the health of the Coreflux MCP server and show me the broker information?

Claude should respond with system status and broker details if the connection is successful.

The server provides the following tools to Claude:

For detailed API documentation, see API_DOCUMENTATION.md.

  1. Install development dependencies:

    pip install -r requirements-dev.txt
  2. Install pre-commit hooks:

  3. Run the full development setup:

    make dev-setup  # Complete development environment setup

Run the comprehensive test suite:

# Run all tests
make test

# Run tests with coverage
make test-coverage

# Run specific test categories
make test-unit        # Unit tests only
make test-integration # Integration tests only

Maintain code quality with automated tools:

# Format code
make format

# Run linters
make lint

# Security scanning
make security-check

# Type checking
make type-check

# Run all quality checks
make quality-check

Available development commands:

# Development workflow
make dev-setup     # Set up complete development environment
make validate      # Validate configuration and environment  
make run           # Start the server with validation
make run-debug     # Start server in debug mode

# Testing and validation
make test          # Run all tests
make test-coverage # Run tests with coverage report
make test-unit     # Run unit tests only
make validate-config # Validate configuration files

# Code quality
make format        # Format code with black and isort
make lint          # Run all linters (flake8, bandit, mypy)
make security-check # Run security scanning
make type-check    # Run type checking with mypy

# Docker operations  
make docker-build  # Build Docker image
make docker-run    # Run in Docker container
make docker-test   # Run tests in Docker

# Documentation
make docs          # Generate documentation
make docs-serve    # Serve documentation locally
# Clone and configure
git clone https://github.com/CorefluxCommunity/Coreflux-MQTT-MCP-Server.git
cd Coreflux-MQTT-MCP-Server

# Copy and edit environment file
cp .env.example .env
nano .env  # Configure your settings

# Start with Docker Compose
docker-compose up -d

# Check logs
docker-compose logs -f coreflux-mcp-server

# Health check
docker-compose exec coreflux-mcp-server python -c "
import os
os.system('python server.py --health-check')
"
Production Docker Deployment

See DEPLOYMENT.md for comprehensive production deployment instructions including:

๐Ÿ”‘ Coreflux Copilot Integration

The server includes powerful AI assistance through the Coreflux Copilot API:

  1. Obtain API Key from the Coreflux Copilot dashboard
  2. Configure the key:
    # Option 1: Environment file
    echo "DO_AGENT_API_KEY=your_api_key_here" >> .env
    
    # Option 2: Environment variable
    export DO_AGENT_API_KEY=your_api_key_here

Ask Claude to help with Coreflux automation:

Generate LOT code for a temperature monitoring system that triggers an alert when the temperature exceeds 75ยฐF
Help me create a rule that processes sensor data and stores it in a database
Asynchronous Message Processing

The server includes a robust async message processor that:

Comprehensive logging with enterprise features:

Robust validation system that checks:

๐Ÿ›ก๏ธ Security & Compliance

The server supports various compliance requirements:

For detailed security information, see SECRET_MANAGEMENT.md.

๐Ÿ“Š Monitoring & Health Checks

Comprehensive health monitoring with the comprehensive_health_check tool:

# Manual health check
python server.py --health-check

# Or ask Claude:
# "Please run a comprehensive health check on the Coreflux MCP server"

The server provides detailed metrics:

Configure alerts for:

We welcome contributions! Please see our contribution guidelines:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Install development dependencies: pip install -r requirements-dev.txt
  4. Setup pre-commit hooks: pre-commit install
  5. Make your changes with tests
  6. Run quality checks: make quality-check
  7. Commit your changes: git commit -am 'Add amazing feature'
  8. Push to the branch: git push origin feature/amazing-feature
  9. Create a Pull Request

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

๐Ÿ†˜ Support & Troubleshooting

Connection Refused

Error: MQTT connection failed

Authentication Failed

Error: Authentication failed

TLS Handshake Failed

Error: TLS handshake failed

Enable detailed logging for troubleshooting:

export LOG_LEVEL=DEBUG
python server.py
# Setup and configuration
python setup_assistant.py    # Interactive setup
make validate                 # Validate configuration

# Development
make dev-setup               # Complete dev environment
make test                    # Run all tests
make quality-check           # Run all quality checks

# Deployment
docker-compose up -d         # Docker deployment
make docker-build           # Build Docker image

# Monitoring
make health-check           # System health check
docker-compose logs -f      # View logs

Built with โค๏ธ by the Coreflux Community

Debugging and Troubleshooting

The MCP server now starts even if the MQTT broker is not available, allowing you to troubleshoot and configure connections through the MCP tools.

Connection Status and Recovery Available Tools for Connection Management Traditional Troubleshooting Steps

If you encounter issues:

  1. Verify your MQTT broker credentials in your Claude configuration
  2. Ensure the broker is accessible
  3. Run the setup assistant to verify or update your configuration:
    python setup_assistant.py
  4. Check Claude Desktop logs:
    # Check Claude's logs for errors (macOS/Linux)
    tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
    # Windows PowerShell
    Get-Content -Path "$env:USERPROFILE\AppData\Roaming\Claude\Logs\mcp*.log" -Tail 20 -Wait
  5. Run the server with debug logging:
    # Direct execution with debug logging
    python server.py --mqtt-host localhost --mqtt-port 1883 --log-level DEBUG
References and Documentation

Contributions are welcome! Please read our contributing guidelines and submit pull requests to the development branch.

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4