Skip to main content
Glama
README.md
<div align="center">

# πŸš€ Skills MCP Hudu

### Complete Hudu MCP Server with 55 Tools, Markdown Output, MCP Resources, and Multi-Tenant Support

[![MCP Protocol](https://img.shields.io/badge/MCP-2024--11--05-blue)](https://modelcontextprotocol.io/)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.9+-blue)](https://www.typescriptlang.org/)
[![Node.js](https://img.shields.io/badge/Node.js-18+-green)](https://nodejs.org/)
[![Express](https://img.shields.io/badge/Express-4.21+-teal)](https://expressjs.com/)
[![Transport](https://img.shields.io/badge/Transport-HTTP%20Only-orange)](https://modelcontextprotocol.io/docs/concepts/transports)
[![License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)
[![Status](https://img.shields.io/badge/Status-Production%20Ready-brightgreen)](https://github.com/DevSkillsIT/Skills-MCP-Hudu)

**Connect Claude Code, Gemini CLI, ChatGPT, VS Code Copilot, and Cursor to your Hudu instance**

[Features](#-key-features) β€’ [Installation](#-installation) β€’ [55 Tools](#-55-tools) β€’ [Quick Start](#-quick-start) β€’ [Support](#-support)

</div>

---

## πŸ“– About The Project

**Skills MCP Hudu** is a production-ready Model Context Protocol (MCP) server that provides complete integration with [Hudu](https://www.usehudu.com/) IT documentation platform. Built by **Skills IT**, a Managed Service Provider (MSP) from Brazil, this MCP enables AI assistants to seamlessly interact with your IT documentation, passwords, assets, and procedures.

### 🌟 Why This MCP?

Built specifically for **MSPs and IT teams** who need AI-powered access to their Hudu documentation:

| Feature | Description |
|---------|-------------|
| **55 Tools** | Complete Hudu API coverage, including labels and flags |
| **Markdown Output** | All responses formatted as Markdown tables (not raw JSON) |
| **MCP Resources** | 6 native `hudu://` URIs for direct data access |
| **Tool Annotations** | `readOnlyHint`, `destructiveHint`, `openWorldHint` on all tools |
| **IT Documentation** | Full company, asset, article, and knowledge base management |
| **Password Management** | Secure credential access with masked output |
| **Expiration Tracking** | Monitor domain, SSL, warranty, and license expirations |
| **Website Monitoring** | DNS, SSL, WHOIS monitoring management |
| **Network Infrastructure** | Networks, VLANs, IP addresses, rack storage |
| **Activity Audit Logs** | Full audit trail with user, resource, and action filters |
| **Asset Layout Templates** | Manage custom field structures for asset types |
| **Relations & Magic Dash** | Entity relationships and dashboard widgets |
| **Auto-Pagination** | `fetchAll` retrieves up to 500 records across pages |
| **HTTP-Only Transport** | Modern streamable HTTP (no STDIO) |
| **Multi-Tenant Ready** | Company filtering for MSP environments |
| **Pre-built Prompts** | Security audits and asset reports |

---

## 🎯 Key Features

### 1. πŸ“š Complete IT Documentation
Manage companies, assets, articles, and knowledge base with AI assistance.

### 2. πŸ” Secure Password Management
Access and manage credentials safely through AI with proper authentication.

### 3. πŸ”„ Procedures & Workflows
Create, update, and manage procedures and tasks with AI-driven automation.

### 4. 🌐 Network Infrastructure
Complete network documentation including VLANs, IP addresses, and rack storage.

### 5. πŸ” Global Search
Powerful search across all Hudu resources with single queries.

### 6. πŸ“Š Markdown Formatted Output
All tool responses return human-readable Markdown tables instead of raw JSON, powered by a centralized response formatter interceptor.

### 7. πŸ“… Expiration Tracking & Website Monitoring
Track domain, SSL certificate, warranty, and license expirations. Monitor website DNS, SSL, and WHOIS status.

### 8. πŸ“‹ Activity Audit Logs
Complete audit trail with filters by user, resource type, action, and date range.

### 9. 🏒 Multi-Tenant Support
Company-level filtering for MSPs managing multiple clients.

---

> πŸ’Ό **Need Help with Hudu or AI?**
>
> **Skills IT - Technology Solutions** specializes in IT infrastructure and has deep expertise in **Hudu IT Documentation Platform**. Our team has expertise in **Artificial Intelligence** and **Model Context Protocol (MCP)**, offering complete solutions for automation and system integration.
>
> **Our Services:**
> - βœ… Hudu consulting and implementation
> - βœ… Custom MCP development for your infrastructure
> - βœ… AI integration with corporate systems
> - βœ… IT documentation automation
> - βœ… Specialized training and support
>
> πŸ“ž **WhatsApp/Phone:** +55 63 3224-4925 - Brazil πŸ‡§πŸ‡·
> 🌐 **Website:** [skillsit.com.br](https://skillsit.com.br)
> πŸ“§ **Email:** contato@skillsit.com.br
>
> *"Transforming infrastructure into intelligence"*

---

## πŸ—οΈ Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Claude / ChatGPT / Gemini / Copilot / Cursor            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β”‚ MCP Protocol (HTTP JSON-RPC)
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Skills MCP Hudu Server                        β”‚
β”‚                        localhost:3100                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚                      Express + MCP SDK                     β”‚ β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚ β”‚
β”‚  β”‚  β”‚Companies β”‚ β”‚  Assets  β”‚ β”‚Passwords β”‚ β”‚ Articles β”‚      β”‚ β”‚
β”‚  β”‚  β”‚          β”‚ β”‚          β”‚ β”‚          β”‚ β”‚          β”‚      β”‚ β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚ β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚ β”‚
β”‚  β”‚  β”‚ Networks β”‚ β”‚Proceduresβ”‚ β”‚  Racks   β”‚ β”‚  Search  β”‚      β”‚ β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β”‚ Hudu REST API
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Hudu Platform                             β”‚
β”‚                  https://your-hudu-instance.com                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

---

## πŸš€ Quick Start

### Prerequisites

- **Node.js 18+** or Docker
- **Hudu instance** with API access
- **API Key** from Hudu Admin panel

### Installation

#### Option 1: Docker (Recommended)

```bash
# Clone the repository
git clone https://github.com/DevSkillsIT/Skills-MCP-Hudu.git
cd Skills-MCP-Hudu

# Configure environment
cp .env.example .env
nano .env  # Edit with your Hudu credentials

# Start with Docker Compose
docker-compose -f docker-compose.existing-traefik.yml up -d

# Verify it's running
curl http://localhost:3100/health
```

#### Option 2: Node.js

```bash
# Clone and install
git clone https://github.com/DevSkillsIT/Skills-MCP-Hudu.git
cd Skills-MCP-Hudu
npm install

# Configure
cp .env.example .env
nano .env  # Edit with your Hudu credentials

# Build and run
npm run build
npm start

# Or development mode with hot reload
npm run dev
```

### Hudu Configuration

**1. Get your Hudu API Key:**
- Log in to Hudu
- Navigate to **Admin** β†’ **API Keys**
- Click **Generate New API Key**
- Copy the key immediately (shown only once!)

### Environment Setup

```bash
# Required Settings
HUDU_BASE_URL=https://your-company.huducloud.com
HUDU_API_KEY=your-api-key-here

# MCP Server Configuration
MCP_SERVER_PORT=3100
MCP_BEARER_TOKEN=your-secure-token  # Optional but recommended

# Optional Settings
HUDU_TIMEOUT=30000
HUDU_ALLOWED_COMPANY_IDS=ALL  # Or specific company IDs: 123,456
LOG_LEVEL=info
```

### Connect to Claude Code

```bash
# Add MCP server
claude mcp add --transport http hudu http://localhost:3100/mcp
```

**Alternative: Edit `~/.claude/settings.json`:**

```json
{
  "mcpServers": {
    "hudu": {
      "type": "streamable-http",
      "url": "http://localhost:3100/mcp"
    }
  }
}
```

### Connect to Gemini CLI

Edit `~/.gemini/settings.json`:

```json
{
  "mcpServers": {
    "hudu": {
      "httpUrl": "http://localhost:3100/mcp",
      "timeout": 30000
    }
  }
}
```

> **Note:** Gemini CLI uses `httpUrl` instead of `url`.

### Test Connection

```bash
# Health check
curl http://localhost:3100/health

# Server info
curl http://localhost:3100/

# List available tools (requires valid setup)
curl -X POST http://localhost:3100/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

---

## 🧰 55 Tools

All tools follow a standardized naming convention optimized for ToolRAG systems:
- **Prefix:** `hudu_` (server namespace)
- **Verbs:** `manage` (CRUD) or `search` (read-only queries)
- **Descriptions:** Portuguese (pt-BR), noun-first for embedding similarity, 250-350 chars
- **Annotations:** All tools have MCP annotations (`readOnlyHint`, `destructiveHint`, `openWorldHint`)
- **Output:** Markdown formatted tables and detail views (not raw JSON)

### πŸ“Š Companies (2 tools)

| Tool | Description |
|------|-------------|
| `hudu_manage_company_information` | Full CRUD operations (create, get, update, archive, unarchive) |
| `hudu_search_company_information` | List and search companies with pagination |

### πŸ’» IT Assets (2 tools)

| Tool | Description |
|------|-------------|
| `hudu_manage_it_asset_inventory` | Complete asset lifecycle management |
| `hudu_search_it_asset_inventory` | Search and filter assets by company, type, name |

### πŸ“ Articles & Knowledge Base (2 tools)

| Tool | Description |
|------|-------------|
| `hudu_manage_knowledge_articles` | Create, update, delete articles |
| `hudu_search_knowledge_articles` | Search articles by company, folder, name |

### πŸ” Passwords & Credentials (2 tools)

| Tool | Description |
|------|-------------|
| `hudu_manage_password_credentials` | Secure password management (CRUD operations) |
| `hudu_search_password_credentials` | Search credentials by company, name |

### βœ… Procedures & Checklists (4 tools)

| Tool | Description |
|------|-------------|
| `hudu_manage_workflow_procedures` | Manage runbooks and procedures |
| `hudu_search_workflow_procedures` | Search procedures by company, name |
| `hudu_manage_procedure_task_items` | Individual task management |
| `hudu_search_procedure_task_items` | List tasks with filters |

### πŸ“ Organization (2 tools)

| Tool | Description |
|------|-------------|
| `hudu_manage_kb_article_folders` | Document folder management |
| `hudu_search_kb_article_folders` | List folders by company, name |

### 🌐 Network Infrastructure (8 tools)

| Tool | Description |
|------|-------------|
| `hudu_manage_network_documentation` | Network documentation management |
| `hudu_search_network_documentation` | Search networks by company |
| `hudu_manage_network_vlan_records` | VLAN management |
| `hudu_search_network_vlan_records` | List VLANs with filters |
| `hudu_manage_network_vlan_zones` | Network zone organization |
| `hudu_search_network_vlan_zones` | Search zones by company |
| `hudu_manage_ip_address_records` | IP address tracking and documentation |
| `hudu_search_ip_address_records` | Search IP addresses by network, company |

### πŸ“¦ Data Center & Storage (8 tools)

| Tool | Description |
|------|-------------|
| `hudu_manage_rack_storage_locations` | Rack documentation management |
| `hudu_search_rack_storage_locations` | List racks by company, location |
| `hudu_manage_rack_storage_items` | Equipment in racks |
| `hudu_search_rack_storage_items` | Search rack items |
| `hudu_manage_file_upload_records` | File attachment management |
| `hudu_search_file_upload_records` | Search uploaded files |
| `hudu_manage_public_photo_gallery` | Image management |
| `hudu_search_public_photo_gallery` | List photos with filters |

### πŸ“… Expiration Tracking (1 tool) β€” *NEW*

| Tool | Description |
|------|-------------|
| `hudu_search_expiration_tracking` | Track domain, SSL, warranty, and license expirations |

### 🌐 Website Monitoring (2 tools) β€” *NEW*

| Tool | Description |
|------|-------------|
| `hudu_manage_website_monitoring` | CRUD for monitored websites (DNS, SSL, WHOIS) |
| `hudu_search_website_monitoring` | Search monitored websites by company, name |

### πŸ—οΈ Asset Layout Templates (2 tools) β€” *NEW*

| Tool | Description |
|------|-------------|
| `hudu_manage_asset_layout_templates` | Create and update asset field templates (no delete) |
| `hudu_search_asset_layout_templates` | Search asset layout templates |

### πŸ“‹ Activity Audit Logs (1 tool) β€” *NEW*

| Tool | Description |
|------|-------------|
| `hudu_search_activity_audit_logs` | Audit trail with user, resource, action, and date filters |

### πŸ”— Entity Relations (2 tools) β€” *NEW*

| Tool | Description |
|------|-------------|
| `hudu_manage_entity_relations` | CRUD for relationships between entities (Asset→Company, etc.) |
| `hudu_search_entity_relations` | Search entity relationships |

### πŸ“Š Magic Dash Widgets (2 tools) β€” *NEW*

| Tool | Description |
|------|-------------|
| `hudu_manage_dashboard_widgets` | CRUD for Magic Dash dashboard widgets |
| `hudu_search_dashboard_widgets` | Search dashboard widgets by company |

### πŸ” Utilities (3 tools)

| Tool | Description |
|------|-------------|
| `hudu_search_all_resource_types` | **Global search** across ALL resources |
| `hudu_navigate_to_resource_by_name` | Quick jump to companies and resources by name |
| `hudu_admin_instance_operations` | API info, activity logs, exports, expirations |

---

## πŸ’‘ Usage Examples

> **Tip:** Mention "Hudu" at the beginning of prompts for clarity with multiple MCPs.

### IT Documentation Management

```
Hudu, list all companies
Hudu, create a new company "Acme Corporation" with website acme.com
Hudu, show me all assets for company "Acme Corporation"
Hudu, search for articles about "firewall configuration"
```

### Password & Credential Management

```
Hudu, list all passwords for company "Acme Corporation"
Hudu, create a new password entry for "Office WiFi"
Hudu, search credentials containing "admin"
```

### Procedures & Workflows

```
Hudu, list all procedures
Hudu, create a new procedure "Server Backup Checklist"
Hudu, show tasks for procedure ID 123
```

### Network Documentation

```
Hudu, list all networks
Hudu, show VLANs for company "Acme Corporation"
Hudu, list IP addresses in network ID 456
Hudu, document rack storage in datacenter
```

### Expiration Tracking & Website Monitoring

```
Hudu, show all expiring SSL certificates
Hudu, list domain expirations for company "Acme Corporation"
Hudu, show monitored websites and their DNS/SSL status
Hudu, add website monitoring for https://acme.com
```

### Audit & Activity Logs

```
Hudu, show recent activity logs for user admin@acme.com
Hudu, list all changes to assets in the last week
Hudu, who modified company "Acme Corporation" recently?
```

### Dashboard & Relations

```
Hudu, list all Magic Dash widgets for company "Acme"
Hudu, create a dashboard widget showing backup status
Hudu, show relations between asset ID 100 and other entities
```

### Global Search

```
Hudu, search for "firewall" across all resources
Hudu, find anything related to "backup server"
```

---

## πŸ” MCP Resources

Direct data access through native MCP resource URIs. All resources return Markdown-formatted content.

| URI | Name | Description |
|-----|------|-------------|
| `hudu://companies` | Empresas Hudu | Companies, clients, and organizations β€” full list with name, type, address, and status |
| `hudu://companies/{id}` | Empresa Hudu por ID | Complete details for a specific company β€” address, phone, notes, and registration info |
| `hudu://assets` | Ativos de TI Hudu | IT assets, equipment, and devices β€” full inventory with model, serial, and custom fields |
| `hudu://assets/{id}` | Ativo Hudu por ID | Complete details for a specific IT asset β€” custom fields, company, and layout info |
| `hudu://articles` | Artigos KB Hudu | Knowledge base articles and documents β€” list with title, company, and publication status |
| `hudu://articles/{id}` | Artigo KB Hudu por ID | Complete article content rendered as clean Markdown (HTML stripped) |

**Example usage in Claude Code:**

```
Show me the contents of hudu://companies
Read hudu://assets/42
What does hudu://articles/15 contain?
```

---

## πŸ“‹ MCP Prompts

Pre-configured prompts for common workflows:

### `hudu_security_audit`
Generate comprehensive security audit reports across your Hudu instance.

### `hudu_asset_report`
Create detailed IT asset inventory reports with statistics.

**Usage:**
```
Run the hudu_security_audit prompt for our infrastructure
```

---

## βš™οΈ Configuration

### Environment Variables

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `HUDU_BASE_URL` | βœ… Yes | - | Your Hudu instance URL |
| `HUDU_API_KEY` | βœ… Yes | - | Hudu API key |
| `MCP_SERVER_PORT` | No | 3100 | HTTP server port |
| `MCP_BEARER_TOKEN` | No | - | Bearer token for authentication (recommended) |
| `HUDU_TIMEOUT` | No | 30000 | API timeout in milliseconds |
| `HUDU_ALLOWED_COMPANY_IDS` | No | ALL | Company filtering: ALL or comma-separated IDs |
| `LOG_LEVEL` | No | info | Logging level: debug, info, warn, error |

### Multi-Tenant Configuration (MSPs)

Restrict access to specific companies:

```bash
# Access all companies (default)
HUDU_ALLOWED_COMPANY_IDS=ALL

# Access only company ID 123
HUDU_ALLOWED_COMPANY_IDS=123

# Access multiple companies
HUDU_ALLOWED_COMPANY_IDS=123,456,789
```

### Endpoints

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/` | GET | Server information and version |
| `/health` | GET | Health check (liveness probe) |
| `/mcp` | POST | MCP JSON-RPC endpoint |

---

## πŸ”’ Security

### Best Practices

- βœ… **Store API keys in `.env` file**, never in code
- βœ… **Use HTTPS in production** (reverse proxy with SSL/TLS)
- βœ… **Set `MCP_BEARER_TOKEN`** for HTTP authentication
- βœ… **Restrict network access** to trusted sources only
- βœ… **Rotate API keys periodically**
- βœ… **Use read-only API keys** when write access isn't needed
- βœ… **Enable company filtering** for multi-tenant environments

### Rate Limiting

Built-in rate limiting protects your Hudu instance:
- **Default:** 1000 requests per IP per 15 minutes
- Configurable via environment variables
- Automatic backoff and retry

### CORS Configuration

CORS is pre-configured for secure local network access:
- `localhost` and `127.0.0.1`
- Private network ranges (10.x.x.x, 172.16.x.x, 192.168.x.x)
- Custom origins via `MCP_ALLOWED_ORIGINS`

---

## 🐳 Docker Deployment

### Docker Compose (Recommended)

```yaml
version: '3.8'

services:
  hudu-mcp:
    build: .
    container_name: skills-mcp-hudu
    restart: unless-stopped
    ports:
      - "3100:3100"
    environment:
      - HUDU_BASE_URL=${HUDU_BASE_URL}
      - HUDU_API_KEY=${HUDU_API_KEY}
      - MCP_SERVER_PORT=3100
      - MCP_BEARER_TOKEN=${MCP_BEARER_TOKEN}
      - HUDU_TIMEOUT=30000
      - LOG_LEVEL=info
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3100/health"]
      interval: 30s
      timeout: 10s
      retries: 3
```

### Docker Commands

```bash
# Build and start
docker-compose -f docker-compose.existing-traefik.yml up -d --build

# View logs
docker-compose -f docker-compose.existing-traefik.yml logs -f hudu-mcp

# Stop
docker-compose -f docker-compose.existing-traefik.yml down

# Rebuild without cache
docker-compose build --no-cache

# Check status
docker-compose ps
```

---

## πŸ› Troubleshooting

### Common Issues

| Issue | Cause | Solution |
|-------|-------|----------|
| `Connection refused` | Server not running | Check Docker/Node process status |
| `401 Unauthorized` | Invalid API key | Verify `HUDU_API_KEY` in `.env` |
| `403 Forbidden` | Insufficient permissions | Check API key permissions in Hudu |
| `ECONNREFUSED` | Can't reach Hudu | Verify `HUDU_BASE_URL` and network connectivity |
| `Rate limit exceeded` | Too many requests | Wait 15 minutes or adjust rate limits |
| `ENOTFOUND` | DNS resolution failed | Check Hudu URL spelling and DNS |

### Debug Mode

Enable detailed logging:

```bash
# .env
LOG_LEVEL=debug
```

### Logs

**Docker:**
```bash
docker-compose -f docker-compose.existing-traefik.yml logs -f hudu-mcp
```

**Node.js:**
```bash
# Logs are written to stdout/stderr
npm start 2>&1 | tee hudu-mcp.log
```

**PM2:**
```bash
pm2 logs hudu-mcp
```

---

## πŸ§ͺ Testing & Development

### Development Setup

```bash
# Clone repository
git clone https://github.com/DevSkillsIT/Skills-MCP-Hudu.git
cd Skills-MCP-Hudu

# Install dependencies
npm install

# Start development server (hot reload)
npm run dev

# Run linting
npm run lint

# Type checking
npm run type-check

# Build for production
npm run build
```

### Testing Commands

```bash
# Run all tests (581 tests, 43 suites)
npm test

# Run with verbose output
NODE_OPTIONS='--experimental-vm-modules' npx jest --verbose

# Type checking
npm run type-check

# Lint code
npm run lint

# Build project
npm run build
```

### Test Coverage

| Suite | Tests | Description |
|-------|-------|-------------|
| html-stripper | 25 | HTML stripping, truncation, Markdown escaping |
| markdown formatters | 30 | All 29 formatters + pagination helpers |
| response-formatter | 13 | Global interceptor for all 55 tools |
| tools-registry | 8 | Tool count, registration, naming conventions |
| annotations | 7 | readOnlyHint, destructiveHint, openWorldHint compliance |
| expirations | 8 | Expiration tracking executor with filters |
| websites | 17 | Website CRUD + query with validation |
| asset-layouts | 14 | Layout CRUD (no delete) + query |
| activity-logs | 9 | Audit log filters and error handling |
| relations | 17 | Relation CRUD + query with validation |
| magic-dash | 17 | Dashboard widget CRUD + query |
| resources | 13 | MCP Resources URI parsing and data retrieval |

---

## πŸ“ Project Structure

```
Skills-MCP-Hudu/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts              # Entry point
β”‚   β”œβ”€β”€ server.ts             # MCP HTTP server + instructions + resource handlers
β”‚   β”œβ”€β”€ hudu-client.ts        # Hudu API client (941 lines, all endpoints + fetchAll)
β”‚   β”œβ”€β”€ resources.ts          # MCP Resources handler (6 hudu:// URIs) β€” NEW
β”‚   β”œβ”€β”€ types.ts              # TypeScript definitions + HuduPagedResponse<T>
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── html-stripper.ts  # HTML cleanup: stripHtml, truncate, escapeMarkdown β€” NEW
β”‚   β”œβ”€β”€ formatters/
β”‚   β”‚   β”œβ”€β”€ markdown.ts       # 29 Markdown formatters for all entity types β€” NEW
β”‚   β”‚   └── response-formatter.ts  # Global interceptor: Markdown for all 55 tools
β”‚   └── tools/
β”‚       β”œβ”€β”€ working-index.ts  # Primary tool registry (55 tools)
β”‚       β”œβ”€β”€ base.ts           # Response helpers
β”‚       β”œβ”€β”€ schema-utils.ts   # Shared schemas and properties
β”‚       β”œβ”€β”€ companies.ts      # Company management (2 tools)
β”‚       β”œβ”€β”€ assets.ts         # Asset inventory (2 tools)
β”‚       β”œβ”€β”€ articles.ts       # Knowledge base articles (2 tools)
β”‚       β”œβ”€β”€ passwords.ts      # Password vault (2 tools)
β”‚       β”œβ”€β”€ procedures.ts     # Procedures and tasks (4 tools)
β”‚       β”œβ”€β”€ folders.ts        # Folder organization (2 tools)
β”‚       β”œβ”€β”€ networks.ts       # Networks, VLANs, IPs (8 tools)
β”‚       β”œβ”€β”€ storage.ts        # Uploads, racks, photos (8 tools)
β”‚       β”œβ”€β”€ expirations.ts    # Expiration tracking (1 tool) β€” NEW
β”‚       β”œβ”€β”€ websites.ts       # Website monitoring (2 tools) β€” NEW
β”‚       β”œβ”€β”€ asset-layouts.ts  # Asset layout templates (2 tools) β€” NEW
β”‚       β”œβ”€β”€ activity-logs.ts  # Activity audit logs (1 tool) β€” NEW
β”‚       β”œβ”€β”€ relations.ts      # Entity relations (2 tools) β€” NEW
β”‚       β”œβ”€β”€ magic-dash.ts     # Dashboard widgets (2 tools) β€” NEW
β”‚       β”œβ”€β”€ admin.ts          # Instance administration (1 tool)
β”‚       β”œβ”€β”€ search.ts         # Global unified search (1 tool)
β”‚       └── navigation.ts     # Quick navigation (1 tool)
β”œβ”€β”€ src/__tests__/            # 581 tests across 43 suites
β”‚   β”œβ”€β”€ utils/                # html-stripper tests
β”‚   β”œβ”€β”€ formatters/           # markdown + response-formatter tests
β”‚   β”œβ”€β”€ tools/                # Tool executor tests (6 files)
β”‚   β”œβ”€β”€ integration/          # Registry + annotation compliance tests
β”‚   └── resources.test.ts     # MCP Resources tests
β”œβ”€β”€ dist/                     # Compiled JavaScript (generated)
β”œβ”€β”€ jest.config.ts            # Jest configuration (ESM + ts-jest) β€” NEW
β”œβ”€β”€ tsconfig.test.json        # TypeScript config for tests β€” NEW
β”œβ”€β”€ Hudu.json                 # OpenAPI spec β€” OUTDATED, see Hudu.json.README.md
β”œβ”€β”€ Dockerfile                # Single-stage build, non-root runtime
β”œβ”€β”€ docker-compose.existing-traefik.yml  # Compose (Traefik existente)
β”œβ”€β”€ package.json              # Node.js dependencies
β”œβ”€β”€ tsconfig.json             # TypeScript configuration
β”œβ”€β”€ .env.example              # Environment template
β”œβ”€β”€ .gitignore                # Git ignore rules
β”œβ”€β”€ LICENSE                   # MIT License
└── README.md                 # This file
```

---

## 🀝 Contributing

We welcome contributions! Here's how to get involved:

1. **Fork** the repository
2. **Create** your feature branch: `git checkout -b feature/AmazingFeature`
3. **Commit** your changes: `git commit -m 'feat: add amazing feature'`
4. **Push** to branch: `git push origin feature/AmazingFeature`
5. **Open** a Pull Request

### Commit Standards

We follow [Conventional Commits](https://www.conventionalcommits.org/):

```
feat: add new feature
fix: correct bug
docs: update documentation
refactor: improve code structure
test: add tests
chore: update dependencies
style: formatting changes
perf: performance improvements
```

### Development Guidelines

- Write clean, documented TypeScript code
- Follow existing code style and patterns
- Add tests for new features
- Update documentation as needed
- Test with Claude Code before submitting PR

---

## πŸ“š Useful Links

- [Hudu Official Website](https://www.usehudu.com/) - IT documentation platform
- [Hudu API Documentation](https://www.usehudu.com/docs/api) - REST API documentation
- [MCP Specification](https://modelcontextprotocol.io/) - Model Context Protocol
- [Skills IT Website](https://skillsit.com.br/) - Our company
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) - Official SDK

---

## πŸ“ž Support

### Bug Reports
Found a bug? Please [open an issue](https://github.com/DevSkillsIT/Skills-MCP-Hudu/issues) with:
- Description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Node.js version, OS, Hudu version)
- Relevant logs (with sensitive data removed)

### Discussions
Have questions or ideas? Join our [GitHub Discussions](https://github.com/DevSkillsIT/Skills-MCP-Hudu/discussions)

### Email
Technical support: contato@skillsit.com.br

---

## πŸ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## πŸ™ Acknowledgments

- **[Hudu](https://www.usehudu.com/)** - The amazing IT documentation platform
- **[Anthropic](https://www.anthropic.com/)** - For Claude and the MCP specification
- **[Model Context Protocol](https://modelcontextprotocol.io/)** - The protocol that makes this possible
- **MSP Community** - For feedback and feature requests

---

<div align="center">

**Made with ❀️ by Skills IT - Soluçáes em TI - BRAZIL**

*We are an MSP empowering other MSPs with intelligent automation.*

**Version:** 1.1.0 (see `package.json`) | **Last Updated:** August 2026

πŸ‡§πŸ‡· **Proudly Made in Brazil**

[⬆ Back to Top](#-skills-mcp-hudu)

</div>