Major Features Added: - Fix Socket.IO connectivity by updating Dockerfile to use socket_app - Resolve distributed workflows API to return arrays instead of errors - Expand agent coverage from 3 to 7 agents (added OAK and ROSEWOOD) - Create comprehensive systemd service for MCP server with auto-discovery - Add daemon mode with periodic agent discovery every 5 minutes - Implement comprehensive test suite with 100% pass rate Infrastructure Improvements: - Enhanced database connection handling with retry logic - Improved agent registration with persistent storage - Added proper error handling for distributed workflows endpoint - Created management scripts for service lifecycle operations Agent Cluster Expansion: - ACACIA: deepseek-r1:7b (kernel_dev) - WALNUT: starcoder2:15b (pytorch_dev) - IRONWOOD: deepseek-coder-v2 (profiler) - OAK: codellama:latest (docs_writer) - OAK-TESTER: deepseek-r1:latest (tester) - ROSEWOOD: deepseek-coder-v2:latest (kernel_dev) - ROSEWOOD-VISION: llama3.2-vision:11b (tester) System Status: All 7 agents healthy, Socket.IO operational, MCP server fully functional 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3.2 KiB
3.2 KiB
🐝 Hive MCP Server Service
This directory contains the systemd service configuration for running the Hive MCP Server as a background daemon with automatic agent discovery.
🚀 Quick Start
1. Install the Service
./install-service.sh
2. Start the Service
sudo systemctl start hive-mcp
3. Check Status
sudo systemctl status hive-mcp
4. View Logs
journalctl -u hive-mcp -f
🛠️ Management Script
Use the provided management script for easy operations:
# Install service
./hive-mcp.sh install
# Start/stop/restart
./hive-mcp.sh start
./hive-mcp.sh stop
./hive-mcp.sh restart
# Monitor
./hive-mcp.sh status
./hive-mcp.sh logs
./hive-mcp.sh follow
# Agent management
./hive-mcp.sh discover # Trigger agent discovery
./hive-mcp.sh test # Test backend connection
# Remove service
./hive-mcp.sh uninstall
⚙️ Configuration
The service is configured via environment variables in the service file:
HIVE_API_URL: Hive backend API endpoint (default: https://hive.home.deepblack.cloud/api)HIVE_WS_URL: WebSocket endpoint (default: wss://hive.home.deepblack.cloud/socket.io)AUTO_DISCOVERY: Enable periodic discovery (default: true)DISCOVERY_INTERVAL: Discovery interval in ms (default: 300000 = 5 minutes)LOG_LEVEL: Logging level (default: info)
🔄 Auto-Discovery
The service automatically:
- On Startup: Scans the network for available Ollama agents
- Periodically: Re-scans every 5 minutes (configurable)
- On Signal: Triggers discovery when receiving SIGHUP (
systemctl reload hive-mcp)
📊 Monitoring
Service Status
sudo systemctl status hive-mcp
Live Logs
journalctl -u hive-mcp -f
Resource Usage
sudo systemctl show hive-mcp --property=MemoryCurrent,CPUUsageNSec
Agent Status
curl -s https://hive.home.deepblack.cloud/api/agents | jq
🔧 Troubleshooting
Service Won't Start
- Check logs:
journalctl -u hive-mcp -n 50 - Verify backend connectivity:
./hive-mcp.sh test - Check file permissions:
ls -la /home/tony/AI/projects/hive/mcp-server/
Auto-Discovery Issues
- Check network connectivity to agent machines
- Verify Ollama is running on target machines
- Manually trigger discovery:
./hive-mcp.sh discover
High Resource Usage
- Check discovery interval:
grep DISCOVERY_INTERVAL /etc/systemd/system/hive-mcp.service - Monitor agent count:
curl -s https://hive.home.deepblack.cloud/api/agents | jq '.total' - Adjust memory limits in service file if needed
🛡️ Security
The service runs with:
- Non-root user (tony)
- Restricted filesystem access
- Memory and CPU limits
- Private tmp directory
- No new privileges
📁 Files
hive-mcp.service- Systemd service definitioninstall-service.sh- Service installation scripthive-mcp.sh- Management scriptlogs/- Log directory (created by service)data/- Data directory (created by service)
🔗 Integration
The service integrates with:
- Hive Backend: https://hive.home.deepblack.cloud/api
- Socket.IO: wss://hive.home.deepblack.cloud/socket.io
- Systemd: Full systemd service lifecycle
- Journal: Centralized logging via systemd-journald