Major WHOOSH system refactoring and feature enhancements

- Migrated from HIVE branding to WHOOSH across all components
- Enhanced backend API with new services: AI models, BZZZ integration, templates, members
- Added comprehensive testing suite with security, performance, and integration tests
- Improved frontend with new components for project setup, AI models, and team management
- Updated MCP server implementation with WHOOSH-specific tools and resources
- Enhanced deployment configurations with production-ready Docker setups
- Added comprehensive documentation and setup guides
- Implemented age encryption service and UCXL integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-08-27 08:34:48 +10:00
parent 0e9844ef13
commit 268214d971
399 changed files with 57390 additions and 2045 deletions

View File

@@ -1,16 +1,16 @@
# Hive MCP Server Configuration
# WHOOSH MCP Server Configuration
# Production deployment (default)
HIVE_API_URL=https://hive.home.deepblack.cloud
HIVE_WS_URL=wss://hive.home.deepblack.cloud
WHOOSH_API_URL=https://whoosh.home.deepblack.cloud
WHOOSH_WS_URL=wss://whoosh.home.deepblack.cloud
# Development/testing with local deployment
# HIVE_API_URL=http://localhost:8087
# HIVE_WS_URL=ws://localhost:8087
# WHOOSH_API_URL=http://localhost:8087
# WHOOSH_WS_URL=ws://localhost:8087
# Development/testing with local docker compose
# HIVE_API_URL=http://localhost:3001
# HIVE_WS_URL=ws://localhost:3001
# WHOOSH_API_URL=http://localhost:3001
# WHOOSH_WS_URL=ws://localhost:3001
# Timeout settings
HIVE_TIMEOUT=30000
WHOOSH_TIMEOUT=30000

View File

@@ -1,6 +1,6 @@
# 🐝 Hive MCP Server
# 🐝 WHOOSH MCP Server
Model Context Protocol (MCP) server that exposes the Hive Distributed AI Orchestration Platform to AI assistants like Claude.
Model Context Protocol (MCP) server that exposes the WHOOSH Distributed AI Orchestration Platform to AI assistants like Claude.
## Overview
@@ -34,12 +34,12 @@ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/
```json
{
"mcpServers": {
"hive": {
"whoosh": {
"command": "node",
"args": ["/path/to/hive/mcp-server/dist/index.js"],
"args": ["/path/to/whoosh/mcp-server/dist/index.js"],
"env": {
"HIVE_API_URL": "https://hive.home.deepblack.cloud",
"HIVE_WS_URL": "wss://hive.home.deepblack.cloud"
"WHOOSH_API_URL": "https://whoosh.home.deepblack.cloud",
"WHOOSH_WS_URL": "wss://whoosh.home.deepblack.cloud"
}
}
}
@@ -50,12 +50,12 @@ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/
```json
{
"mcpServers": {
"hive": {
"whoosh": {
"command": "node",
"args": ["/path/to/hive/mcp-server/dist/index.js"],
"args": ["/path/to/whoosh/mcp-server/dist/index.js"],
"env": {
"HIVE_API_URL": "http://localhost:8087",
"HIVE_WS_URL": "ws://localhost:8087"
"WHOOSH_API_URL": "http://localhost:8087",
"WHOOSH_WS_URL": "ws://localhost:8087"
}
}
}
@@ -64,53 +64,53 @@ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/
### 4. Restart Claude Desktop
The Hive MCP server will automatically connect to your running Hive cluster.
The WHOOSH MCP server will automatically connect to your running WHOOSH cluster.
## Available Tools
### Agent Management
- **`hive_get_agents`** - List all registered agents with status
- **`hive_register_agent`** - Register new agents in the cluster
- **`whoosh_get_agents`** - List all registered agents with status
- **`whoosh_register_agent`** - Register new agents in the cluster
### Task Management
- **`hive_create_task`** - Create development tasks for specialized agents
- **`hive_get_task`** - Get details of specific tasks
- **`hive_get_tasks`** - List tasks with filtering options
- **`whoosh_create_task`** - Create development tasks for specialized agents
- **`whoosh_get_task`** - Get details of specific tasks
- **`whoosh_get_tasks`** - List tasks with filtering options
### Workflow Management
- **`hive_get_workflows`** - List available workflows
- **`hive_create_workflow`** - Create new distributed workflows
- **`hive_execute_workflow`** - Execute workflows with inputs
- **`whoosh_get_workflows`** - List available workflows
- **`whoosh_create_workflow`** - Create new distributed workflows
- **`whoosh_execute_workflow`** - Execute workflows with inputs
### Monitoring
- **`hive_get_cluster_status`** - Get comprehensive cluster status
- **`hive_get_metrics`** - Retrieve Prometheus metrics
- **`hive_get_executions`** - View workflow execution history
- **`whoosh_get_cluster_status`** - Get comprehensive cluster status
- **`whoosh_get_metrics`** - Retrieve Prometheus metrics
- **`whoosh_get_executions`** - View workflow execution history
### Coordination
- **`hive_coordinate_development`** - Orchestrate complex multi-agent development projects
- **`whoosh_coordinate_development`** - Orchestrate complex multi-agent development projects
## Available Resources
### Real-time Cluster Data
- **`hive://cluster/status`** - Live cluster status and health
- **`hive://agents/list`** - Agent registry with capabilities
- **`hive://tasks/active`** - Currently running and pending tasks
- **`hive://tasks/completed`** - Recent task results and metrics
- **`whoosh://cluster/status`** - Live cluster status and health
- **`whoosh://agents/list`** - Agent registry with capabilities
- **`whoosh://tasks/active`** - Currently running and pending tasks
- **`whoosh://tasks/completed`** - Recent task results and metrics
### Workflow Data
- **`hive://workflows/available`** - All configured workflows
- **`hive://executions/recent`** - Recent workflow executions
- **`whoosh://workflows/available`** - All configured workflows
- **`whoosh://executions/recent`** - Recent workflow executions
### Monitoring Data
- **`hive://metrics/prometheus`** - Raw Prometheus metrics
- **`hive://capabilities/overview`** - Cluster capabilities summary
- **`whoosh://metrics/prometheus`** - Raw Prometheus metrics
- **`whoosh://capabilities/overview`** - Cluster capabilities summary
## Example Usage with Claude
### Register an Agent
```
Please register a new agent in my Hive cluster:
Please register a new agent in my WHOOSH cluster:
- ID: walnut-kernel-dev
- Endpoint: http://walnut.local:11434
- Model: codellama:34b
@@ -137,23 +137,23 @@ Use parallel coordination where possible.
### Monitor Cluster Status
```
What's the current status of my Hive cluster? Show me agent utilization and recent task performance.
What's the current status of my WHOOSH cluster? Show me agent utilization and recent task performance.
```
## Configuration
The MCP server connects to the Hive backend using domain endpoints by default. You can customize this by setting environment variables:
The MCP server connects to the WHOOSH backend using domain endpoints by default. You can customize this by setting environment variables:
**Production (Default):**
- **`HIVE_API_URL`** - `https://hive.home.deepblack.cloud`
- **`HIVE_WS_URL`** - `wss://hive.home.deepblack.cloud`
- **`WHOOSH_API_URL`** - `https://whoosh.home.deepblack.cloud`
- **`WHOOSH_WS_URL`** - `wss://whoosh.home.deepblack.cloud`
**Development/Local Testing:**
- **`HIVE_API_URL`** - `http://localhost:8087`
- **`HIVE_WS_URL`** - `ws://localhost:8087`
- **`WHOOSH_API_URL`** - `http://localhost:8087`
- **`WHOOSH_WS_URL`** - `ws://localhost:8087`
**Additional Options:**
- **`HIVE_TIMEOUT`** - Request timeout in milliseconds (default: `30000`)
- **`WHOOSH_TIMEOUT`** - Request timeout in milliseconds (default: `30000`)
Copy `.env.example` to `.env` and modify as needed for your deployment.
@@ -169,9 +169,9 @@ npm run watch
npm run dev
```
## Integration with Hive
## Integration with WHOOSH
This MCP server connects to your running Hive platform and provides a standardized interface for AI assistants to:
This MCP server connects to your running WHOOSH platform and provides a standardized interface for AI assistants to:
1. **Understand** your cluster capabilities and current state
2. **Plan** complex development tasks across multiple agents
@@ -182,7 +182,7 @@ The server automatically handles task queuing, agent assignment, and result aggr
## Security Notes
- The MCP server connects to your local Hive cluster
- The MCP server connects to your local WHOOSH cluster
- No external network access required
- All communication stays within your development environment
- Agent endpoints should be on trusted networks only

View File

@@ -1,6 +1,6 @@
# 🐝 Hive MCP Server Service
# 🐝 WHOOSH MCP Server Service
This directory contains the systemd service configuration for running the Hive MCP Server as a background daemon with automatic agent discovery.
This directory contains the systemd service configuration for running the WHOOSH MCP Server as a background daemon with automatic agent discovery.
## 🚀 Quick Start
@@ -11,17 +11,17 @@ This directory contains the systemd service configuration for running the Hive M
### 2. Start the Service
```bash
sudo systemctl start hive-mcp
sudo systemctl start whoosh-mcp
```
### 3. Check Status
```bash
sudo systemctl status hive-mcp
sudo systemctl status whoosh-mcp
```
### 4. View Logs
```bash
journalctl -u hive-mcp -f
journalctl -u whoosh-mcp -f
```
## 🛠️ Management Script
@@ -30,32 +30,32 @@ Use the provided management script for easy operations:
```bash
# Install service
./hive-mcp.sh install
./whoosh-mcp.sh install
# Start/stop/restart
./hive-mcp.sh start
./hive-mcp.sh stop
./hive-mcp.sh restart
./whoosh-mcp.sh start
./whoosh-mcp.sh stop
./whoosh-mcp.sh restart
# Monitor
./hive-mcp.sh status
./hive-mcp.sh logs
./hive-mcp.sh follow
./whoosh-mcp.sh status
./whoosh-mcp.sh logs
./whoosh-mcp.sh follow
# Agent management
./hive-mcp.sh discover # Trigger agent discovery
./hive-mcp.sh test # Test backend connection
./whoosh-mcp.sh discover # Trigger agent discovery
./whoosh-mcp.sh test # Test backend connection
# Remove service
./hive-mcp.sh uninstall
./whoosh-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)
- `WHOOSH_API_URL`: WHOOSH backend API endpoint (default: https://whoosh.home.deepblack.cloud/api)
- `WHOOSH_WS_URL`: WebSocket endpoint (default: wss://whoosh.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)
@@ -66,45 +66,45 @@ The service automatically:
1. **On Startup**: Scans the network for available Ollama agents
2. **Periodically**: Re-scans every 5 minutes (configurable)
3. **On Signal**: Triggers discovery when receiving SIGHUP (`systemctl reload hive-mcp`)
3. **On Signal**: Triggers discovery when receiving SIGHUP (`systemctl reload whoosh-mcp`)
## 📊 Monitoring
### Service Status
```bash
sudo systemctl status hive-mcp
sudo systemctl status whoosh-mcp
```
### Live Logs
```bash
journalctl -u hive-mcp -f
journalctl -u whoosh-mcp -f
```
### Resource Usage
```bash
sudo systemctl show hive-mcp --property=MemoryCurrent,CPUUsageNSec
sudo systemctl show whoosh-mcp --property=MemoryCurrent,CPUUsageNSec
```
### Agent Status
```bash
curl -s https://hive.home.deepblack.cloud/api/agents | jq
curl -s https://whoosh.home.deepblack.cloud/api/agents | jq
```
## 🔧 Troubleshooting
### Service Won't Start
1. Check logs: `journalctl -u hive-mcp -n 50`
2. Verify backend connectivity: `./hive-mcp.sh test`
3. Check file permissions: `ls -la /home/tony/AI/projects/hive/mcp-server/`
1. Check logs: `journalctl -u whoosh-mcp -n 50`
2. Verify backend connectivity: `./whoosh-mcp.sh test`
3. Check file permissions: `ls -la /home/tony/AI/projects/whoosh/mcp-server/`
### Auto-Discovery Issues
1. Check network connectivity to agent machines
2. Verify Ollama is running on target machines
3. Manually trigger discovery: `./hive-mcp.sh discover`
3. Manually trigger discovery: `./whoosh-mcp.sh discover`
### High Resource Usage
1. Check discovery interval: `grep DISCOVERY_INTERVAL /etc/systemd/system/hive-mcp.service`
2. Monitor agent count: `curl -s https://hive.home.deepblack.cloud/api/agents | jq '.total'`
1. Check discovery interval: `grep DISCOVERY_INTERVAL /etc/systemd/system/whoosh-mcp.service`
2. Monitor agent count: `curl -s https://whoosh.home.deepblack.cloud/api/agents | jq '.total'`
3. Adjust memory limits in service file if needed
## 🛡️ Security
@@ -118,16 +118,16 @@ The service runs with:
## 📁 Files
- `hive-mcp.service` - Systemd service definition
- `whoosh-mcp.service` - Systemd service definition
- `install-service.sh` - Service installation script
- `hive-mcp.sh` - Management script
- `whoosh-mcp.sh` - Management script
- `logs/` - 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
- **WHOOSH Backend**: https://whoosh.home.deepblack.cloud/api
- **Socket.IO**: wss://whoosh.home.deepblack.cloud/socket.io
- **Systemd**: Full systemd service lifecycle
- **Journal**: Centralized logging via systemd-journald

View File

@@ -1,11 +1,11 @@
{
"mcpServers": {
"hive": {
"whoosh": {
"command": "node",
"args": ["/home/tony/AI/projects/hive/mcp-server/dist/index.js"],
"args": ["/home/tony/AI/projects/whoosh/mcp-server/dist/index.js"],
"env": {
"HIVE_API_URL": "https://hive.home.deepblack.cloud/api",
"HIVE_WS_URL": "wss://hive.home.deepblack.cloud/socket.io",
"WHOOSH_API_URL": "https://whoosh.home.deepblack.cloud/api",
"WHOOSH_WS_URL": "wss://whoosh.home.deepblack.cloud/socket.io",
"NODE_TLS_REJECT_UNAUTHORIZED": "0"
}
}

View File

@@ -1 +0,0 @@
{"version":3,"file":"hive-client.d.ts","sourceRoot":"","sources":["../src/hive-client.ts"],"names":[],"mappings":"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"}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"hive-resources.d.ts","sourceRoot":"","sources":["../src/hive-resources.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAI5B,eAAe,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAqDtC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;YA0ClH,wBAAwB;YAcxB,iBAAiB;YAkCjB,sBAAsB;YA0BtB,yBAAyB;YA4BzB,oBAAoB;YA0BpB,qBAAqB;YA6BrB,kBAAkB;YAclB,uBAAuB;IAyDrC,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,0BAA0B;IAOlC,OAAO,CAAC,iBAAiB;CAM1B"}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"hive-tools.d.ts","sourceRoot":"","sources":["../src/hive-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAM3D,qBAAa,SAAS;IACpB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC,WAAW,IAAI,IAAI,EAAE;IA2Qf,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;YA2E1D,SAAS;YAiDT,aAAa;YAkBb,UAAU;YA6BV,OAAO;YAoBP,QAAQ;YAsBR,YAAY;YAqBZ,cAAc;YAiBd,eAAe;YAiBf,gBAAgB;YAuBhB,UAAU;YAaV,aAAa;YAsBb,qBAAqB;YAuCrB,eAAe;YA0Ff,gBAAgB;YA4ChB,YAAY;YAyCZ,2BAA2B;CAuD1C"}

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env node
/**
* Hive MCP Server
* WHOOSH MCP Server
*
* Exposes the Hive Distributed AI Orchestration Platform via Model Context Protocol (MCP)
* Exposes the WHOOSH Distributed AI Orchestration Platform via Model Context Protocol (MCP)
* Allows AI assistants like Claude to directly orchestrate distributed development tasks
*/
export {};

View File

@@ -1,26 +1,26 @@
#!/usr/bin/env node
/**
* Hive MCP Server
* WHOOSH MCP Server
*
* Exposes the Hive Distributed AI Orchestration Platform via Model Context Protocol (MCP)
* Exposes the WHOOSH Distributed AI Orchestration Platform via Model Context Protocol (MCP)
* Allows AI assistants like Claude to directly orchestrate distributed development tasks
*/
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
import { HiveClient } from './hive-client.js';
import { HiveTools } from './hive-tools.js';
import { HiveResources } from './hive-resources.js';
class HiveMCPServer {
import { WHOOSHClient } from './whoosh-client.js';
import { WHOOSHTools } from './whoosh-tools.js';
import { WHOOSHResources } from './whoosh-resources.js';
class WHOOSHMCPServer {
server;
hiveClient;
hiveTools;
hiveResources;
whooshClient;
whooshTools;
whooshResources;
discoveryInterval;
isDaemonMode = false;
constructor() {
this.server = new Server({
name: 'hive-mcp-server',
name: 'whoosh-mcp-server',
version: '1.0.0',
}, {
capabilities: {
@@ -28,32 +28,32 @@ class HiveMCPServer {
resources: {},
},
});
// Initialize Hive client and handlers
this.hiveClient = new HiveClient();
this.hiveTools = new HiveTools(this.hiveClient);
this.hiveResources = new HiveResources(this.hiveClient);
// Initialize WHOOSH client and handlers
this.whooshClient = new WHOOSHClient();
this.whooshTools = new WHOOSHTools(this.whooshClient);
this.whooshResources = new WHOOSHResources(this.whooshClient);
this.setupHandlers();
}
setupHandlers() {
// Tools handler - exposes Hive operations as MCP tools
// Tools handler - exposes WHOOSH operations as MCP tools
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: this.hiveTools.getAllTools(),
tools: this.whooshTools.getAllTools(),
};
});
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
const { name, arguments: args } = request.params;
return await this.hiveTools.executeTool(name, args || {});
return await this.whooshTools.executeTool(name, args || {});
});
// Resources handler - exposes Hive cluster state as MCP resources
// Resources handler - exposes WHOOSH cluster state as MCP resources
this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
return {
resources: await this.hiveResources.getAllResources(),
resources: await this.whooshResources.getAllResources(),
};
});
this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
const { uri } = request.params;
return await this.hiveResources.readResource(uri);
return await this.whooshResources.readResource(uri);
});
// Error handling
this.server.onerror = (error) => {
@@ -71,19 +71,19 @@ class HiveMCPServer {
});
}
async start() {
console.log('🐝 Starting Hive MCP Server...');
console.log('🐝 Starting WHOOSH MCP Server...');
// Check for daemon mode
this.isDaemonMode = process.argv.includes('--daemon');
if (this.isDaemonMode) {
console.log('🔧 Running in daemon mode');
}
// Test connection to Hive backend
// Test connection to WHOOSH backend
try {
await this.hiveClient.testConnection();
console.log('✅ Connected to Hive backend successfully');
await this.whooshClient.testConnection();
console.log('✅ Connected to WHOOSH backend successfully');
}
catch (error) {
console.error('❌ Failed to connect to Hive backend:', error);
console.error('❌ Failed to connect to WHOOSH backend:', error);
process.exit(1);
}
// Auto-discover and register agents on startup
@@ -100,7 +100,7 @@ class HiveMCPServer {
this.setupPeriodicDiscovery();
}
if (this.isDaemonMode) {
console.log('🚀 Hive MCP Server running in daemon mode');
console.log('🚀 WHOOSH MCP Server running in daemon mode');
console.log('🔗 Monitoring cluster and auto-discovering agents...');
// Keep the process alive in daemon mode
setInterval(() => {
@@ -110,7 +110,7 @@ class HiveMCPServer {
else {
const transport = new StdioServerTransport();
await this.server.connect(transport);
console.log('🚀 Hive MCP Server running on stdio');
console.log('🚀 WHOOSH MCP Server running on stdio');
console.log('🔗 AI assistants can now orchestrate your distributed cluster!');
}
}
@@ -129,8 +129,8 @@ class HiveMCPServer {
}, interval);
}
async autoDiscoverAgents() {
// Use the existing hive_bring_online functionality
const result = await this.hiveTools.executeTool('hive_bring_online', {
// Use the existing whoosh_bring_online functionality
const result = await this.whooshTools.executeTool('whoosh_bring_online', {
force_refresh: false,
subnet_scan: true
});
@@ -139,20 +139,20 @@ class HiveMCPServer {
}
}
async shutdown() {
console.log('🛑 Shutting down Hive MCP Server...');
console.log('🛑 Shutting down WHOOSH MCP Server...');
if (this.discoveryInterval) {
clearInterval(this.discoveryInterval);
console.log('✅ Stopped periodic auto-discovery');
}
await this.server.close();
console.log('✅ Hive MCP Server stopped');
console.log('✅ WHOOSH MCP Server stopped');
process.exit(0);
}
}
// Start the server
const server = new HiveMCPServer();
const server = new WHOOSHMCPServer();
server.start().catch((error) => {
console.error('Failed to start Hive MCP Server:', error);
console.error('Failed to start WHOOSH MCP Server:', error);
process.exit(1);
});
//# sourceMappingURL=index.js.map

View File

@@ -1,10 +1,10 @@
/**
* Hive Client
* WHOOSH Client
*
* Handles communication with the Hive backend API
* Handles communication with the WHOOSH backend API
*/
import WebSocket from 'ws';
export interface HiveConfig {
export interface WHOOSHConfig {
baseUrl: string;
wsUrl: string;
timeout: number;
@@ -59,11 +59,11 @@ export interface ClusterStatus {
failed: number;
};
}
export declare class HiveClient {
export declare class WHOOSHClient {
private api;
private config;
private wsConnection?;
constructor(config?: Partial<HiveConfig>);
constructor(config?: Partial<WHOOSHConfig>);
testConnection(): Promise<boolean>;
getAgents(): Promise<Agent[]>;
registerAgent(agentData: Partial<Agent>): Promise<{
@@ -117,4 +117,4 @@ export declare class HiveClient {
connectWebSocket(topic?: string): Promise<WebSocket>;
disconnect(): Promise<void>;
}
//# sourceMappingURL=hive-client.d.ts.map
//# sourceMappingURL=whoosh-client.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"whoosh-client.d.ts","sourceRoot":"","sources":["../src/whoosh-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC9B,UAAU,CAAC,EAAE;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,GAAG,CAAgB;IAC3B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,YAAY,CAAC,CAAY;gBAErB,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC;IAiBlC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAUlC,SAAS,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAK7B,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAMvE,YAAY,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAKhC,gBAAgB,CAAC,SAAS,EAAE;QAChC,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAKjE,2BAA2B,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAK1D,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAKlD,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC;IAKrC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAMlE,UAAU,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC9B,GAAG,OAAO,CAAC,IAAI,CAAC;IAKX,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAWb,YAAY,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAK9B,cAAc,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAKnF,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAMpG,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC;IAK1C,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAK7B,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAOlD,gBAAgB,CAAC,KAAK,GAAE,MAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;IA0B/D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAMlC"}

View File

@@ -1,19 +1,19 @@
/**
* Hive Client
* WHOOSH Client
*
* Handles communication with the Hive backend API
* Handles communication with the WHOOSH backend API
*/
import axios from 'axios';
import WebSocket from 'ws';
export class HiveClient {
export class WHOOSHClient {
api;
config;
wsConnection;
constructor(config) {
this.config = {
baseUrl: process.env.HIVE_API_URL || 'https://hive.home.deepblack.cloud/api',
wsUrl: process.env.HIVE_WS_URL || 'wss://hive.home.deepblack.cloud/socket.io',
timeout: parseInt(process.env.HIVE_TIMEOUT || '30000'),
baseUrl: process.env.WHOOSH_API_URL || 'https://whoosh.home.deepblack.cloud/api',
wsUrl: process.env.WHOOSH_WS_URL || 'wss://whoosh.home.deepblack.cloud/socket.io',
timeout: parseInt(process.env.WHOOSH_TIMEOUT || '30000'),
...config,
};
this.api = axios.create({
@@ -30,7 +30,7 @@ export class HiveClient {
return response.data.status === 'healthy' || response.status === 200;
}
catch (error) {
throw new Error(`Failed to connect to Hive: ${error}`);
throw new Error(`Failed to connect to WHOOSH: ${error}`);
}
}
// Agent Management
@@ -119,7 +119,7 @@ export class HiveClient {
return new Promise((resolve, reject) => {
const ws = new WebSocket(`${this.config.wsUrl}/ws/${topic}`);
ws.on('open', () => {
console.log(`🔗 Connected to Hive WebSocket (${topic})`);
console.log(`🔗 Connected to WHOOSH WebSocket (${topic})`);
this.wsConnection = ws;
resolve(ws);
});
@@ -130,7 +130,7 @@ export class HiveClient {
ws.on('message', (data) => {
try {
const message = JSON.parse(data.toString());
console.log('📨 Hive update:', message);
console.log('📨 WHOOSH update:', message);
}
catch (error) {
console.error('Failed to parse WebSocket message:', error);
@@ -145,4 +145,4 @@ export class HiveClient {
}
}
}
//# sourceMappingURL=hive-client.js.map
//# sourceMappingURL=whoosh-client.js.map

1
mcp-server/dist/whoosh-client.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,13 @@
/**
* Hive Resources
* WHOOSH Resources
*
* Defines MCP resources that expose Hive cluster state and real-time data
* Defines MCP resources that expose WHOOSH cluster state and real-time data
*/
import { Resource } from '@modelcontextprotocol/sdk/types.js';
import { HiveClient } from './hive-client.js';
export declare class HiveResources {
private hiveClient;
constructor(hiveClient: HiveClient);
import { WHOOSHClient } from './whoosh-client.js';
export declare class WHOOSHResources {
private whooshClient;
constructor(whooshClient: WHOOSHClient);
getAllResources(): Promise<Resource[]>;
readResource(uri: string): Promise<{
contents: Array<{
@@ -32,4 +32,4 @@ export declare class HiveResources {
private summarizeExecutionStatuses;
private calculateDuration;
}
//# sourceMappingURL=hive-resources.d.ts.map
//# sourceMappingURL=whoosh-resources.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"whoosh-resources.d.ts","sourceRoot":"","sources":["../src/whoosh-resources.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAI5B,eAAe,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAqDtC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;YA0ClH,wBAAwB;YAcxB,iBAAiB;YAkCjB,sBAAsB;YA0BtB,yBAAyB;YA4BzB,oBAAoB;YA0BpB,qBAAqB;YA6BrB,kBAAkB;YAclB,uBAAuB;IAyDrC,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,0BAA0B;IAOlC,OAAO,CAAC,iBAAiB;CAM1B"}

View File

@@ -1,59 +1,59 @@
/**
* Hive Resources
* WHOOSH Resources
*
* Defines MCP resources that expose Hive cluster state and real-time data
* Defines MCP resources that expose WHOOSH cluster state and real-time data
*/
export class HiveResources {
hiveClient;
constructor(hiveClient) {
this.hiveClient = hiveClient;
export class WHOOSHResources {
whooshClient;
constructor(whooshClient) {
this.whooshClient = whooshClient;
}
async getAllResources() {
return [
{
uri: 'hive://cluster/status',
uri: 'whoosh://cluster/status',
name: 'Cluster Status',
description: 'Real-time status of the entire Hive cluster including agents and tasks',
description: 'Real-time status of the entire WHOOSH cluster including agents and tasks',
mimeType: 'application/json',
},
{
uri: 'hive://agents/list',
uri: 'whoosh://agents/list',
name: 'Agent Registry',
description: 'List of all registered AI agents with their capabilities and current status',
mimeType: 'application/json',
},
{
uri: 'hive://tasks/active',
uri: 'whoosh://tasks/active',
name: 'Active Tasks',
description: 'Currently running and pending tasks across the cluster',
mimeType: 'application/json',
},
{
uri: 'hive://tasks/completed',
uri: 'whoosh://tasks/completed',
name: 'Completed Tasks',
description: 'Recently completed tasks with results and performance metrics',
mimeType: 'application/json',
},
{
uri: 'hive://workflows/available',
uri: 'whoosh://workflows/available',
name: 'Available Workflows',
description: 'All configured workflows ready for execution',
mimeType: 'application/json',
},
{
uri: 'hive://executions/recent',
uri: 'whoosh://executions/recent',
name: 'Recent Executions',
description: 'Recent workflow executions with status and results',
mimeType: 'application/json',
},
{
uri: 'hive://metrics/prometheus',
uri: 'whoosh://metrics/prometheus',
name: 'Cluster Metrics',
description: 'Prometheus metrics for monitoring cluster performance',
mimeType: 'text/plain',
},
{
uri: 'hive://capabilities/overview',
uri: 'whoosh://capabilities/overview',
name: 'Cluster Capabilities',
description: 'Overview of available agent types and their specializations',
mimeType: 'application/json',
@@ -63,21 +63,21 @@ export class HiveResources {
async readResource(uri) {
try {
switch (uri) {
case 'hive://cluster/status':
case 'whoosh://cluster/status':
return await this.getClusterStatusResource();
case 'hive://agents/list':
case 'whoosh://agents/list':
return await this.getAgentsResource();
case 'hive://tasks/active':
case 'whoosh://tasks/active':
return await this.getActiveTasksResource();
case 'hive://tasks/completed':
case 'whoosh://tasks/completed':
return await this.getCompletedTasksResource();
case 'hive://workflows/available':
case 'whoosh://workflows/available':
return await this.getWorkflowsResource();
case 'hive://executions/recent':
case 'whoosh://executions/recent':
return await this.getExecutionsResource();
case 'hive://metrics/prometheus':
case 'whoosh://metrics/prometheus':
return await this.getMetricsResource();
case 'hive://capabilities/overview':
case 'whoosh://capabilities/overview':
return await this.getCapabilitiesResource();
default:
throw new Error(`Resource not found: ${uri}`);
@@ -95,7 +95,7 @@ export class HiveResources {
}
}
async getClusterStatusResource() {
const status = await this.hiveClient.getClusterStatus();
const status = await this.whooshClient.getClusterStatus();
return {
contents: [
{
@@ -107,7 +107,7 @@ export class HiveResources {
};
}
async getAgentsResource() {
const agents = await this.hiveClient.getAgents();
const agents = await this.whooshClient.getAgents();
const agentData = {
total_agents: agents.length,
agents: agents.map(agent => ({
@@ -138,8 +138,8 @@ export class HiveResources {
};
}
async getActiveTasksResource() {
const pendingTasks = await this.hiveClient.getTasks({ status: 'pending', limit: 50 });
const runningTasks = await this.hiveClient.getTasks({ status: 'in_progress', limit: 50 });
const pendingTasks = await this.whooshClient.getTasks({ status: 'pending', limit: 50 });
const runningTasks = await this.whooshClient.getTasks({ status: 'in_progress', limit: 50 });
const activeData = {
summary: {
pending: pendingTasks.length,
@@ -161,8 +161,8 @@ export class HiveResources {
};
}
async getCompletedTasksResource() {
const completedTasks = await this.hiveClient.getTasks({ status: 'completed', limit: 20 });
const failedTasks = await this.hiveClient.getTasks({ status: 'failed', limit: 10 });
const completedTasks = await this.whooshClient.getTasks({ status: 'completed', limit: 20 });
const failedTasks = await this.whooshClient.getTasks({ status: 'failed', limit: 10 });
const completedData = {
summary: {
completed: completedTasks.length,
@@ -186,7 +186,7 @@ export class HiveResources {
};
}
async getWorkflowsResource() {
const workflows = await this.hiveClient.getWorkflows();
const workflows = await this.whooshClient.getWorkflows();
const workflowData = {
total_workflows: workflows.length,
workflows: workflows.map(wf => ({
@@ -209,7 +209,7 @@ export class HiveResources {
};
}
async getExecutionsResource() {
const executions = await this.hiveClient.getExecutions();
const executions = await this.whooshClient.getExecutions();
const executionData = {
total_executions: executions.length,
recent_executions: executions.slice(0, 10).map(exec => ({
@@ -235,7 +235,7 @@ export class HiveResources {
};
}
async getMetricsResource() {
const metrics = await this.hiveClient.getMetrics();
const metrics = await this.whooshClient.getMetrics();
return {
contents: [
{
@@ -247,7 +247,7 @@ export class HiveResources {
};
}
async getCapabilitiesResource() {
const agents = await this.hiveClient.getAgents();
const agents = await this.whooshClient.getAgents();
const capabilities = {
agent_specializations: {
kernel_dev: {
@@ -367,4 +367,4 @@ export class HiveResources {
return `${minutes}m ${seconds}s`;
}
}
//# sourceMappingURL=hive-resources.js.map
//# sourceMappingURL=whoosh-resources.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,13 @@
/**
* Hive Tools
* WHOOSH Tools
*
* Defines MCP tools that expose Hive operations to AI assistants
* Defines MCP tools that expose WHOOSH operations to AI assistants
*/
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { HiveClient } from './hive-client.js';
export declare class HiveTools {
private hiveClient;
constructor(hiveClient: HiveClient);
import { WHOOSHClient } from './whoosh-client.js';
export declare class WHOOSHTools {
private whooshClient;
constructor(whooshClient: WHOOSHClient);
getAllTools(): Tool[];
executeTool(name: string, args: Record<string, any>): Promise<any>;
private getAgents;
@@ -22,9 +22,9 @@ export declare class HiveTools {
private getMetrics;
private getExecutions;
private coordinateDevelopment;
private bringHiveOnline;
private bringWHOOSHOnline;
private registerCliAgent;
private getCliAgents;
private registerPredefinedCliAgents;
}
//# sourceMappingURL=hive-tools.d.ts.map
//# sourceMappingURL=whoosh-tools.d.ts.map

1
mcp-server/dist/whoosh-tools.d.ts.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"whoosh-tools.d.ts","sourceRoot":"","sources":["../src/whoosh-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAM3D,qBAAa,SAAS;IACpB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC,WAAW,IAAI,IAAI,EAAE;IA2Qf,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;YA2E1D,SAAS;YAiDT,aAAa;YAkBb,UAAU;YA6BV,OAAO;YAoBP,QAAQ;YAsBR,YAAY;YAqBZ,cAAc;YAiBd,eAAe;YAiBf,gBAAgB;YAuBhB,UAAU;YAaV,aAAa;YAsBb,qBAAqB;YAuCrB,eAAe;YA0Ff,gBAAgB;YA4ChB,YAAY;YAyCZ,2BAA2B;CAuD1C"}

View File

@@ -1,30 +1,30 @@
/**
* Hive Tools
* WHOOSH Tools
*
* Defines MCP tools that expose Hive operations to AI assistants
* Defines MCP tools that expose WHOOSH operations to AI assistants
*/
import { v4 as uuidv4 } from 'uuid';
import { spawn } from 'child_process';
import * as path from 'path';
export class HiveTools {
hiveClient;
constructor(hiveClient) {
this.hiveClient = hiveClient;
export class WHOOSHTools {
whooshClient;
constructor(whooshClient) {
this.whooshClient = whooshClient;
}
getAllTools() {
return [
// Agent Management Tools
{
name: 'hive_get_agents',
description: 'Get all registered AI agents in the Hive cluster with their current status',
name: 'whoosh_get_agents',
description: 'Get all registered AI agents in the WHOOSH cluster with their current status',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_register_agent',
description: 'Register a new AI agent in the Hive cluster',
name: 'whoosh_register_agent',
description: 'Register a new AI agent in the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {
@@ -42,8 +42,8 @@ export class HiveTools {
},
},
{
name: 'hive_register_cli_agent',
description: 'Register a new CLI-based AI agent (e.g., Gemini CLI) in the Hive cluster',
name: 'whoosh_register_cli_agent',
description: 'Register a new CLI-based AI agent (e.g., Gemini CLI) in the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {
@@ -66,15 +66,15 @@ export class HiveTools {
},
},
{
name: 'hive_get_cli_agents',
description: 'Get all registered CLI agents in the Hive cluster',
name: 'whoosh_get_cli_agents',
description: 'Get all registered CLI agents in the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_register_predefined_cli_agents',
name: 'whoosh_register_predefined_cli_agents',
description: 'Register predefined CLI agents (walnut-gemini, ironwood-gemini) with verified configurations',
inputSchema: {
type: 'object',
@@ -83,8 +83,8 @@ export class HiveTools {
},
// Task Management Tools
{
name: 'hive_create_task',
description: 'Create and assign a development task to the Hive cluster',
name: 'whoosh_create_task',
description: 'Create and assign a development task to the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {
@@ -115,7 +115,7 @@ export class HiveTools {
},
},
{
name: 'hive_get_task',
name: 'whoosh_get_task',
description: 'Get details and status of a specific task',
inputSchema: {
type: 'object',
@@ -126,7 +126,7 @@ export class HiveTools {
},
},
{
name: 'hive_get_tasks',
name: 'whoosh_get_tasks',
description: 'Get list of tasks with optional filtering',
inputSchema: {
type: 'object',
@@ -143,15 +143,15 @@ export class HiveTools {
},
// Workflow Management Tools
{
name: 'hive_get_workflows',
description: 'Get all available workflows in the Hive platform',
name: 'whoosh_get_workflows',
description: 'Get all available workflows in the WHOOSH platform',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_create_workflow',
name: 'whoosh_create_workflow',
description: 'Create a new workflow for distributed task orchestration',
inputSchema: {
type: 'object',
@@ -177,7 +177,7 @@ export class HiveTools {
},
},
{
name: 'hive_execute_workflow',
name: 'whoosh_execute_workflow',
description: 'Execute a workflow with optional input parameters',
inputSchema: {
type: 'object',
@@ -194,23 +194,23 @@ export class HiveTools {
},
// Monitoring and Status Tools
{
name: 'hive_get_cluster_status',
description: 'Get comprehensive status of the entire Hive cluster',
name: 'whoosh_get_cluster_status',
description: 'Get comprehensive status of the entire WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_get_metrics',
description: 'Get Prometheus metrics from the Hive cluster',
name: 'whoosh_get_metrics',
description: 'Get Prometheus metrics from the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_get_executions',
name: 'whoosh_get_executions',
description: 'Get workflow execution history and status',
inputSchema: {
type: 'object',
@@ -221,7 +221,7 @@ export class HiveTools {
},
// Coordination Tools
{
name: 'hive_coordinate_development',
name: 'whoosh_coordinate_development',
description: 'Coordinate a complex development task across multiple specialized agents',
inputSchema: {
type: 'object',
@@ -252,8 +252,8 @@ export class HiveTools {
},
// Cluster Management Tools
{
name: 'hive_bring_online',
description: 'Automatically discover and register all available Ollama agents on the network, bringing the entire Hive cluster online',
name: 'whoosh_bring_online',
description: 'Automatically discover and register all available Ollama agents on the network, bringing the entire WHOOSH cluster online',
inputSchema: {
type: 'object',
properties: {
@@ -276,43 +276,43 @@ export class HiveTools {
try {
switch (name) {
// Agent Management
case 'hive_get_agents':
case 'whoosh_get_agents':
return await this.getAgents();
case 'hive_register_agent':
case 'whoosh_register_agent':
return await this.registerAgent(args);
case 'hive_register_cli_agent':
case 'whoosh_register_cli_agent':
return await this.registerCliAgent(args);
case 'hive_get_cli_agents':
case 'whoosh_get_cli_agents':
return await this.getCliAgents();
case 'hive_register_predefined_cli_agents':
case 'whoosh_register_predefined_cli_agents':
return await this.registerPredefinedCliAgents();
// Task Management
case 'hive_create_task':
case 'whoosh_create_task':
return await this.createTask(args);
case 'hive_get_task':
case 'whoosh_get_task':
return await this.getTask(args.task_id);
case 'hive_get_tasks':
case 'whoosh_get_tasks':
return await this.getTasks(args);
// Workflow Management
case 'hive_get_workflows':
case 'whoosh_get_workflows':
return await this.getWorkflows();
case 'hive_create_workflow':
case 'whoosh_create_workflow':
return await this.createWorkflow(args);
case 'hive_execute_workflow':
case 'whoosh_execute_workflow':
return await this.executeWorkflow(args.workflow_id, args.inputs);
// Monitoring
case 'hive_get_cluster_status':
case 'whoosh_get_cluster_status':
return await this.getClusterStatus();
case 'hive_get_metrics':
case 'whoosh_get_metrics':
return await this.getMetrics();
case 'hive_get_executions':
case 'whoosh_get_executions':
return await this.getExecutions(args.workflow_id);
// Coordination
case 'hive_coordinate_development':
case 'whoosh_coordinate_development':
return await this.coordinateDevelopment(args);
// Cluster Management
case 'hive_bring_online':
return await this.bringHiveOnline(args);
case 'whoosh_bring_online':
return await this.bringWHOOSHOnline(args);
default:
throw new Error(`Unknown tool: ${name}`);
}
@@ -331,7 +331,7 @@ export class HiveTools {
}
// Tool Implementation Methods
async getAgents() {
const agents = await this.hiveClient.getAgents();
const agents = await this.whooshClient.getAgents();
// Group agents by type
const ollamaAgents = agents.filter(agent => !agent.agent_type || agent.agent_type === 'ollama');
const cliAgents = agents.filter(agent => agent.agent_type === 'cli');
@@ -344,7 +344,7 @@ export class HiveTools {
` • Status: ${agent.status}\n` +
` • Tasks: ${agent.current_tasks}/${agent.max_concurrent}\n`;
};
let text = `📋 **Hive Cluster Agents** (${agents.length} total)\n\n`;
let text = `📋 **WHOOSH Cluster Agents** (${agents.length} total)\n\n`;
if (ollamaAgents.length > 0) {
text += `🤖 **Ollama Agents** (${ollamaAgents.length}):\n`;
text += ollamaAgents.map(formatAgent).join('\n') + '\n';
@@ -356,10 +356,10 @@ export class HiveTools {
if (agents.length === 0) {
text += 'No agents registered yet.\n\n';
text += '**Getting Started:**\n';
text += '• Use `hive_register_agent` for Ollama agents\n';
text += '• Use `hive_register_cli_agent` for CLI agents\n';
text += '• Use `hive_register_predefined_cli_agents` for quick CLI setup\n';
text += '• Use `hive_bring_online` for auto-discovery';
text += '• Use `whoosh_register_agent` for Ollama agents\n';
text += '• Use `whoosh_register_cli_agent` for CLI agents\n';
text += '• Use `whoosh_register_predefined_cli_agents` for quick CLI setup\n';
text += '• Use `whoosh_bring_online` for auto-discovery';
}
return {
content: [
@@ -371,12 +371,12 @@ export class HiveTools {
};
}
async registerAgent(args) {
const result = await this.hiveClient.registerAgent(args);
const result = await this.whooshClient.registerAgent(args);
return {
content: [
{
type: 'text',
text: `✅ Successfully registered agent **${args.id}** in the Hive cluster!\n\n` +
text: `✅ Successfully registered agent **${args.id}** in the WHOOSH cluster!\n\n` +
`🤖 Agent Details:\n` +
`• ID: ${args.id}\n` +
`• Specialization: ${args.specialty}\n` +
@@ -396,7 +396,7 @@ export class HiveTools {
...args.context,
},
};
const task = await this.hiveClient.createTask(taskData);
const task = await this.whooshClient.createTask(taskData);
return {
content: [
{
@@ -414,7 +414,7 @@ export class HiveTools {
};
}
async getTask(taskId) {
const task = await this.hiveClient.getTask(taskId);
const task = await this.whooshClient.getTask(taskId);
return {
content: [
{
@@ -432,12 +432,12 @@ export class HiveTools {
};
}
async getTasks(args) {
const tasks = await this.hiveClient.getTasks(args);
const tasks = await this.whooshClient.getTasks(args);
return {
content: [
{
type: 'text',
text: `📋 Hive Tasks (${tasks.length} found):\n\n${tasks.length > 0
text: `📋 WHOOSH Tasks (${tasks.length} found):\n\n${tasks.length > 0
? tasks.map(task => `🎯 **${task.id}** (${task.type})\n` +
` • Status: ${task.status}\n` +
` • Priority: ${task.priority}/5\n` +
@@ -449,23 +449,23 @@ export class HiveTools {
};
}
async getWorkflows() {
const workflows = await this.hiveClient.getWorkflows();
const workflows = await this.whooshClient.getWorkflows();
return {
content: [
{
type: 'text',
text: `🔄 Hive Workflows (${workflows.length} total):\n\n${workflows.length > 0
text: `🔄 WHOOSH Workflows (${workflows.length} total):\n\n${workflows.length > 0
? workflows.map(wf => `🔄 **${wf.name || wf.id}**\n` +
` • ID: ${wf.id}\n` +
` • Description: ${wf.description || 'No description'}\n` +
` • Status: ${wf.status || 'Unknown'}\n`).join('\n')
: 'No workflows created yet. Use hive_create_workflow to create distributed workflows.'}`,
: 'No workflows created yet. Use whoosh_create_workflow to create distributed workflows.'}`,
},
],
};
}
async createWorkflow(args) {
const result = await this.hiveClient.createWorkflow(args);
const result = await this.whooshClient.createWorkflow(args);
return {
content: [
{
@@ -474,13 +474,13 @@ export class HiveTools {
`🔄 Workflow ID: ${result.workflow_id}\n` +
`📋 Description: ${args.description || 'No description provided'}\n` +
`🔧 Steps: ${args.steps.length} configured\n\n` +
`The workflow is ready for execution using hive_execute_workflow.`,
`The workflow is ready for execution using whoosh_execute_workflow.`,
},
],
};
}
async executeWorkflow(workflowId, inputs) {
const result = await this.hiveClient.executeWorkflow(workflowId, inputs);
const result = await this.whooshClient.executeWorkflow(workflowId, inputs);
return {
content: [
{
@@ -489,18 +489,18 @@ export class HiveTools {
`🔄 Workflow ID: ${workflowId}\n` +
`⚡ Execution ID: ${result.execution_id}\n` +
`📥 Inputs: ${inputs ? JSON.stringify(inputs, null, 2) : 'None'}\n\n` +
`Use hive_get_executions to monitor progress.`,
`Use whoosh_get_executions to monitor progress.`,
},
],
};
}
async getClusterStatus() {
const status = await this.hiveClient.getClusterStatus();
const status = await this.whooshClient.getClusterStatus();
return {
content: [
{
type: 'text',
text: `🐝 **Hive Cluster Status**\n\n` +
text: `🐝 **WHOOSH Cluster Status**\n\n` +
`🟢 **System**: ${status.system.status} (v${status.system.version})\n` +
`⏱️ **Uptime**: ${Math.floor(status.system.uptime / 3600)}h ${Math.floor((status.system.uptime % 3600) / 60)}m\n\n` +
`🤖 **Agents**: ${status.agents.total} total\n` +
@@ -516,18 +516,18 @@ export class HiveTools {
};
}
async getMetrics() {
const metrics = await this.hiveClient.getMetrics();
const metrics = await this.whooshClient.getMetrics();
return {
content: [
{
type: 'text',
text: `📊 **Hive Cluster Metrics**\n\n\`\`\`\n${metrics}\n\`\`\``,
text: `📊 **WHOOSH Cluster Metrics**\n\n\`\`\`\n${metrics}\n\`\`\``,
},
],
};
}
async getExecutions(workflowId) {
const executions = await this.hiveClient.getExecutions(workflowId);
const executions = await this.whooshClient.getExecutions(workflowId);
return {
content: [
{
@@ -558,7 +558,7 @@ export class HiveTools {
coordination_id: uuidv4(),
},
};
const task = await this.hiveClient.createTask(taskData);
const task = await this.whooshClient.createTask(taskData);
createdTasks.push(task);
}
return {
@@ -575,17 +575,17 @@ export class HiveTools {
],
};
}
async bringHiveOnline(args) {
async bringWHOOSHOnline(args) {
const { force_refresh = false, subnet_scan = true } = args;
try {
// Get the path to the auto-discovery script
const scriptPath = path.resolve('/home/tony/AI/projects/hive/scripts/auto_discover_agents.py');
const scriptPath = path.resolve('/home/tony/AI/projects/whoosh/scripts/auto_discover_agents.py');
return new Promise((resolve, reject) => {
let output = '';
let errorOutput = '';
// Execute the auto-discovery script
const child = spawn('python3', [scriptPath], {
cwd: '/home/tony/AI/projects/hive',
cwd: '/home/tony/AI/projects/whoosh',
stdio: 'pipe',
});
child.stdout.on('data', (data) => {
@@ -614,17 +614,17 @@ export class HiveTools {
content: [
{
type: 'text',
text: `🐝 **Hive Cluster Online!** 🚀\n\n` +
text: `🐝 **WHOOSH Cluster Online!** 🚀\n\n` +
`🔍 **Auto-Discovery Complete**\n` +
`• Discovered: ${discovered} agents\n` +
`• Registered: ${registered} agents\n` +
`• Failed: ${failed} agents\n\n` +
`🤖 **Active Agents:**\n${agentDetails.join('\n')}\n\n` +
`✅ **Status**: The Hive cluster is now fully operational and ready for distributed AI orchestration!\n\n` +
`✅ **Status**: The WHOOSH cluster is now fully operational and ready for distributed AI orchestration!\n\n` +
`🎯 **Next Steps:**\n` +
`• Use \`hive_get_cluster_status\` to view detailed status\n` +
`• Use \`hive_coordinate_development\` to start distributed tasks\n` +
`• Use \`hive_create_workflow\` to build complex workflows`,
`• Use \`whoosh_get_cluster_status\` to view detailed status\n` +
`• Use \`whoosh_coordinate_development\` to start distributed tasks\n` +
`• Use \`whoosh_create_workflow\` to build complex workflows`,
},
],
});
@@ -643,11 +643,11 @@ export class HiveTools {
content: [
{
type: 'text',
text: `❌ **Failed to bring Hive online**\n\n` +
text: `❌ **Failed to bring WHOOSH online**\n\n` +
`Error: ${error instanceof Error ? error.message : String(error)}\n\n` +
`Please ensure:\n` +
`• The Hive backend is running\n` +
`• The auto-discovery script exists at /home/tony/AI/projects/hive/scripts/auto_discover_agents.py\n` +
`• The WHOOSH backend is running\n` +
`• The auto-discovery script exists at /home/tony/AI/projects/whoosh/scripts/auto_discover_agents.py\n` +
`• Python3 is available and required dependencies are installed`,
},
],
@@ -657,7 +657,7 @@ export class HiveTools {
}
async registerCliAgent(args) {
try {
const result = await this.hiveClient.registerCliAgent(args);
const result = await this.whooshClient.registerCliAgent(args);
return {
content: [
{
@@ -691,7 +691,7 @@ export class HiveTools {
`• Verify SSH connectivity to ${args.host}\n` +
`• Ensure Gemini CLI is installed and accessible\n` +
`• Check Node.js version ${args.node_version} is available\n` +
`• Confirm Hive backend is running and accessible`,
`• Confirm WHOOSH backend is running and accessible`,
},
],
isError: true,
@@ -700,7 +700,7 @@ export class HiveTools {
}
async getCliAgents() {
try {
const cliAgents = await this.hiveClient.getCliAgents();
const cliAgents = await this.whooshClient.getCliAgents();
return {
content: [
{
@@ -715,8 +715,8 @@ export class HiveTools {
` • Endpoint: ${agent.endpoint}\n`).join('\n')
: 'No CLI agents registered yet.\n\n' +
'**Getting Started:**\n' +
'• Use `hive_register_cli_agent` to register individual CLI agents\n' +
'• Use `hive_register_predefined_cli_agents` to register walnut-gemini and ironwood-gemini automatically'}`,
'• Use `whoosh_register_cli_agent` to register individual CLI agents\n' +
'• Use `whoosh_register_predefined_cli_agents` to register walnut-gemini and ironwood-gemini automatically'}`,
},
],
};
@@ -728,7 +728,7 @@ export class HiveTools {
type: 'text',
text: `❌ **Failed to get CLI agents**\n\n` +
`Error: ${error instanceof Error ? error.message : String(error)}\n\n` +
`Please ensure the Hive backend is running and accessible.`,
`Please ensure the WHOOSH backend is running and accessible.`,
},
],
isError: true,
@@ -737,7 +737,7 @@ export class HiveTools {
}
async registerPredefinedCliAgents() {
try {
const result = await this.hiveClient.registerPredefinedCliAgents();
const result = await this.whooshClient.registerPredefinedCliAgents();
const successCount = result.results.filter((r) => r.status === 'success').length;
const existingCount = result.results.filter((r) => r.status === 'already_exists').length;
const failedCount = result.results.filter((r) => r.status === 'failed').length;
@@ -779,7 +779,7 @@ export class HiveTools {
`• Ensure WALNUT and IRONWOOD are accessible via SSH\n` +
`• Verify Gemini CLI is installed on both machines\n` +
`• Check that Node.js v22.14.0 (WALNUT) and v22.17.0 (IRONWOOD) are available\n` +
`• Confirm Hive backend is running with CLI agent support`,
`• Confirm WHOOSH backend is running with CLI agent support`,
},
],
isError: true,
@@ -787,4 +787,4 @@ export class HiveTools {
}
}
}
//# sourceMappingURL=hive-tools.js.map
//# sourceMappingURL=whoosh-tools.js.map

1
mcp-server/dist/whoosh-tools.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,52 +0,0 @@
[Unit]
Description=Hive MCP Server - Distributed AI Orchestration
Documentation=https://github.com/anthropics/hive-mcp-server
After=network-online.target
Wants=network-online.target
StartLimitIntervalSec=30
StartLimitBurst=3
[Service]
Type=simple
User=tony
Group=tony
WorkingDirectory=/home/tony/AI/projects/hive/mcp-server
# Environment variables
Environment=NODE_ENV=production
Environment=HIVE_API_URL=https://hive.home.deepblack.cloud/api
Environment=HIVE_WS_URL=wss://hive.home.deepblack.cloud/socket.io
Environment=LOG_LEVEL=info
Environment=AUTO_DISCOVERY=true
Environment=DISCOVERY_INTERVAL=300000
# Main service command
ExecStart=/usr/bin/node dist/index.js --daemon
ExecReload=/bin/kill -HUP $MAINPID
# Restart policy
Restart=always
RestartSec=10
TimeoutStartSec=30
TimeoutStopSec=15
# Security settings
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths=/home/tony/AI/projects/hive/mcp-server/logs
ReadWritePaths=/home/tony/AI/projects/hive/mcp-server/data
# Resource limits
LimitNOFILE=65536
MemoryMax=512M
CPUQuota=50%
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=hive-mcp
[Install]
WantedBy=multi-user.target

View File

@@ -1,10 +1,10 @@
#!/bin/bash
# Hive MCP Server Service Installation Script
# WHOOSH MCP Server Service Installation Script
set -e
echo "🐝 Installing Hive MCP Server as a systemd service..."
echo "🐝 Installing WHOOSH MCP Server as a systemd service..."
# Check if running as root
if [[ $EUID -eq 0 ]]; then
@@ -13,8 +13,8 @@ if [[ $EUID -eq 0 ]]; then
fi
# Verify the service file exists
if [ ! -f "hive-mcp.service" ]; then
echo "❌ Service file 'hive-mcp.service' not found in current directory"
if [ ! -f "whoosh-mcp.service" ]; then
echo "❌ Service file 'whoosh-mcp.service' not found in current directory"
exit 1
fi
@@ -31,30 +31,30 @@ chmod 755 logs data
# Copy service file to systemd directory
echo "📄 Installing service file..."
sudo cp hive-mcp.service /etc/systemd/system/
sudo cp whoosh-mcp.service /etc/systemd/system/
# Reload systemd daemon
echo "🔄 Reloading systemd daemon..."
sudo systemctl daemon-reload
# Enable the service
echo "✅ Enabling Hive MCP service..."
sudo systemctl enable hive-mcp.service
echo "✅ Enabling WHOOSH MCP service..."
sudo systemctl enable whoosh-mcp.service
echo ""
echo "🎉 Hive MCP Server service installed successfully!"
echo "🎉 WHOOSH MCP Server service installed successfully!"
echo ""
echo "📋 Available commands:"
echo " sudo systemctl start hive-mcp # Start the service"
echo " sudo systemctl stop hive-mcp # Stop the service"
echo " sudo systemctl restart hive-mcp # Restart the service"
echo " sudo systemctl status hive-mcp # Check service status"
echo " sudo systemctl disable hive-mcp # Disable auto-start"
echo " journalctl -u hive-mcp -f # View live logs"
echo " sudo systemctl reload hive-mcp # Trigger agent discovery"
echo " sudo systemctl start whoosh-mcp # Start the service"
echo " sudo systemctl stop whoosh-mcp # Stop the service"
echo " sudo systemctl restart whoosh-mcp # Restart the service"
echo " sudo systemctl status whoosh-mcp # Check service status"
echo " sudo systemctl disable whoosh-mcp # Disable auto-start"
echo " journalctl -u whoosh-mcp -f # View live logs"
echo " sudo systemctl reload whoosh-mcp # Trigger agent discovery"
echo ""
echo "🚀 To start the service now, run:"
echo " sudo systemctl start hive-mcp"
echo " sudo systemctl start whoosh-mcp"
echo ""
echo "📊 To check the status, run:"
echo " sudo systemctl status hive-mcp"
echo " sudo systemctl status whoosh-mcp"

View File

@@ -1,11 +1,11 @@
{
"name": "hive-mcp-server",
"name": "whoosh-mcp-server",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "hive-mcp-server",
"name": "whoosh-mcp-server",
"version": "1.0.0",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.1.3",

View File

@@ -1,7 +1,7 @@
{
"name": "hive-mcp-server",
"name": "whoosh-mcp-server",
"version": "1.0.0",
"description": "MCP Server for Hive Distributed AI Orchestration Platform",
"description": "MCP Server for WHOOSH Distributed AI Orchestration Platform",
"type": "module",
"main": "dist/index.js",
"scripts": {

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
/**
* @fileoverview Hive MCP Server - Main Entry Point
* @fileoverview WHOOSH MCP Server - Main Entry Point
*
* The Hive MCP Server exposes the Hive Distributed AI Orchestration Platform
* The WHOOSH MCP Server exposes the WHOOSH Distributed AI Orchestration Platform
* via the Model Context Protocol (MCP), enabling AI assistants like Claude
* to directly orchestrate distributed development tasks across multiple agents.
*
* @author Hive Development Team
* @author WHOOSH Development Team
* @version 1.0.0
* @since 1.0.0
*
@@ -32,32 +32,32 @@ import {
ListToolsRequestSchema,
ReadResourceRequestSchema,
} from '@modelcontextprotocol/sdk/types.js';
import { HiveClient } from './hive-client.js';
import { HiveTools } from './hive-tools.js';
import { HiveResources } from './hive-resources.js';
import { WHOOSHClient } from './whoosh-client.js';
import { WHOOSHTools } from './whoosh-tools.js';
import { WHOOSHResources } from './whoosh-resources.js';
/**
* **Hive MCP Server**
* **WHOOSH MCP Server**
*
* Main server class that orchestrates the Model Context Protocol interface
* for the Hive Distributed AI Platform. Provides tools and resources for
* for the WHOOSH Distributed AI Platform. Provides tools and resources for
* AI assistants to manage distributed development workflows.
*
* @category Server Core
* @since 1.0.0
*/
class HiveMCPServer {
class WHOOSHMCPServer {
/** The MCP server instance handling protocol communication */
private server: Server;
/** Client for communicating with the Hive backend API */
private hiveClient: HiveClient;
/** Client for communicating with the WHOOSH backend API */
private whooshClient: WHOOSHClient;
/** Handler for MCP tools (agent operations, task management, etc.) */
private hiveTools: HiveTools;
private whooshTools: WHOOSHTools;
/** Handler for MCP resources (cluster state, agent status, etc.) */
private hiveResources: HiveResources;
private whooshResources: WHOOSHResources;
/** Timer for periodic agent auto-discovery (daemon mode only) */
private discoveryInterval?: NodeJS.Timeout;
@@ -66,21 +66,21 @@ class HiveMCPServer {
private isDaemonMode: boolean = false;
/**
* Creates a new Hive MCP Server instance
* Creates a new WHOOSH MCP Server instance
*
* Initializes the MCP server with tools and resources capabilities,
* sets up the Hive client connection, and configures request handlers.
* sets up the WHOOSH client connection, and configures request handlers.
*
* @example
* ```typescript
* const server = new HiveMCPServer();
* const server = new WHOOSHMCPServer();
* await server.start();
* ```
*/
constructor() {
this.server = new Server(
{
name: 'hive-mcp-server',
name: 'whoosh-mcp-server',
version: '1.0.0',
},
{
@@ -91,10 +91,10 @@ class HiveMCPServer {
}
);
// Initialize Hive client and handlers
this.hiveClient = new HiveClient();
this.hiveTools = new HiveTools(this.hiveClient);
this.hiveResources = new HiveResources(this.hiveClient);
// Initialize WHOOSH client and handlers
this.whooshClient = new WHOOSHClient();
this.whooshTools = new WHOOSHTools(this.whooshClient);
this.whooshResources = new WHOOSHResources(this.whooshClient);
this.setupHandlers();
}
@@ -103,35 +103,35 @@ class HiveMCPServer {
* Sets up MCP request handlers and system signal handlers
*
* Configures the server to handle:
* - Tool requests (list/execute Hive operations)
* - Tool requests (list/execute WHOOSH operations)
* - Resource requests (read cluster state)
* - System signals (graceful shutdown, agent discovery)
*
* @private
*/
private setupHandlers() {
// Tools handler - exposes Hive operations as MCP tools
// Tools handler - exposes WHOOSH operations as MCP tools
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: this.hiveTools.getAllTools(),
tools: this.whooshTools.getAllTools(),
};
});
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
const { name, arguments: args } = request.params;
return await this.hiveTools.executeTool(name, args || {});
return await this.whooshTools.executeTool(name, args || {});
});
// Resources handler - exposes Hive cluster state as MCP resources
// Resources handler - exposes WHOOSH cluster state as MCP resources
this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
return {
resources: await this.hiveResources.getAllResources(),
resources: await this.whooshResources.getAllResources(),
};
});
this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
const { uri } = request.params;
return await this.hiveResources.readResource(uri);
return await this.whooshResources.readResource(uri);
});
// Error handling
@@ -154,19 +154,19 @@ class HiveMCPServer {
}
/**
* Starts the Hive MCP Server
* Starts the WHOOSH MCP Server
*
* Performs startup sequence:
* 1. Tests connection to Hive backend
* 1. Tests connection to WHOOSH backend
* 2. Auto-discovers and registers agents
* 3. Sets up periodic discovery (daemon mode)
* 4. Starts MCP server on stdio or daemon mode
*
* @throws {Error} If connection to Hive backend fails
* @throws {Error} If connection to WHOOSH backend fails
*
* @example
* ```typescript
* const server = new HiveMCPServer();
* const server = new WHOOSHMCPServer();
* await server.start(); // Starts in stdio mode
* ```
*
@@ -177,7 +177,7 @@ class HiveMCPServer {
* ```
*/
async start() {
console.log('🐝 Starting Hive MCP Server...');
console.log('🐝 Starting WHOOSH MCP Server...');
// Check for daemon mode
this.isDaemonMode = process.argv.includes('--daemon');
@@ -185,12 +185,12 @@ class HiveMCPServer {
console.log('🔧 Running in daemon mode');
}
// Test connection to Hive backend
// Test connection to WHOOSH backend
try {
await this.hiveClient.testConnection();
console.log('✅ Connected to Hive backend successfully');
await this.whooshClient.testConnection();
console.log('✅ Connected to WHOOSH backend successfully');
} catch (error) {
console.error('❌ Failed to connect to Hive backend:', error);
console.error('❌ Failed to connect to WHOOSH backend:', error);
process.exit(1);
}
@@ -209,7 +209,7 @@ class HiveMCPServer {
}
if (this.isDaemonMode) {
console.log('🚀 Hive MCP Server running in daemon mode');
console.log('🚀 WHOOSH MCP Server running in daemon mode');
console.log('🔗 Monitoring cluster and auto-discovering agents...');
// Keep the process alive in daemon mode
@@ -220,7 +220,7 @@ class HiveMCPServer {
const transport = new StdioServerTransport();
await this.server.connect(transport);
console.log('🚀 Hive MCP Server running on stdio');
console.log('🚀 WHOOSH MCP Server running on stdio');
console.log('🔗 AI assistants can now orchestrate your distributed cluster!');
}
}
@@ -241,8 +241,8 @@ class HiveMCPServer {
}
private async autoDiscoverAgents() {
// Use the existing hive_bring_online functionality
const result = await this.hiveTools.executeTool('hive_bring_online', {
// Use the existing whoosh_bring_online functionality
const result = await this.whooshTools.executeTool('whoosh_bring_online', {
force_refresh: false,
subnet_scan: true
});
@@ -253,7 +253,7 @@ class HiveMCPServer {
}
private async shutdown() {
console.log('🛑 Shutting down Hive MCP Server...');
console.log('🛑 Shutting down WHOOSH MCP Server...');
if (this.discoveryInterval) {
clearInterval(this.discoveryInterval);
@@ -261,14 +261,14 @@ class HiveMCPServer {
}
await this.server.close();
console.log('✅ Hive MCP Server stopped');
console.log('✅ WHOOSH MCP Server stopped');
process.exit(0);
}
}
// Start the server
const server = new HiveMCPServer();
const server = new WHOOSHMCPServer();
server.start().catch((error) => {
console.error('Failed to start Hive MCP Server:', error);
console.error('Failed to start WHOOSH MCP Server:', error);
process.exit(1);
});

View File

@@ -1,13 +1,13 @@
/**
* Hive Client
* WHOOSH Client
*
* Handles communication with the Hive backend API
* Handles communication with the WHOOSH backend API
*/
import axios, { AxiosInstance } from 'axios';
import WebSocket from 'ws';
export interface HiveConfig {
export interface WHOOSHConfig {
baseUrl: string;
wsUrl: string;
timeout: number;
@@ -66,16 +66,16 @@ export interface ClusterStatus {
};
}
export class HiveClient {
export class WHOOSHClient {
private api: AxiosInstance;
private config: HiveConfig;
private config: WHOOSHConfig;
private wsConnection?: WebSocket;
constructor(config?: Partial<HiveConfig>) {
constructor(config?: Partial<WHOOSHConfig>) {
this.config = {
baseUrl: process.env.HIVE_API_URL || 'https://hive.home.deepblack.cloud/api',
wsUrl: process.env.HIVE_WS_URL || 'wss://hive.home.deepblack.cloud/socket.io',
timeout: parseInt(process.env.HIVE_TIMEOUT || '30000'),
baseUrl: process.env.WHOOSH_API_URL || 'https://whoosh.home.deepblack.cloud/api',
wsUrl: process.env.WHOOSH_WS_URL || 'wss://whoosh.home.deepblack.cloud/socket.io',
timeout: parseInt(process.env.WHOOSH_TIMEOUT || '30000'),
...config,
};
@@ -93,7 +93,7 @@ export class HiveClient {
const response = await this.api.get('/health');
return response.data.status === 'healthy' || response.status === 200;
} catch (error) {
throw new Error(`Failed to connect to Hive: ${error}`);
throw new Error(`Failed to connect to WHOOSH: ${error}`);
}
}
@@ -217,7 +217,7 @@ export class HiveClient {
const ws = new WebSocket(`${this.config.wsUrl}/ws/${topic}`);
ws.on('open', () => {
console.log(`🔗 Connected to Hive WebSocket (${topic})`);
console.log(`🔗 Connected to WHOOSH WebSocket (${topic})`);
this.wsConnection = ws;
resolve(ws);
});
@@ -230,7 +230,7 @@ export class HiveClient {
ws.on('message', (data) => {
try {
const message = JSON.parse(data.toString());
console.log('📨 Hive update:', message);
console.log('📨 WHOOSH update:', message);
} catch (error) {
console.error('Failed to parse WebSocket message:', error);
}

View File

@@ -1,65 +1,65 @@
/**
* Hive Resources
* WHOOSH Resources
*
* Defines MCP resources that expose Hive cluster state and real-time data
* Defines MCP resources that expose WHOOSH cluster state and real-time data
*/
import { Resource } from '@modelcontextprotocol/sdk/types.js';
import { HiveClient } from './hive-client.js';
import { WHOOSHClient } from './whoosh-client.js';
export class HiveResources {
private hiveClient: HiveClient;
export class WHOOSHResources {
private whooshClient: WHOOSHClient;
constructor(hiveClient: HiveClient) {
this.hiveClient = hiveClient;
constructor(whooshClient: WHOOSHClient) {
this.whooshClient = whooshClient;
}
async getAllResources(): Promise<Resource[]> {
return [
{
uri: 'hive://cluster/status',
uri: 'whoosh://cluster/status',
name: 'Cluster Status',
description: 'Real-time status of the entire Hive cluster including agents and tasks',
description: 'Real-time status of the entire WHOOSH cluster including agents and tasks',
mimeType: 'application/json',
},
{
uri: 'hive://agents/list',
uri: 'whoosh://agents/list',
name: 'Agent Registry',
description: 'List of all registered AI agents with their capabilities and current status',
mimeType: 'application/json',
},
{
uri: 'hive://tasks/active',
uri: 'whoosh://tasks/active',
name: 'Active Tasks',
description: 'Currently running and pending tasks across the cluster',
mimeType: 'application/json',
},
{
uri: 'hive://tasks/completed',
uri: 'whoosh://tasks/completed',
name: 'Completed Tasks',
description: 'Recently completed tasks with results and performance metrics',
mimeType: 'application/json',
},
{
uri: 'hive://workflows/available',
uri: 'whoosh://workflows/available',
name: 'Available Workflows',
description: 'All configured workflows ready for execution',
mimeType: 'application/json',
},
{
uri: 'hive://executions/recent',
uri: 'whoosh://executions/recent',
name: 'Recent Executions',
description: 'Recent workflow executions with status and results',
mimeType: 'application/json',
},
{
uri: 'hive://metrics/prometheus',
uri: 'whoosh://metrics/prometheus',
name: 'Cluster Metrics',
description: 'Prometheus metrics for monitoring cluster performance',
mimeType: 'text/plain',
},
{
uri: 'hive://capabilities/overview',
uri: 'whoosh://capabilities/overview',
name: 'Cluster Capabilities',
description: 'Overview of available agent types and their specializations',
mimeType: 'application/json',
@@ -70,28 +70,28 @@ export class HiveResources {
async readResource(uri: string): Promise<{ contents: Array<{ type: string; text?: string; data?: string; mimeType?: string }> }> {
try {
switch (uri) {
case 'hive://cluster/status':
case 'whoosh://cluster/status':
return await this.getClusterStatusResource();
case 'hive://agents/list':
case 'whoosh://agents/list':
return await this.getAgentsResource();
case 'hive://tasks/active':
case 'whoosh://tasks/active':
return await this.getActiveTasksResource();
case 'hive://tasks/completed':
case 'whoosh://tasks/completed':
return await this.getCompletedTasksResource();
case 'hive://workflows/available':
case 'whoosh://workflows/available':
return await this.getWorkflowsResource();
case 'hive://executions/recent':
case 'whoosh://executions/recent':
return await this.getExecutionsResource();
case 'hive://metrics/prometheus':
case 'whoosh://metrics/prometheus':
return await this.getMetricsResource();
case 'hive://capabilities/overview':
case 'whoosh://capabilities/overview':
return await this.getCapabilitiesResource();
default:
@@ -110,7 +110,7 @@ export class HiveResources {
}
private async getClusterStatusResource() {
const status = await this.hiveClient.getClusterStatus();
const status = await this.whooshClient.getClusterStatus();
return {
contents: [
@@ -124,7 +124,7 @@ export class HiveResources {
}
private async getAgentsResource() {
const agents = await this.hiveClient.getAgents();
const agents = await this.whooshClient.getAgents();
const agentData = {
total_agents: agents.length,
@@ -158,8 +158,8 @@ export class HiveResources {
}
private async getActiveTasksResource() {
const pendingTasks = await this.hiveClient.getTasks({ status: 'pending', limit: 50 });
const runningTasks = await this.hiveClient.getTasks({ status: 'in_progress', limit: 50 });
const pendingTasks = await this.whooshClient.getTasks({ status: 'pending', limit: 50 });
const runningTasks = await this.whooshClient.getTasks({ status: 'in_progress', limit: 50 });
const activeData = {
summary: {
@@ -184,8 +184,8 @@ export class HiveResources {
}
private async getCompletedTasksResource() {
const completedTasks = await this.hiveClient.getTasks({ status: 'completed', limit: 20 });
const failedTasks = await this.hiveClient.getTasks({ status: 'failed', limit: 10 });
const completedTasks = await this.whooshClient.getTasks({ status: 'completed', limit: 20 });
const failedTasks = await this.whooshClient.getTasks({ status: 'failed', limit: 10 });
const completedData = {
summary: {
@@ -212,7 +212,7 @@ export class HiveResources {
}
private async getWorkflowsResource() {
const workflows = await this.hiveClient.getWorkflows();
const workflows = await this.whooshClient.getWorkflows();
const workflowData = {
total_workflows: workflows.length,
@@ -238,7 +238,7 @@ export class HiveResources {
}
private async getExecutionsResource() {
const executions = await this.hiveClient.getExecutions();
const executions = await this.whooshClient.getExecutions();
const executionData = {
total_executions: executions.length,
@@ -267,7 +267,7 @@ export class HiveResources {
}
private async getMetricsResource() {
const metrics = await this.hiveClient.getMetrics();
const metrics = await this.whooshClient.getMetrics();
return {
contents: [
@@ -281,7 +281,7 @@ export class HiveResources {
}
private async getCapabilitiesResource() {
const agents = await this.hiveClient.getAgents();
const agents = await this.whooshClient.getAgents();
const capabilities = {
agent_specializations: {

View File

@@ -1,37 +1,37 @@
/**
* Hive Tools
* WHOOSH Tools
*
* Defines MCP tools that expose Hive operations to AI assistants
* Defines MCP tools that expose WHOOSH operations to AI assistants
*/
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { HiveClient, Agent, Task } from './hive-client.js';
import { WHOOSHClient, Agent, Task } from './whoosh-client.js';
import { v4 as uuidv4 } from 'uuid';
import { spawn } from 'child_process';
import { promisify } from 'util';
import * as path from 'path';
export class HiveTools {
private hiveClient: HiveClient;
export class WHOOSHTools {
private whooshClient: WHOOSHClient;
constructor(hiveClient: HiveClient) {
this.hiveClient = hiveClient;
constructor(whooshClient: WHOOSHClient) {
this.whooshClient = whooshClient;
}
getAllTools(): Tool[] {
return [
// Agent Management Tools
{
name: 'hive_get_agents',
description: 'Get all registered AI agents in the Hive cluster with their current status',
name: 'whoosh_get_agents',
description: 'Get all registered AI agents in the WHOOSH cluster with their current status',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_register_agent',
description: 'Register a new AI agent in the Hive cluster',
name: 'whoosh_register_agent',
description: 'Register a new AI agent in the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {
@@ -49,8 +49,8 @@ export class HiveTools {
},
},
{
name: 'hive_register_cli_agent',
description: 'Register a new CLI-based AI agent (e.g., Gemini CLI) in the Hive cluster',
name: 'whoosh_register_cli_agent',
description: 'Register a new CLI-based AI agent (e.g., Gemini CLI) in the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {
@@ -73,15 +73,15 @@ export class HiveTools {
},
},
{
name: 'hive_get_cli_agents',
description: 'Get all registered CLI agents in the Hive cluster',
name: 'whoosh_get_cli_agents',
description: 'Get all registered CLI agents in the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_register_predefined_cli_agents',
name: 'whoosh_register_predefined_cli_agents',
description: 'Register predefined CLI agents (walnut-gemini, ironwood-gemini) with verified configurations',
inputSchema: {
type: 'object',
@@ -91,8 +91,8 @@ export class HiveTools {
// Task Management Tools
{
name: 'hive_create_task',
description: 'Create and assign a development task to the Hive cluster',
name: 'whoosh_create_task',
description: 'Create and assign a development task to the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {
@@ -123,7 +123,7 @@ export class HiveTools {
},
},
{
name: 'hive_get_task',
name: 'whoosh_get_task',
description: 'Get details and status of a specific task',
inputSchema: {
type: 'object',
@@ -134,7 +134,7 @@ export class HiveTools {
},
},
{
name: 'hive_get_tasks',
name: 'whoosh_get_tasks',
description: 'Get list of tasks with optional filtering',
inputSchema: {
type: 'object',
@@ -152,15 +152,15 @@ export class HiveTools {
// Workflow Management Tools
{
name: 'hive_get_workflows',
description: 'Get all available workflows in the Hive platform',
name: 'whoosh_get_workflows',
description: 'Get all available workflows in the WHOOSH platform',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_create_workflow',
name: 'whoosh_create_workflow',
description: 'Create a new workflow for distributed task orchestration',
inputSchema: {
type: 'object',
@@ -186,7 +186,7 @@ export class HiveTools {
},
},
{
name: 'hive_execute_workflow',
name: 'whoosh_execute_workflow',
description: 'Execute a workflow with optional input parameters',
inputSchema: {
type: 'object',
@@ -204,23 +204,23 @@ export class HiveTools {
// Monitoring and Status Tools
{
name: 'hive_get_cluster_status',
description: 'Get comprehensive status of the entire Hive cluster',
name: 'whoosh_get_cluster_status',
description: 'Get comprehensive status of the entire WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_get_metrics',
description: 'Get Prometheus metrics from the Hive cluster',
name: 'whoosh_get_metrics',
description: 'Get Prometheus metrics from the WHOOSH cluster',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'hive_get_executions',
name: 'whoosh_get_executions',
description: 'Get workflow execution history and status',
inputSchema: {
type: 'object',
@@ -232,7 +232,7 @@ export class HiveTools {
// Coordination Tools
{
name: 'hive_coordinate_development',
name: 'whoosh_coordinate_development',
description: 'Coordinate a complex development task across multiple specialized agents',
inputSchema: {
type: 'object',
@@ -264,8 +264,8 @@ export class HiveTools {
// Cluster Management Tools
{
name: 'hive_bring_online',
description: 'Automatically discover and register all available Ollama agents on the network, bringing the entire Hive cluster online',
name: 'whoosh_bring_online',
description: 'Automatically discover and register all available Ollama agents on the network, bringing the entire WHOOSH cluster online',
inputSchema: {
type: 'object',
properties: {
@@ -289,58 +289,58 @@ export class HiveTools {
try {
switch (name) {
// Agent Management
case 'hive_get_agents':
case 'whoosh_get_agents':
return await this.getAgents();
case 'hive_register_agent':
case 'whoosh_register_agent':
return await this.registerAgent(args);
case 'hive_register_cli_agent':
case 'whoosh_register_cli_agent':
return await this.registerCliAgent(args);
case 'hive_get_cli_agents':
case 'whoosh_get_cli_agents':
return await this.getCliAgents();
case 'hive_register_predefined_cli_agents':
case 'whoosh_register_predefined_cli_agents':
return await this.registerPredefinedCliAgents();
// Task Management
case 'hive_create_task':
case 'whoosh_create_task':
return await this.createTask(args);
case 'hive_get_task':
case 'whoosh_get_task':
return await this.getTask(args.task_id);
case 'hive_get_tasks':
case 'whoosh_get_tasks':
return await this.getTasks(args);
// Workflow Management
case 'hive_get_workflows':
case 'whoosh_get_workflows':
return await this.getWorkflows();
case 'hive_create_workflow':
case 'whoosh_create_workflow':
return await this.createWorkflow(args);
case 'hive_execute_workflow':
case 'whoosh_execute_workflow':
return await this.executeWorkflow(args.workflow_id, args.inputs);
// Monitoring
case 'hive_get_cluster_status':
case 'whoosh_get_cluster_status':
return await this.getClusterStatus();
case 'hive_get_metrics':
case 'whoosh_get_metrics':
return await this.getMetrics();
case 'hive_get_executions':
case 'whoosh_get_executions':
return await this.getExecutions(args.workflow_id);
// Coordination
case 'hive_coordinate_development':
case 'whoosh_coordinate_development':
return await this.coordinateDevelopment(args);
// Cluster Management
case 'hive_bring_online':
return await this.bringHiveOnline(args);
case 'whoosh_bring_online':
return await this.bringWHOOSHOnline(args);
default:
throw new Error(`Unknown tool: ${name}`);
@@ -361,7 +361,7 @@ export class HiveTools {
// Tool Implementation Methods
private async getAgents() {
const agents = await this.hiveClient.getAgents();
const agents = await this.whooshClient.getAgents();
// Group agents by type
const ollamaAgents = agents.filter(agent => !agent.agent_type || agent.agent_type === 'ollama');
@@ -378,7 +378,7 @@ export class HiveTools {
` • Tasks: ${agent.current_tasks}/${agent.max_concurrent}\n`;
};
let text = `📋 **Hive Cluster Agents** (${agents.length} total)\n\n`;
let text = `📋 **WHOOSH Cluster Agents** (${agents.length} total)\n\n`;
if (ollamaAgents.length > 0) {
text += `🤖 **Ollama Agents** (${ollamaAgents.length}):\n`;
@@ -393,10 +393,10 @@ export class HiveTools {
if (agents.length === 0) {
text += 'No agents registered yet.\n\n';
text += '**Getting Started:**\n';
text += '• Use `hive_register_agent` for Ollama agents\n';
text += '• Use `hive_register_cli_agent` for CLI agents\n';
text += '• Use `hive_register_predefined_cli_agents` for quick CLI setup\n';
text += '• Use `hive_bring_online` for auto-discovery';
text += '• Use `whoosh_register_agent` for Ollama agents\n';
text += '• Use `whoosh_register_cli_agent` for CLI agents\n';
text += '• Use `whoosh_register_predefined_cli_agents` for quick CLI setup\n';
text += '• Use `whoosh_bring_online` for auto-discovery';
}
return {
@@ -410,12 +410,12 @@ export class HiveTools {
}
private async registerAgent(args: any) {
const result = await this.hiveClient.registerAgent(args);
const result = await this.whooshClient.registerAgent(args);
return {
content: [
{
type: 'text',
text: `✅ Successfully registered agent **${args.id}** in the Hive cluster!\n\n` +
text: `✅ Successfully registered agent **${args.id}** in the WHOOSH cluster!\n\n` +
`🤖 Agent Details:\n` +
`• ID: ${args.id}\n` +
`• Specialization: ${args.specialty}\n` +
@@ -437,7 +437,7 @@ export class HiveTools {
},
};
const task = await this.hiveClient.createTask(taskData);
const task = await this.whooshClient.createTask(taskData);
return {
content: [
@@ -457,7 +457,7 @@ export class HiveTools {
}
private async getTask(taskId: string) {
const task = await this.hiveClient.getTask(taskId);
const task = await this.whooshClient.getTask(taskId);
return {
content: [
@@ -477,13 +477,13 @@ export class HiveTools {
}
private async getTasks(args: any) {
const tasks = await this.hiveClient.getTasks(args);
const tasks = await this.whooshClient.getTasks(args);
return {
content: [
{
type: 'text',
text: `📋 Hive Tasks (${tasks.length} found):\n\n${tasks.length > 0
text: `📋 WHOOSH Tasks (${tasks.length} found):\n\n${tasks.length > 0
? tasks.map(task =>
`🎯 **${task.id}** (${task.type})\n` +
` • Status: ${task.status}\n` +
@@ -499,20 +499,20 @@ export class HiveTools {
}
private async getWorkflows() {
const workflows = await this.hiveClient.getWorkflows();
const workflows = await this.whooshClient.getWorkflows();
return {
content: [
{
type: 'text',
text: `🔄 Hive Workflows (${workflows.length} total):\n\n${workflows.length > 0
text: `🔄 WHOOSH Workflows (${workflows.length} total):\n\n${workflows.length > 0
? workflows.map(wf =>
`🔄 **${wf.name || wf.id}**\n` +
` • ID: ${wf.id}\n` +
` • Description: ${wf.description || 'No description'}\n` +
` • Status: ${wf.status || 'Unknown'}\n`
).join('\n')
: 'No workflows created yet. Use hive_create_workflow to create distributed workflows.'
: 'No workflows created yet. Use whoosh_create_workflow to create distributed workflows.'
}`,
},
],
@@ -520,7 +520,7 @@ export class HiveTools {
}
private async createWorkflow(args: any) {
const result = await this.hiveClient.createWorkflow(args);
const result = await this.whooshClient.createWorkflow(args);
return {
content: [
@@ -530,14 +530,14 @@ export class HiveTools {
`🔄 Workflow ID: ${result.workflow_id}\n` +
`📋 Description: ${args.description || 'No description provided'}\n` +
`🔧 Steps: ${args.steps.length} configured\n\n` +
`The workflow is ready for execution using hive_execute_workflow.`,
`The workflow is ready for execution using whoosh_execute_workflow.`,
},
],
};
}
private async executeWorkflow(workflowId: string, inputs?: any) {
const result = await this.hiveClient.executeWorkflow(workflowId, inputs);
const result = await this.whooshClient.executeWorkflow(workflowId, inputs);
return {
content: [
@@ -547,20 +547,20 @@ export class HiveTools {
`🔄 Workflow ID: ${workflowId}\n` +
`⚡ Execution ID: ${result.execution_id}\n` +
`📥 Inputs: ${inputs ? JSON.stringify(inputs, null, 2) : 'None'}\n\n` +
`Use hive_get_executions to monitor progress.`,
`Use whoosh_get_executions to monitor progress.`,
},
],
};
}
private async getClusterStatus() {
const status = await this.hiveClient.getClusterStatus();
const status = await this.whooshClient.getClusterStatus();
return {
content: [
{
type: 'text',
text: `🐝 **Hive Cluster Status**\n\n` +
text: `🐝 **WHOOSH Cluster Status**\n\n` +
`🟢 **System**: ${status.system.status} (v${status.system.version})\n` +
`⏱️ **Uptime**: ${Math.floor(status.system.uptime / 3600)}h ${Math.floor((status.system.uptime % 3600) / 60)}m\n\n` +
`🤖 **Agents**: ${status.agents.total} total\n` +
@@ -577,20 +577,20 @@ export class HiveTools {
}
private async getMetrics() {
const metrics = await this.hiveClient.getMetrics();
const metrics = await this.whooshClient.getMetrics();
return {
content: [
{
type: 'text',
text: `📊 **Hive Cluster Metrics**\n\n\`\`\`\n${metrics}\n\`\`\``,
text: `📊 **WHOOSH Cluster Metrics**\n\n\`\`\`\n${metrics}\n\`\`\``,
},
],
};
}
private async getExecutions(workflowId?: string) {
const executions = await this.hiveClient.getExecutions(workflowId);
const executions = await this.whooshClient.getExecutions(workflowId);
return {
content: [
@@ -629,7 +629,7 @@ export class HiveTools {
},
};
const task = await this.hiveClient.createTask(taskData);
const task = await this.whooshClient.createTask(taskData);
createdTasks.push(task);
}
@@ -650,12 +650,12 @@ export class HiveTools {
};
}
private async bringHiveOnline(args: any) {
private async bringWHOOSHOnline(args: any) {
const { force_refresh = false, subnet_scan = true } = args;
try {
// Get the path to the auto-discovery script
const scriptPath = path.resolve('/home/tony/AI/projects/hive/scripts/auto_discover_agents.py');
const scriptPath = path.resolve('/home/tony/AI/projects/whoosh/scripts/auto_discover_agents.py');
return new Promise((resolve, reject) => {
let output = '';
@@ -663,7 +663,7 @@ export class HiveTools {
// Execute the auto-discovery script
const child = spawn('python3', [scriptPath], {
cwd: '/home/tony/AI/projects/hive',
cwd: '/home/tony/AI/projects/whoosh',
stdio: 'pipe',
});
@@ -698,17 +698,17 @@ export class HiveTools {
content: [
{
type: 'text',
text: `🐝 **Hive Cluster Online!** 🚀\n\n` +
text: `🐝 **WHOOSH Cluster Online!** 🚀\n\n` +
`🔍 **Auto-Discovery Complete**\n` +
`• Discovered: ${discovered} agents\n` +
`• Registered: ${registered} agents\n` +
`• Failed: ${failed} agents\n\n` +
`🤖 **Active Agents:**\n${agentDetails.join('\n')}\n\n` +
`✅ **Status**: The Hive cluster is now fully operational and ready for distributed AI orchestration!\n\n` +
`✅ **Status**: The WHOOSH cluster is now fully operational and ready for distributed AI orchestration!\n\n` +
`🎯 **Next Steps:**\n` +
`• Use \`hive_get_cluster_status\` to view detailed status\n` +
`• Use \`hive_coordinate_development\` to start distributed tasks\n` +
`• Use \`hive_create_workflow\` to build complex workflows`,
`• Use \`whoosh_get_cluster_status\` to view detailed status\n` +
`• Use \`whoosh_coordinate_development\` to start distributed tasks\n` +
`• Use \`whoosh_create_workflow\` to build complex workflows`,
},
],
});
@@ -727,11 +727,11 @@ export class HiveTools {
content: [
{
type: 'text',
text: `❌ **Failed to bring Hive online**\n\n` +
text: `❌ **Failed to bring WHOOSH online**\n\n` +
`Error: ${error instanceof Error ? error.message : String(error)}\n\n` +
`Please ensure:\n` +
`• The Hive backend is running\n` +
`• The auto-discovery script exists at /home/tony/AI/projects/hive/scripts/auto_discover_agents.py\n` +
`• The WHOOSH backend is running\n` +
`• The auto-discovery script exists at /home/tony/AI/projects/whoosh/scripts/auto_discover_agents.py\n` +
`• Python3 is available and required dependencies are installed`,
},
],
@@ -742,7 +742,7 @@ export class HiveTools {
private async registerCliAgent(args: any) {
try {
const result = await this.hiveClient.registerCliAgent(args);
const result = await this.whooshClient.registerCliAgent(args);
return {
content: [
@@ -776,7 +776,7 @@ export class HiveTools {
`• Verify SSH connectivity to ${args.host}\n` +
`• Ensure Gemini CLI is installed and accessible\n` +
`• Check Node.js version ${args.node_version} is available\n` +
`• Confirm Hive backend is running and accessible`,
`• Confirm WHOOSH backend is running and accessible`,
},
],
isError: true,
@@ -786,7 +786,7 @@ export class HiveTools {
private async getCliAgents() {
try {
const cliAgents = await this.hiveClient.getCliAgents();
const cliAgents = await this.whooshClient.getCliAgents();
return {
content: [
@@ -804,8 +804,8 @@ export class HiveTools {
).join('\n')
: 'No CLI agents registered yet.\n\n' +
'**Getting Started:**\n' +
'• Use `hive_register_cli_agent` to register individual CLI agents\n' +
'• Use `hive_register_predefined_cli_agents` to register walnut-gemini and ironwood-gemini automatically'
'• Use `whoosh_register_cli_agent` to register individual CLI agents\n' +
'• Use `whoosh_register_predefined_cli_agents` to register walnut-gemini and ironwood-gemini automatically'
}`,
},
],
@@ -817,7 +817,7 @@ export class HiveTools {
type: 'text',
text: `❌ **Failed to get CLI agents**\n\n` +
`Error: ${error instanceof Error ? error.message : String(error)}\n\n` +
`Please ensure the Hive backend is running and accessible.`,
`Please ensure the WHOOSH backend is running and accessible.`,
},
],
isError: true,
@@ -827,7 +827,7 @@ export class HiveTools {
private async registerPredefinedCliAgents() {
try {
const result = await this.hiveClient.registerPredefinedCliAgents();
const result = await this.whooshClient.registerPredefinedCliAgents();
const successCount = result.results.filter((r: any) => r.status === 'success').length;
const existingCount = result.results.filter((r: any) => r.status === 'already_exists').length;
@@ -873,7 +873,7 @@ export class HiveTools {
`• Ensure WALNUT and IRONWOOD are accessible via SSH\n` +
`• Verify Gemini CLI is installed on both machines\n` +
`• Check that Node.js v22.14.0 (WALNUT) and v22.17.0 (IRONWOOD) are available\n` +
`• Confirm Hive backend is running with CLI agent support`,
`• Confirm WHOOSH backend is running with CLI agent support`,
},
],
isError: true,

View File

@@ -2,14 +2,14 @@
/**
* Simple MCP Server Test Suite
* Tests the core functionality of the Hive MCP server
* Tests the core functionality of the WHOOSH MCP server
*/
const { spawn } = require('child_process');
const https = require('https');
// Test configuration
const API_BASE = 'https://hive.home.deepblack.cloud/api';
const API_BASE = 'https://whoosh.home.deepblack.cloud/api';
const TEST_TIMEOUT = 30000;
// Colors for output
@@ -90,7 +90,7 @@ async function testAgentList() {
async function testMcpServer() {
return new Promise((resolve, reject) => {
const mcpProcess = spawn('node', ['dist/index.js'], {
cwd: '/home/tony/AI/projects/hive/mcp-server',
cwd: '/home/tony/AI/projects/whoosh/mcp-server',
stdio: 'pipe'
});
@@ -99,7 +99,7 @@ async function testMcpServer() {
mcpProcess.stdout.on('data', (data) => {
output += data.toString();
if (output.includes('Connected to Hive backend successfully') && !resolved) {
if (output.includes('Connected to WHOOSH backend successfully') && !resolved) {
resolved = true;
mcpProcess.kill();
resolve('✅ MCP server connects successfully');
@@ -126,7 +126,7 @@ async function testMcpServer() {
async function testSocketIO() {
return new Promise((resolve, reject) => {
const url = 'https://hive.home.deepblack.cloud/socket.io/?EIO=4&transport=polling';
const url = 'https://whoosh.home.deepblack.cloud/socket.io/?EIO=4&transport=polling';
https.get(url, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
@@ -143,7 +143,7 @@ async function testSocketIO() {
// Main test runner
async function runTests() {
log('\n🐝 Hive MCP Server Test Suite\n', colors.blue);
log('\n🐝 WHOOSH MCP Server Test Suite\n', colors.blue);
let passed = 0;
let failed = 0;
@@ -166,7 +166,7 @@ async function runTests() {
log(` Total: ${passed + failed}`, colors.blue);
if (failed === 0) {
log('\n🎉 All tests passed! Hive MCP system is operational.', colors.green);
log('\n🎉 All tests passed! WHOOSH MCP system is operational.', colors.green);
} else {
log('\n⚠ Some tests failed. Check the errors above.', colors.yellow);
}

View File

@@ -3,7 +3,7 @@
"entryPoints": ["src/index.ts"],
"entryPointStrategy": "expand",
"out": "docs",
"name": "Hive MCP Server Documentation",
"name": "WHOOSH MCP Server Documentation",
"theme": "default",
"readme": "README.md",
"includeVersion": true,
@@ -26,7 +26,7 @@
"searchInComments": true,
"searchInDocuments": true,
"cleanOutputDir": true,
"titleLink": "https://docs.hive.deepblack.cloud/mcp-server/",
"titleLink": "https://docs.whoosh.deepblack.cloud/mcp-server/",
"navigation": {
"includeCategories": true,
"includeGroups": true

View File

@@ -1,10 +1,10 @@
#!/bin/bash
# Hive MCP Server Management Script
# WHOOSH MCP Server Management Script
set -e
SERVICE_NAME="hive-mcp"
SERVICE_NAME="whoosh-mcp"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Colors for output
@@ -31,37 +31,37 @@ function error() {
}
function show_status() {
log "Checking Hive MCP Server status..."
log "Checking WHOOSH MCP Server status..."
sudo systemctl status $SERVICE_NAME --no-pager
}
function start_service() {
log "Starting Hive MCP Server..."
log "Starting WHOOSH MCP Server..."
sudo systemctl start $SERVICE_NAME
sleep 2
if sudo systemctl is-active --quiet $SERVICE_NAME; then
success "Hive MCP Server started successfully"
success "WHOOSH MCP Server started successfully"
else
error "Failed to start Hive MCP Server"
error "Failed to start WHOOSH MCP Server"
show_logs
exit 1
fi
}
function stop_service() {
log "Stopping Hive MCP Server..."
log "Stopping WHOOSH MCP Server..."
sudo systemctl stop $SERVICE_NAME
success "Hive MCP Server stopped"
success "WHOOSH MCP Server stopped"
}
function restart_service() {
log "Restarting Hive MCP Server..."
log "Restarting WHOOSH MCP Server..."
sudo systemctl restart $SERVICE_NAME
sleep 2
if sudo systemctl is-active --quiet $SERVICE_NAME; then
success "Hive MCP Server restarted successfully"
success "WHOOSH MCP Server restarted successfully"
else
error "Failed to restart Hive MCP Server"
error "Failed to restart WHOOSH MCP Server"
show_logs
exit 1
fi
@@ -84,7 +84,7 @@ function follow_logs() {
}
function test_connection() {
log "Testing connection to Hive backend..."
log "Testing connection to WHOOSH backend..."
cd "$SCRIPT_DIR"
if node test-mcp.cjs > /dev/null 2>&1; then
success "Connection test passed"
@@ -100,7 +100,7 @@ function discover_agents() {
reload_service
sleep 3
log "Current registered agents:"
curl -s https://hive.home.deepblack.cloud/api/agents | jq '.agents[] | {id: .id, model: .model, specialty: .specialty}' 2>/dev/null || {
curl -s https://whoosh.home.deepblack.cloud/api/agents | jq '.agents[] | {id: .id, model: .model, specialty: .specialty}' 2>/dev/null || {
warning "Could not fetch agent list - API may be unreachable"
}
}
@@ -117,16 +117,16 @@ function install_service() {
}
function uninstall_service() {
log "Uninstalling Hive MCP Server service..."
log "Uninstalling WHOOSH MCP Server service..."
sudo systemctl stop $SERVICE_NAME 2>/dev/null || true
sudo systemctl disable $SERVICE_NAME 2>/dev/null || true
sudo rm -f /etc/systemd/system/$SERVICE_NAME.service
sudo systemctl daemon-reload
success "Hive MCP Server service uninstalled"
success "WHOOSH MCP Server service uninstalled"
}
function show_help() {
echo "🐝 Hive MCP Server Management Script"
echo "🐝 WHOOSH MCP Server Management Script"
echo ""
echo "Usage: $0 [COMMAND]"
echo ""
@@ -140,7 +140,7 @@ function show_help() {
echo " status Show service status"
echo " logs Show recent logs"
echo " follow Follow live logs"
echo " test Test connection to Hive backend"
echo " test Test connection to WHOOSH backend"
echo " discover Manually trigger agent discovery"
echo " help Show this help message"
echo ""