Skip to main content

MCP Overview

NeXuS includes a Model Context Protocol (MCP) server that lets AI assistants like Claude Code and Claude Desktop interact directly with your infrastructure.

What is MCP?

The Model Context Protocol is an open standard that allows AI models to call tools exposed by external servers. NeXuS implements an MCP server that exposes 8 tools for container management, health monitoring, and log analysis.

How It Works

Claude Code / Claude Desktop

▼ (POST /mcp)
┌───────────────────┐
│ Cloudflare Edge │ ← Service Token Auth
└───────┬───────────┘

┌───────▼───────────┐
│ NeXuS MCP Server │ (port 5001)
│ StreamableHTTP │
└───────┬───────────┘

├── docker ps / docker stats
├── docker logs
├── HTTP health checks
└── nexus-api:4000/stats
  1. Claude sends a tool call request to https://mcp.sebhosting.com/mcp
  2. The request is authenticated via Cloudflare Service Tokens
  3. The MCP server executes the tool (Docker commands, HTTP checks, or API calls)
  4. Results are returned as structured data with human-readable text

Server Architecture

The MCP server is built with:

  • @modelcontextprotocol/sdk — Official MCP SDK
  • StreamableHTTPServerTransport — HTTP-based transport with JSON response mode
  • Express.js — HTTP server framework
  • Three tool modules: containers, services, logs

Authentication

The MCP server uses Cloudflare Service Tokens for authentication. When tokens are configured, every request to POST /mcp must include:

cf-access-client-id: <service-token-id>
cf-access-client-secret: <service-token-secret>

If the tokens are not configured (local development), authentication is bypassed.

Tool Categories

CategoryToolsDescription
Containers4 toolsList, restart, stop, and get stats for Docker containers
Services2 toolsHealth check all services, system overview
Logs2 toolsFetch and search container logs

See the full Tools Reference for detailed documentation of each tool.