Skip to main content

qyl MCP Server

The qyl MCP server enables AI agents to query and analyze telemetry data via the Model Context Protocol.

Installation

The MCP server is included in the qyl package:
# Install globally
dotnet tool install -g qyl.mcp

# Or run from source
dotnet run --project src/qyl.mcp

Configuration

Configure your AI tool to use the qyl MCP server:
Add to ~/.config/claude/claude_desktop_config.json:
{
  "mcpServers": {
    "qyl": {
      "command": "qyl-mcp",
      "env": {
        "QYL_COLLECTOR_URL": "http://localhost:5100",
        "QYL_MCP_TOKEN": "your-token-here"
      }
    }
  }
}

Authentication

Set QYL_MCP_TOKEN to match the collector’s QYL_TOKEN:
# Collector
export QYL_TOKEN=my-secret-token

# MCP Server
export QYL_MCP_TOKEN=my-secret-token
The MCP server sends the token via the x-mcp-api-key header (Aspire-compatible).
If no token is configured, auth is disabled (dev mode). Always set tokens in production.

Available Tools

Trace Tools

ToolDescription
qyl.get_traceGet a complete distributed trace by ID
qyl.list_sessionsList all telemetry sessions
qyl.search_spansSearch spans with filters

Log Tools

ToolDescription
qyl.list_structured_logsQuery OTLP log records
qyl.list_trace_logsGet all logs for a trace
qyl.search_logsSearch logs by pattern
qyl.list_console_logsList frontend console messages
qyl.list_console_errorsQuick access to console errors

GenAI Tools

ToolDescription
qyl.get_genai_statsToken usage, costs, latency summary
qyl.list_genai_spansQuery LLM calls with filters
qyl.list_modelsUsage breakdown by AI model
qyl.get_token_timeseriesToken consumption over time

Storage Tools

ToolDescription
qyl.get_storage_statsDatabase statistics
qyl.health_checkCollector health status

Replay Tools

ToolDescription
qyl.replay_traceReplay a trace to see timing
qyl.export_traceExport trace as JSON

Example Usage

Once configured, AI agents can query your telemetry:
What errors occurred in the last hour?

Aspire Parity

The qyl MCP server provides equivalent functionality to Aspire’s MCP tools:
Aspire Toolqyl Equivalent
list_resourcesqyl.list_sessions, qyl.health_check
list_console_logsqyl.list_console_logs
list_structured_logsqyl.list_structured_logs
list_tracesqyl.get_trace, qyl.list_sessions
list_trace_structured_logsqyl.list_trace_logs
execute_resource_commandN/A (qyl is collector-only)

Environment Variables

VariableDefaultDescription
QYL_COLLECTOR_URLhttp://localhost:5100Collector base URL
QYL_MCP_TOKEN(none)API key for authentication