Skip to main content

OpenTelemetry MCP Server Configuration

The TalkOps OpenTelemetry MCP Server is configured using standard environment variables. You can pass these via .env files for local development, inject them through Docker flags, or mount them from Kubernetes ConfigMap and Secret objects in production.


Server & Transport Settings

Configure how MCP clients (Claude Desktop, Cursor, Cline, or backend orchestrators) connect to the server.

VariableDefaultAllowed ValuesDescription
MCP_TRANSPORTstdiostdio, http, sse, streamable-httpCommunication protocol for MCP JSON-RPC messages.
MCP_HOST0.0.0.0Valid IP AddressNetwork interface to bind for HTTP/SSE transports.
MCP_PORT8771Valid TCP PortListening port for HTTP/SSE servers.
MCP_PATH/mcpURL PathBase endpoint path for JSON-RPC message handling.
MCP_LOG_LEVELINFODEBUG, INFO, WARNING, ERRORLogging verbosity for operational diagnostics.
MCP_LOG_FORMATjsonjson, textStructured JSON or human-readable plain text output.
MCP_HTTP_TIMEOUT300Integer (Seconds)Maximum client request duration before timing out.

Kubernetes & Operator Integration

The server directly queries and modifies OpenTelemetry Operator custom resources. Adjust these if your cluster uses customized CRD group names or legacy API versions.

VariableDefaultDescription
K8S_ENABLEDtrueEnable or disable Kubernetes API interactions. (Set false for standalone registry testing).
K8S_IN_CLUSTERfalseSet to true when running inside a Pod with an attached ServiceAccountToken.
OTEL_CRD_GROUPopentelemetry.ioAPI Group name for OpenTelemetry Custom Resource Definitions.
OTEL_CRD_API_VERSIONv1beta1API version for OpenTelemetryCollector CRDs.
OTEL_INSTRUMENTATION_API_VERSIONv1alpha1API version for Instrumentation CRDs (promoted independently from Collectors).
OTEL_COLLECTOR_PLURALopentelemetrycollectorsPlural resource name for Collector CRDs.
OTEL_INSTRUMENTATION_PLURALinstrumentationsPlural resource name for Instrumentation CRDs.
OTEL_TA_SERVICE_DISCOVERYtrueEnable Target Allocator service discovery across namespaces.
OTEL_TA_DEFAULT_PORT8080Default listening port for Target Allocator instances.

Backend Discovery & Language Registry

VariableDefaultDescription
PROMETHEUS_BASE_URL(empty)Optional HTTP endpoint for Prometheus (used to validate live series counts during cardinality audits).
PROMETHEUS_TIMEOUT30Request timeout for Prometheus queries in seconds.
PROMETHEUS_VERIFY_SSLtrueEnable SSL certificate verification for remote backend queries.
OTEL_LANG_REGISTRY_PATH(builtin)Custom filesystem path to override the bundled language support matrix JSON.

Kubernetes RBAC Requirements

When running in-cluster or using intent-driven collector provisioning (otel_provision_collector), the MCP server's ServiceAccount needs permissions to manage OTel CRDs, inspect Pods/Deployments, and create the necessary ClusterRole / ClusterRoleBinding resources for the k8sattributes processor:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: talkops-opentelemetry-mcp-role
rules:
# OpenTelemetry Operator CRDs
- apiGroups: ["opentelemetry.io"]
resources: ["opentelemetrycollectors", "instrumentations"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

# Workload inspection & auto-instrumentation injection
- apiGroups: ["apps"]
resources: ["deployments", "daemonsets", "statefulsets"]
verbs: ["get", "list", "watch", "update", "patch"]

# Pod, namespace, and service discovery
- apiGroups: [""]
resources: ["pods", "services", "namespaces", "configmaps", "secrets"]
verbs: ["get", "list", "watch"]

# Dynamic RBAC creation for k8sattributes enrichment
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterroles", "clusterrolebindings"]
verbs: ["get", "create", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: talkops-opentelemetry-mcp-binding
subjects:
- kind: ServiceAccount
name: talkops-opentelemetry-mcp-sa
namespace: monitoring
roleRef:
kind: ClusterRole
name: talkops-opentelemetry-mcp-role
apiGroup: rbac.authorization.k8s.io

Production Deployment Manifest

Here is a ready-to-apply Kubernetes Deployment manifest for running the OpenTelemetry MCP server in your monitoring namespace:

apiVersion: apps/v1
kind: Deployment
metadata:
name: opentelemetry-mcp-server
namespace: monitoring
labels:
app.kubernetes.io/name: opentelemetry-mcp-server
app.kubernetes.io/part-of: talkops
spec:
replicas: 1
selector:
matchLabels:
app: opentelemetry-mcp-server
template:
metadata:
labels:
app: opentelemetry-mcp-server
spec:
serviceAccountName: talkops-opentelemetry-mcp-sa
containers:
- name: server
image: talkopsai/opentelemetry-mcp-server:latest
imagePullPolicy: IfNotPresent
env:
- name: MCP_TRANSPORT
value: "http"
- name: MCP_PORT
value: "8771"
- name: K8S_IN_CLUSTER
value: "true"
- name: MCP_LOG_LEVEL
value: "INFO"
ports:
- containerPort: 8771
name: http-mcp
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
livenessProbe:
httpGet:
path: /mcp
port: http-mcp
initialDelaySeconds: 10
periodSeconds: 15