Skip to content

MCP Server

The Voltimax Platform MCP Server (Voltimax.Platform.McpServer) exposes the platform's metrics and logs APIs as Model Context Protocol (MCP) tools, enabling AI assistants and LLM-based agents to query telemetry data, inspect asset health, and search logs using natural language.

Architecture

The MCP server is a standalone ASP.NET Core application that acts as a proxy between MCP clients (e.g., Claude Desktop, VS Code Copilot) and the Voltimax Platform API:

  • Transport: HTTP with Server-Sent Events (SSE) via ModelContextProtocol.AspNetCore
  • API Client: Refit-generated typed clients (IMetricsApi, ILogsApi) from Voltimax.Platform.Client
  • Configuration: Single McpServer:PlatformApiBaseUrl setting pointing to the platform API

Available Tools

Asset Metrics

ToolDescription
get_asset_summariesLatest telemetry frame for each asset in a gateway
get_asset_inventoryComprehensive inventory of all assets and their ingested metrics
get_asset_healthHealth status based on data freshness and ingestion patterns
get_latest_metricsMost recent value for each metric across all frames
get_metric_statisticsComprehensive statistics (min, max, avg, sum, std dev) over a time range
get_single_metricCurrent value and basic statistics for a specific metric
get_metric_rateRate of change for cumulative metrics (e.g., energy counters)

Metric Definitions

ToolDescription
get_metric_definitionsAll metric schema definitions (keys, units, descriptions)
get_metric_profilesAvailable metric profile levels (Basic, Standard, Advanced)
get_metrics_for_profileMetrics included in a specific profile level
get_ingestion_statsIngestion pipeline statistics and per-gateway breakdowns
get_metric_coverageCoverage analysis comparing defined vs. actually ingested metrics

Telemetry Queries

ToolDescription
query_telemetryFlexible query with filtering by assets, metrics, time ranges, and pagination
query_histogramTime-series histogram bucketed by intervals, grouped by asset and metric

Cross-Asset Analysis

ToolDescription
get_assets_by_metricFind all assets reporting a specific metric
get_cross_asset_aggregateAggregate a metric across all assets (sum, avg, min, max)
get_top_assetsRank assets by metric values (top N highest/lowest)

Logs

ToolDescription
search_logsSearch gateway logs using Elasticsearch query syntax

Configuration

The server requires a single configuration section in appsettings.json:

json
{
  "McpServer": {
    "PlatformApiBaseUrl": "https://localhost:5001"
  }
}
SettingDescriptionDefault
PlatformApiBaseUrlBase URL of the Voltimax Platform APIhttps://localhost:5001

Running Locally

bash
dotnet run --project src/Voltimax.Platform.McpServer

The server starts on https://localhost:46408 (HTTP: http://localhost:46409) by default.

Connecting an MCP Client

Claude Desktop

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

json
{
  "mcpServers": {
    "voltimax": {
      "url": "http://localhost:46409/sse"
    }
  }
}

VS Code (Copilot)

Add to your workspace .vscode/mcp.json:

json
{
  "servers": {
    "voltimax": {
      "type": "sse",
      "url": "http://localhost:46409/sse"
    }
  }
}