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
- Claude sends a tool call request to
https://mcp.sebhosting.com/mcp - The request is authenticated via Cloudflare Service Tokens
- The MCP server executes the tool (Docker commands, HTTP checks, or API calls)
- Results are returned as structured data with human-readable text
Server Architecture
The MCP server is built with:
@modelcontextprotocol/sdk— Official MCP SDKStreamableHTTPServerTransport— 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
| Category | Tools | Description |
|---|---|---|
| Containers | 4 tools | List, restart, stop, and get stats for Docker containers |
| Services | 2 tools | Health check all services, system overview |
| Logs | 2 tools | Fetch and search container logs |
See the full Tools Reference for detailed documentation of each tool.