Skip to main content

Model Context Protocol (MCP) server for Dell Unity Storage Systems

Project description

Dell Unity MCP Server

PyPI version PyPI downloads CI Python Version License: MIT Code style: black Ruff

A Model Context Protocol (MCP) server for Dell Unity storage arrays that automatically generates tools from OpenAPI specifications with a credential-free architecture. Enables AI assistants like Claude and automation platforms like n8n to interact with Unity storage systems.

โœจ Features

Feature Description
๐Ÿ”„ Automatic Tool Generation Dynamically generates 359+ MCP tools from Dell Unity OpenAPI specs
๐Ÿ” Credential-Free Architecture No stored credentials - pass host/username/password with each tool call
๐ŸŒ Multi-Host Support Manage multiple Unity arrays from a single server
๐Ÿ›ก๏ธ Configurable Operations GET-only by default, configurable to enable POST/DELETE
๐Ÿ”Œ Multiple Transports HTTP/SSE for n8n, stdio for Claude Desktop
๐Ÿ“Š Health Monitoring Built-in health checks and metrics endpoints
๐Ÿณ Docker Ready Production-ready container images

๐Ÿ“‹ Table of Contents

๐Ÿš€ Quick Start

# Clone and install
git clone https://github.com/sachdev27/dell-unity-mcp-server.git
cd dell-unity-mcp-server
pip install -e .

# Run HTTP/SSE server (for n8n)
export LOCAL_OPENAPI_SPEC_PATH="./openapi.json"
python -m uvicorn unity_mcp.http_server:app --host 0.0.0.0 --port 8000

# Or run stdio server (for Claude Desktop)
python -m unity_mcp.main

๐Ÿ“ฆ Installation

From Source

From PyPI (Recommended)

pip install dell-unity-mcp-server

From Source

# Clone the repository
git clone https://github.com/sachdev27/dell-unity-mcp-server.git
cd dell-unity-mcp-server

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On macOS/Linux
# venv\Scripts\activate   # On Windows

# Install in development mode
pip install -e ".[dev]"

Using Docker

# Build the image
docker build -t dell-unity-mcp-server .

# Run with SSE transport (GET-only by default)
docker run -p 8000:8000 dell-unity-mcp-server

# Run with full access (GET, POST, DELETE)
docker run -p 8000:8000 -e ALLOWED_HTTP_METHODS="GET,POST,DELETE" dell-unity-mcp-server

Requirements

  • Python: 3.10, 3.11, 3.12, or 3.13
  • Dell Unity: Any supported version with REST API enabled (v5.x recommended)

โš™๏ธ Configuration

Environment Variables

Variable Description Default
LOCAL_OPENAPI_SPEC_PATH Path to OpenAPI specification (required) -
LOG_LEVEL Logging level (DEBUG, INFO, WARNING, ERROR) INFO
HTTP_SERVER_PORT HTTP server port 8000
ALLOWED_HTTP_METHODS Comma-separated list of allowed methods GET
UNITY_HOST Default Unity hostname (optional) -
UNITY_TLS_VERIFY Verify TLS certificates false
REQUEST_TIMEOUT Request timeout in milliseconds 30000
MAX_RETRIES Maximum retry attempts 3

Example .env File

# Required
LOCAL_OPENAPI_SPEC_PATH=/app/openapi.json

# Server Configuration
HTTP_SERVER_PORT=8000
LOG_LEVEL=INFO

# HTTP Methods (GET = read-only, add POST,DELETE for write operations)
ALLOWED_HTTP_METHODS=GET

# Optional Unity defaults
# UNITY_HOST=unity.example.com
# UNITY_TLS_VERIFY=false

Configuring HTTP Methods

By default, the server only exposes GET operations (read-only). To enable write operations:

# Read-only (default) - 359 tools
export ALLOWED_HTTP_METHODS="GET"

# Full access - 777 tools
export ALLOWED_HTTP_METHODS="GET,POST,PUT,PATCH,DELETE"

โš ๏ธ Important: Unity credentials are NOT stored in configuration. They are passed securely with each tool call.

๐Ÿ“– Usage

HTTP/SSE Mode (for n8n and Web Clients)

# Using uvicorn
python -m uvicorn unity_mcp.http_server:app --host 0.0.0.0 --port 8000

# Using the main module
python -m unity_mcp.main --mode http

The server provides:

  • SSE Endpoint: http://localhost:8000/sse
  • Health Check: http://localhost:8000/health
  • Readiness Check: http://localhost:8000/ready
  • Liveness Check: http://localhost:8000/live
  • Metrics: http://localhost:8000/metrics

stdio Mode (for Claude Desktop)

# Using Python module
python -m unity_mcp.main

Docker Compose

# docker-compose.yml
version: '3.8'
services:
  unity-mcp:
    build: .
    ports:
      - "8000:8000"
    environment:
      - ALLOWED_HTTP_METHODS=GET
      - LOG_LEVEL=INFO
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
# Start the server
docker-compose up -d

# View logs
docker-compose logs -f

# Stop the server
docker-compose down

๐Ÿ”— Integration

n8n AI Agent

  1. Add an MCP Client node to your n8n workflow
  2. Configure the connection:
    • Transport: SSE
    • URL: http://localhost:8000/sse
  3. The 359+ Unity tools will be available to AI agents

Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "dell-unity": {
      "command": "/path/to/venv/bin/python",
      "args": ["-m", "unity_mcp.main"],
      "env": {
        "LOCAL_OPENAPI_SPEC_PATH": "/path/to/openapi.json"
      }
    }
  }
}

Custom MCP Clients

import asyncio
from mcp import ClientSession
from mcp.client.sse import sse_client

async def main():
    async with sse_client("http://localhost:8000/sse") as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()

            # List available tools
            tools = await session.list_tools()
            print(f"Found {len(tools.tools)} tools")

            # Get system information
            result = await session.call_tool("systemCollectionQuery", {
                "host": "unity.example.com",
                "username": "admin",
                "password": "password",
                "fields": "id,name,model,serialNumber"
            })
            print(result)

            # Get all LUNs
            result = await session.call_tool("lunCollectionQuery", {
                "host": "unity.example.com",
                "username": "admin",
                "password": "password",
                "fields": "id,name,sizeTotal,pool",
                "per_page": 100
            })
            print(result)

asyncio.run(main())

๐Ÿ”ง Available Tools

The server dynamically generates 359+ tools (GET-only) or 777+ tools (full access) from the Unity OpenAPI specification.

Authentication Parameters

Every tool requires these authentication parameters:

Parameter Type Description
host string Unity hostname or IP
username string Unity username
password string Unity password

Tool Categories

Category Example Tools Description
Storage lunCollectionQuery, poolCollectionQuery LUN and pool management
System systemCollectionQuery, licenseCollectionQuery System information
Network ipInterfaceCollectionQuery, fcPortCollectionQuery Network configuration
File Services nasServerCollectionQuery, fileSystemCollectionQuery File storage
Protection snapCollectionQuery, replicationSessionCollectionQuery Data protection
Monitoring alertCollectionQuery, eventCollectionQuery Alerts and events
Host Access hostCollectionQuery, hostLUNCollectionQuery Host management

Query Parameters

All collection endpoints support Unity query parameters:

{
  "host": "unity.example.com",
  "username": "admin",
  "password": "password",
  "fields": "id,name,sizeTotal,health",
  "filter": "name lk 'prod*'",
  "per_page": 100,
  "page": 1,
  "compact": "true"
}

Unity Filter Syntax

Unity uses a specific filter syntax for queries:

Operator Description Example
eq Equals filter=severity eq 4
ne Not equals filter=health.value ne 5
lt Less than filter=sizeTotal lt 1073741824
gt Greater than filter=sizeTotal gt 1073741824
lk Like (wildcard) filter=name lk 'prod*'
and Logical AND filter=severity eq 4 and state eq 2

๐Ÿ—๏ธ Architecture

Credential-Free Design

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Client     โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   MCP Server    โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Dell Unity    โ”‚
โ”‚ (Claude/n8n)    โ”‚     โ”‚ (No Credentials)โ”‚     โ”‚    Array        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                      โ”‚
         โ”‚   Tool Call with     โ”‚   Per-Request
         โ”‚   Credentials        โ”‚   Authentication
         โ–ผ                      โ–ผ
    {host, user, pass}      Basic Auth Header

Key Design Principles

  • No Stored Credentials: Server starts without any Unity connection
  • Per-Request Auth: Each tool call includes host/username/password
  • Fresh Sessions: New API client created for each request
  • Multi-Host Ready: Easily manage multiple Unity arrays
  • Configurable Access: Control which HTTP methods are exposed

Module Structure

unity_mcp/
โ”œโ”€โ”€ __init__.py          # Package initialization and version
โ”œโ”€โ”€ api_client.py        # Async Unity API client with retry logic
โ”œโ”€โ”€ config.py            # Configuration management with validation
โ”œโ”€โ”€ exceptions.py        # Custom exception hierarchy
โ”œโ”€โ”€ http_server.py       # HTTP/SSE transport server
โ”œโ”€โ”€ logging_config.py    # Structured logging configuration
โ”œโ”€โ”€ main.py              # stdio transport entry point
โ”œโ”€โ”€ server.py            # Core MCP server with tool handlers
โ””โ”€โ”€ tool_generator.py    # OpenAPI parser and tool generator

๐Ÿงช Development

Setup Development Environment

# Clone and install with dev dependencies
git clone https://github.com/sachdev27/dell-unity-mcp-server.git
cd dell-unity-mcp-server
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"

Running Tests

# Run all tests
pytest

# Run with verbose output
pytest -v

# Run with coverage
pytest --cov=unity_mcp --cov-report=html

# Run specific test file
pytest tests/test_tool_generator.py -v

Code Quality

# Format code
black unity_mcp tests

# Lint code
ruff check unity_mcp tests

# Type checking
mypy unity_mcp

# Security scan
bandit -r unity_mcp

Building

# Build distribution packages
python -m build

# Build Docker image
docker build -t dell-unity-mcp-server .

๐Ÿค Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

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

๐Ÿ“š Additional Resources


Made with โค๏ธ for the storage automation community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dell_unity_mcp_server-1.0.2.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dell_unity_mcp_server-1.0.2-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file dell_unity_mcp_server-1.0.2.tar.gz.

File metadata

  • Download URL: dell_unity_mcp_server-1.0.2.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for dell_unity_mcp_server-1.0.2.tar.gz
Algorithm Hash digest
SHA256 969e033f0d44e0045dd47d96a1f4eb0aa28f87beb5a222adff4a41b9700f0725
MD5 37aff7ff6cbe7dd1f791dee341b05083
BLAKE2b-256 052e275789876b40a982689c7acef0c271b8b2e0e2efd20a3959b1800046cc34

See more details on using hashes here.

File details

Details for the file dell_unity_mcp_server-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dell_unity_mcp_server-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 46629b8cd609d8a421050e3ca3f903c6796f524253a63a559f37a99da8e5ccec
MD5 6fad6b6e1abbe2244712474b0a7829e1
BLAKE2b-256 3ea2d9867a231fa526f99fd0fa25576f48ba37cc70ba8e228ba19d5ca1c4a24b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page